Overwrite

Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
Unstable Kitsune
2023-11-28 23:20:26 -05:00
parent 3cd54811de
commit b918192e4e
11608 changed files with 2644205 additions and 47 deletions

View File

@@ -0,0 +1,423 @@
using System.Collections.Generic;
using System.Linq;
using System;
using Server.Engines.Craft;
using Server.Items;
using Server.Targeting;
using Server.Engines.VeteranRewards;
using Server.SkillHandlers;
namespace Server.Engines.Craft
{
[AttributeUsage(AttributeTargets.Class)]
public class AlterableAttribute : Attribute
{
public Type CraftSystem { get; private set; }
public Type AlteredType { get; private set; }
public bool Inherit { get; private set; }
public AlterableAttribute(Type craftSystem, Type alteredType, bool inherit = false)
{
CraftSystem = craftSystem;
AlteredType = alteredType;
Inherit = inherit;
}
/// <summary>
/// this enables any craftable item where their parent class can be altered, can be altered too.
/// This is mainly for the ML craftable artifacts.
/// </summary>
/// <returns></returns>
public bool CheckInherit(Type original)
{
if (Inherit)
return true;
var system = CraftContext.Systems.FirstOrDefault(sys => sys.GetType() == CraftSystem);
if (system != null)
{
return system.CraftItems.SearchFor(original) != null;
}
return false;
}
}
public class AlterItem
{
public static void BeginTarget(Mobile from, CraftSystem system, ITool tool)
{
from.Target = new AlterItemTarget(system, tool);
from.SendLocalizedMessage(1094730); //Target the item to altar
}
public static void BeginTarget(Mobile from, CraftSystem system, Item contract)
{
from.Target = new AlterItemTarget(system, contract);
from.SendLocalizedMessage(1094730); //Target the item to altar
}
}
public class AlterItemTarget : Target
{
private readonly CraftSystem m_System;
private readonly ITool m_Tool;
private Item m_Contract;
public AlterItemTarget(CraftSystem system, Item contract)
: base(2, false, TargetFlags.None)
{
m_System = system;
m_Contract = contract;
}
public AlterItemTarget(CraftSystem system, ITool tool)
: base(1, false, TargetFlags.None)
{
this.m_System = system;
this.m_Tool = tool;
}
private static AlterableAttribute GetAlterableAttribute(object o, bool inherit)
{
Type t = o.GetType();
object[] attrs = t.GetCustomAttributes(typeof(AlterableAttribute), inherit);
if (attrs != null && attrs.Length > 0)
{
AlterableAttribute attr = attrs[0] as AlterableAttribute;
if (attr != null && (!inherit || attr.CheckInherit(t)))
return attr;
}
return null;
}
protected override void OnTarget(Mobile from, object o)
{
int number = -1;
Item origItem = o as Item;
SkillName skill = m_System.MainSkill;
double value = from.Skills[skill].Value;
var alterInfo = GetAlterableAttribute(o, false);
if (alterInfo == null)
{
alterInfo = GetAlterableAttribute(o, true);
}
if (origItem == null || !origItem.IsChildOf(from.Backpack))
{
number = 1094729; // The item must be in your backpack for you to alter it.
}
else if (origItem is BlankScroll)
{
if (m_Contract == null)
{
if (value >= 100.0)
{
Item contract = null;
if (skill == SkillName.Blacksmith)
contract = new AlterContract(RepairSkillType.Smithing, from);
else if (skill == SkillName.Carpentry)
contract = new AlterContract(RepairSkillType.Carpentry, from);
else if (skill == SkillName.Tailoring)
contract = new AlterContract(RepairSkillType.Tailoring, from);
else if (skill == SkillName.Tinkering)
contract = new AlterContract(RepairSkillType.Tinkering, from);
if (contract != null)
{
from.AddToBackpack(contract);
number = 1044154; // You create the item.
// Consume a blank scroll
origItem.Consume();
}
}
else
{
number = 1111869; // You must be at least grandmaster level to create an alter service contract.
}
}
else
{
number = 1094728; // You may not alter that item.
}
}
else if (alterInfo == null)
{
number = 1094728; // You may not alter that item.
}
else if (!IsAlterable(origItem))
{
number = 1094728; // You may not alter that item.
}
else if (alterInfo.CraftSystem != m_System.GetType())
{
if (m_Tool != null)
{
// You may not alter that item.
number = 1094728;
}
else
{
// You cannot alter that item with this type of alter contract.
number = 1094793;
}
}
else if (!Server.SkillHandlers.Imbuing.CheckSoulForge(from, 2, false, false))
{
number = 1111867; // You must be near a soulforge to alter an item.
}
else if (m_Contract == null && value < 100.0)
{
number = 1111870; // You must be at least grandmaster level to alter an item.
}
else if (origItem is BaseWeapon && ((BaseWeapon)origItem).EnchantedWeilder != null)
{
number = 1111849; // You cannot alter an item that is currently enchanted.
}
else if (origItem.HasSocket<SlayerSocket>())
{
var socket = origItem.GetSocket<SlayerSocket>();
if (socket.Slayer == SlayerName.Silver)
{
number = 1155681; // You cannot alter an item that has been treated with Tincture of Silver.
}
else
{
number = 1111849; // You cannot alter an item that is currently enchanted.
}
}
else
{
Item newitem = Activator.CreateInstance(alterInfo.AlteredType) as Item;
if (newitem == null)
return;
if (origItem is BaseWeapon && newitem is BaseWeapon)
{
BaseWeapon oldweapon = (BaseWeapon)origItem;
BaseWeapon newweapon = (BaseWeapon)newitem;
newweapon.Slayer = oldweapon.Slayer;
newweapon.Slayer2 = oldweapon.Slayer2;
newweapon.Slayer3 = oldweapon.Slayer3;
newweapon.Resource = oldweapon.Resource;
if (oldweapon.PlayerConstructed)
{
newweapon.PlayerConstructed = true;
newweapon.Crafter = oldweapon.Crafter;
newweapon.Quality = oldweapon.Quality;
}
newweapon.Altered = true;
}
else if (origItem is BaseArmor && newitem is BaseArmor)
{
BaseArmor oldarmor = (BaseArmor)origItem;
BaseArmor newarmor = (BaseArmor)newitem;
if (oldarmor.PlayerConstructed)
{
newarmor.PlayerConstructed = true;
newarmor.Crafter = oldarmor.Crafter;
newarmor.Quality = oldarmor.Quality;
}
newarmor.Resource = oldarmor.Resource;
newarmor.PhysicalBonus = oldarmor.PhysicalBonus;
newarmor.FireBonus = oldarmor.FireBonus;
newarmor.ColdBonus = oldarmor.ColdBonus;
newarmor.PoisonBonus = oldarmor.PoisonBonus;
newarmor.EnergyBonus = oldarmor.EnergyBonus;
newarmor.Altered = true;
}
else if (origItem is BaseClothing && newitem is BaseClothing)
{
BaseClothing oldcloth = (BaseClothing)origItem;
BaseClothing newcloth = (BaseClothing)newitem;
if (oldcloth.PlayerConstructed)
{
newcloth.PlayerConstructed = true;
newcloth.Crafter = oldcloth.Crafter;
newcloth.Quality = oldcloth.Quality;
}
newcloth.Altered = true;
}
else if (origItem is BaseClothing && newitem is BaseArmor)
{
BaseClothing oldcloth = (BaseClothing)origItem;
BaseArmor newarmor = (BaseArmor)newitem;
if (oldcloth.PlayerConstructed)
{
int qual = (int)oldcloth.Quality;
newarmor.PlayerConstructed = true;
newarmor.Crafter = oldcloth.Crafter;
newarmor.Quality = (ItemQuality)qual;
}
newarmor.Altered = true;
}
else if (origItem is BaseQuiver && newitem is BaseArmor)
{
/*BaseQuiver oldquiver = (BaseQuiver)origItem;
BaseArmor newarmor = (BaseArmor)newitem;*/
((BaseArmor)newitem).Altered = true;
}
else
{
return;
}
if (origItem.Name != null)
{
newitem.Name = origItem.Name;
}
else if (Server.Engines.VendorSearching.VendorSearch.StringList != null)
{
if (origItem.LabelNumber > 0 && RetainsName(origItem))
newitem.Name = Server.Engines.VendorSearching.VendorSearch.StringList.GetString(origItem.LabelNumber);
}
AlterResists(newitem, origItem);
newitem.Hue = origItem.Hue;
newitem.LootType = origItem.LootType;
newitem.Insured = origItem.Insured;
origItem.OnAfterDuped(newitem);
newitem.Parent = null;
if (origItem is IDurability && newitem is IDurability)
{
((IDurability)newitem).MaxHitPoints = ((IDurability)origItem).MaxHitPoints;
((IDurability)newitem).HitPoints = ((IDurability)origItem).HitPoints;
}
if (from.Backpack == null)
newitem.MoveToWorld(from.Location, from.Map);
else
from.Backpack.DropItem(newitem);
newitem.InvalidateProperties();
if (m_Contract != null)
m_Contract.Delete();
origItem.Delete();
EventSink.InvokeAlterItem(new AlterItemEventArgs(from, m_Tool is Item ? (Item)m_Tool : m_Contract, origItem, newitem));
number = 1094727; // You have altered the item.
}
if (m_Tool != null)
from.SendGump(new CraftGump(from, m_System, m_Tool, number));
else
from.SendLocalizedMessage(number);
}
private void AlterResists(Item newItem, Item oldItem)
{
if (newItem is BaseArmor || newItem is BaseClothing)
{
var newResists = Imbuing.GetBaseResists(newItem);
var oldResists = Imbuing.GetBaseResists(oldItem);
for (int i = 0; i < newResists.Length; i++)
{
if (oldResists[i] > newResists[i])
{
Imbuing.SetProperty(newItem, 51 + i, oldResists[i] - newResists[i]);
}
}
}
}
private bool RetainsName(Item item)
{
if (item is Glasses || item is ElvenGlasses || item.IsArtifact)
return true;
if (item is IArtifact && ((IArtifact)item).ArtifactRarity > 0)
return true;
return (item.LabelNumber >= 1073505 && item.LabelNumber <= 1073552) || (item.LabelNumber >= 1073111 && item.LabelNumber <= 1075040);
}
private static bool IsAlterable(Item item)
{
if (item is BaseWeapon)
{
BaseWeapon weapon = (BaseWeapon)item;
if (weapon.SetID != SetItem.None || !weapon.CanAlter || weapon.NegativeAttributes.Antique != 0)
return false;
if ((weapon.RequiredRace != null && weapon.RequiredRace == Race.Gargoyle && !weapon.IsArtifact))
return false;
}
if (item is BaseArmor)
{
BaseArmor armor = (BaseArmor)item;
if (armor.SetID != SetItem.None || !armor.CanAlter || armor.NegativeAttributes.Antique != 0)
return false;
if ((armor.RequiredRace != null && armor.RequiredRace == Race.Gargoyle && !armor.IsArtifact))
return false;
if (armor is RingmailGlovesOfMining && armor.Resource > CraftResource.Iron)
return false;
}
if (item is BaseClothing)
{
BaseClothing cloth = (BaseClothing)item;
if (cloth.SetID != SetItem.None || !cloth.CanAlter || cloth.NegativeAttributes.Antique != 0)
return false;
if ((cloth.RequiredRace != null && cloth.RequiredRace == Race.Gargoyle && !cloth.IsArtifact))
return false;
}
if (item is BaseQuiver)
{
BaseQuiver quiver = (BaseQuiver) item;
if (quiver.SetID != SetItem.None || !quiver.CanAlter)
return false;
}
if (item is IVvVItem && ((IVvVItem)item).IsVvVItem)
return false;
if (item is IRewardItem)
return false;
return true;
}
}
}

View File

@@ -0,0 +1,156 @@
using System;
using Server;
using Server.Prompts;
using System.Collections.Generic;
using Server.Items;
namespace Server.Engines.Craft
{
public class MakeNumberCraftPrompt : Prompt
{
private Mobile m_From;
private CraftSystem m_CraftSystem;
private CraftItem m_CraftItem;
private ITool m_Tool;
public MakeNumberCraftPrompt(Mobile from, CraftSystem system, CraftItem item, ITool tool)
{
m_From = from;
m_CraftSystem = system;
m_CraftItem = item;
m_Tool = tool;
}
public override void OnCancel(Mobile from)
{
m_From.SendLocalizedMessage(501806); //Request cancelled.
from.SendGump(new CraftGump(m_From, m_CraftSystem, m_Tool, null));
}
public override void OnResponse(Mobile from, string text)
{
int amount = Utility.ToInt32(text);
if (amount < 1 || amount > 100)
{
from.SendLocalizedMessage(1112587); // Invalid Entry.
ResendGump();
}
else
{
AutoCraftTimer.EndTimer(from);
new AutoCraftTimer(m_From, m_CraftSystem, m_CraftItem, m_Tool, amount, TimeSpan.FromSeconds(m_CraftSystem.Delay * m_CraftSystem.MaxCraftEffect + 1.0), TimeSpan.FromSeconds(m_CraftSystem.Delay * m_CraftSystem.MaxCraftEffect + 1.0));
CraftContext context = m_CraftSystem.GetContext(from);
if (context != null)
context.MakeTotal = amount;
}
}
public void ResendGump()
{
m_From.SendGump(new CraftGump(m_From, m_CraftSystem, m_Tool, null));
}
}
public class AutoCraftTimer : Timer
{
private static Dictionary<Mobile, AutoCraftTimer> m_AutoCraftTable = new Dictionary<Mobile, AutoCraftTimer>();
public static Dictionary<Mobile, AutoCraftTimer> AutoCraftTable { get { return m_AutoCraftTable; } }
private Mobile m_From;
private CraftSystem m_CraftSystem;
private CraftItem m_CraftItem;
private ITool m_Tool;
private int m_Amount;
private int m_Attempts;
private int m_Ticks;
private Type m_TypeRes;
public int Amount { get { return m_Amount; } }
public int Attempts { get { return m_Attempts; } }
public AutoCraftTimer(Mobile from, CraftSystem system, CraftItem item, ITool tool, int amount, TimeSpan delay, TimeSpan interval)
: base(delay, interval)
{
m_From = from;
m_CraftSystem = system;
m_CraftItem = item;
m_Tool = tool;
m_Amount = amount;
m_Ticks = 0;
m_Attempts = 0;
CraftContext context = m_CraftSystem.GetContext(m_From);
if (context != null)
{
CraftSubResCol res = (m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes);
int resIndex = (m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);
if (resIndex > -1)
m_TypeRes = res.GetAt(resIndex).ItemType;
}
m_AutoCraftTable[from] = this;
this.Start();
}
public AutoCraftTimer(Mobile from, CraftSystem system, CraftItem item, ITool tool, int amount)
: this(from, system, item, tool, amount, TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(3))
{
}
protected override void OnTick()
{
m_Ticks++;
if (m_From.NetState == null)
{
EndTimer(m_From);
return;
}
CraftItem();
if (m_Ticks >= m_Amount)
EndTimer(m_From);
}
private void CraftItem()
{
if (m_From.HasGump(typeof(CraftGump)))
m_From.CloseGump(typeof(CraftGump));
if (m_From.HasGump(typeof(CraftGumpItem)))
m_From.CloseGump(typeof(CraftGumpItem));
m_Attempts++;
if (m_CraftItem.TryCraft != null)
{
m_CraftItem.TryCraft(m_From, m_CraftItem, m_Tool);
}
else
{
m_CraftSystem.CreateItem(m_From, m_CraftItem.ItemType, m_TypeRes, m_Tool, m_CraftItem);
}
}
public static void EndTimer(Mobile from)
{
if (m_AutoCraftTable.ContainsKey(from))
{
m_AutoCraftTable[from].Stop();
m_AutoCraftTable.Remove(from);
}
}
public static bool HasTimer(Mobile from)
{
return from != null && m_AutoCraftTable.ContainsKey(from);
}
}
}

View File

@@ -0,0 +1,329 @@
using System;
using System.IO;
using System.Collections.Generic;
using Server.Engines.Plants;
namespace Server.Engines.Craft
{
public enum CraftMarkOption
{
MarkItem,
DoNotMark,
PromptForMark
}
#region SA
public enum CraftQuestOption
{
QuestItem,
NonQuestItem
}
#endregion
public class CraftContext
{
public Mobile Owner { get; private set; }
public CraftSystem System { get; private set; }
private readonly List<CraftItem> m_Items;
private int m_LastResourceIndex;
private int m_LastResourceIndex2;
private int m_LastGroupIndex;
private bool m_DoNotColor;
private CraftMarkOption m_MarkOption;
private CraftQuestOption m_QuestOption;
private int m_MakeTotal;
private PlantHue m_RequiredPlantHue;
#region Hue State Vars
/*private bool m_CheckedHues;
private List<int> m_Hues;
private Item m_CompareHueTo;
public bool CheckedHues
{
get
{
return m_CheckedHues;
}
set
{
m_CheckedHues = value;
}
}
public List<int> Hues
{
get
{
return m_Hues;
}
set
{
m_Hues = value;
}
}
public Item CompareHueTo
{
get
{
return m_CompareHueTo;
}
set
{
m_CompareHueTo = value;
}
}*/
#endregion
public List<CraftItem> Items
{
get
{
return m_Items;
}
}
public int LastResourceIndex
{
get
{
return m_LastResourceIndex;
}
set
{
m_LastResourceIndex = value;
}
}
public int LastResourceIndex2
{
get
{
return m_LastResourceIndex2;
}
set
{
m_LastResourceIndex2 = value;
}
}
public int LastGroupIndex
{
get
{
return m_LastGroupIndex;
}
set
{
m_LastGroupIndex = value;
}
}
public bool DoNotColor
{
get
{
return m_DoNotColor;
}
set
{
m_DoNotColor = value;
}
}
public CraftMarkOption MarkOption
{
get
{
return m_MarkOption;
}
set
{
m_MarkOption = value;
}
}
#region SA
public CraftQuestOption QuestOption
{
get
{
return m_QuestOption;
}
set
{
m_QuestOption = value;
}
}
public int MakeTotal
{
get
{
return m_MakeTotal;
}
set
{
m_MakeTotal = value;
}
}
public PlantHue RequiredPlantHue
{
get { return m_RequiredPlantHue; }
set { m_RequiredPlantHue = value; }
}
public PlantPigmentHue RequiredPigmentHue { get; set; }
#endregion
public CraftContext(Mobile owner, CraftSystem system)
{
Owner = owner;
System = system;
m_Items = new List<CraftItem>();
m_LastResourceIndex = -1;
m_LastResourceIndex2 = -1;
m_LastGroupIndex = -1;
m_QuestOption = CraftQuestOption.NonQuestItem;
m_RequiredPlantHue = PlantHue.None;
RequiredPigmentHue = PlantPigmentHue.None;
Contexts.Add(this);
}
public CraftItem LastMade
{
get
{
if (m_Items.Count > 0)
return m_Items[0];
return null;
}
}
public void OnMade(CraftItem item)
{
m_Items.Remove(item);
if (m_Items.Count == 10)
m_Items.RemoveAt(9);
m_Items.Insert(0, item);
}
public virtual void Serialize(GenericWriter writer)
{
writer.Write((int)0);
writer.Write(Owner);
writer.Write(GetSystemIndex(System));
writer.Write(m_LastResourceIndex);
writer.Write(m_LastResourceIndex2);
writer.Write(m_LastGroupIndex);
writer.Write(m_DoNotColor);
writer.Write((int)m_MarkOption);
writer.Write((int)m_QuestOption);
writer.Write(m_MakeTotal);
}
public CraftContext(GenericReader reader)
{
int version = reader.ReadInt();
m_Items = new List<CraftItem>();
Owner = reader.ReadMobile();
int sysIndex = reader.ReadInt();
m_LastResourceIndex = reader.ReadInt();
m_LastResourceIndex2 = reader.ReadInt();
m_LastGroupIndex = reader.ReadInt();
m_DoNotColor = reader.ReadBool();
m_MarkOption = (CraftMarkOption)reader.ReadInt();
m_QuestOption = (CraftQuestOption)reader.ReadInt();
m_MakeTotal = reader.ReadInt();
System = GetCraftSystem(sysIndex);
if (System != null && Owner != null)
{
System.AddContext(Owner, this);
Contexts.Add(this);
}
}
public int GetSystemIndex(CraftSystem system)
{
for (int i = 0; i < _Systems.Length; i++)
{
if (_Systems[i] == system)
return i;
}
return -1;
}
public CraftSystem GetCraftSystem(int i)
{
if (i >= 0 && i < _Systems.Length)
return _Systems[i];
return null;
}
#region Serialize/Deserialize Persistence
private static string FilePath = Path.Combine("Saves", "CraftContext", "Contexts.bin");
private static List<CraftContext> Contexts = new List<CraftContext>();
public static CraftSystem[] Systems { get { return _Systems; } }
private static CraftSystem[] _Systems = new CraftSystem[11];
public static void Configure()
{
_Systems[0] = DefAlchemy.CraftSystem;
_Systems[1] = DefBlacksmithy.CraftSystem;
_Systems[2] = DefBowFletching.CraftSystem;
_Systems[3] = DefCarpentry.CraftSystem;
_Systems[4] = DefCartography.CraftSystem;
_Systems[5] = DefCooking.CraftSystem;
_Systems[6] = DefGlassblowing.CraftSystem;
_Systems[7] = DefInscription.CraftSystem;
_Systems[8] = DefMasonry.CraftSystem;
_Systems[9] = DefTailoring.CraftSystem;
_Systems[10] = DefTinkering.CraftSystem;
EventSink.WorldSave += OnSave;
EventSink.WorldLoad += OnLoad;
}
public static void OnSave(WorldSaveEventArgs e)
{
Persistence.Serialize(
FilePath,
writer =>
{
writer.Write(0); // version
writer.Write(Contexts.Count);
Contexts.ForEach(c => c.Serialize(writer));
});
}
public static void OnLoad()
{
Persistence.Deserialize(
FilePath,
reader =>
{
int version = reader.ReadInt();
int count = reader.ReadInt();
for (int i = 0; i < count; i++)
{
new CraftContext(reader);
}
});
}
#endregion
}
}

View File

@@ -0,0 +1,43 @@
using System;
namespace Server.Engines.Craft
{
public class CraftGroup
{
private readonly CraftItemCol m_arCraftItem;
private readonly string m_NameString;
private readonly int m_NameNumber;
public CraftGroup(TextDefinition groupName)
{
this.m_NameNumber = groupName;
this.m_NameString = groupName;
this.m_arCraftItem = new CraftItemCol();
}
public CraftItemCol CraftItems
{
get
{
return this.m_arCraftItem;
}
}
public string NameString
{
get
{
return this.m_NameString;
}
}
public int NameNumber
{
get
{
return this.m_NameNumber;
}
}
public void AddCraftItem(CraftItem craftItem)
{
this.m_arCraftItem.Add(craftItem);
}
}
}

View File

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

View File

@@ -0,0 +1,783 @@
using System;
using System.Collections.Generic;
using Server.Gumps;
using Server.Items;
using Server.Network;
namespace Server.Engines.Craft
{
public class CraftGump : Gump
{
private readonly Mobile m_From;
private readonly CraftSystem m_CraftSystem;
private readonly ITool m_Tool;
private readonly CraftPage m_Page;
private const int LabelHue = 0x480;
private const int LabelColor = 0x7FFF;
private const int FontColor = 0xFFFFFF;
public bool Locked { get { return AutoCraftTimer.HasTimer(m_From); } }
private enum CraftPage
{
None,
PickResource,
PickResource2
}
/*public CraftGump( Mobile from, CraftSystem craftSystem, ITool tool ): this( from, craftSystem, -1, -1, tool, null )
{
}*/
public CraftGump(Mobile from, CraftSystem craftSystem, ITool tool, object notice)
: this(from, craftSystem, tool, notice, CraftPage.None)
{
}
private CraftGump(Mobile from, CraftSystem craftSystem, ITool tool, object notice, CraftPage page)
: base(40, 40)
{
m_From = from;
m_CraftSystem = craftSystem;
m_Tool = tool;
m_Page = page;
CraftContext context = craftSystem.GetContext(from);
from.CloseGump(typeof(CraftGump));
from.CloseGump(typeof(CraftGumpItem));
AddPage(0);
AddBackground(0, 0, 530, 497, 5054);
AddImageTiled(10, 10, 510, 22, 2624);
AddImageTiled(10, 292, 150, 45, 2624);
AddImageTiled(165, 292, 355, 45, 2624);
AddImageTiled(10, 342, 510, 145, 2624);
AddImageTiled(10, 37, 200, 250, 2624);
AddImageTiled(215, 37, 305, 250, 2624);
AddAlphaRegion(10, 10, 510, 477);
if (craftSystem.GumpTitleNumber > 0)
AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false);
else
AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false);
AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor, false, false); // <CENTER>CATEGORIES</CENTER>
AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER>
AddHtmlLocalized(10, 302, 150, 25, 1044012, LabelColor, false, false); // <CENTER>NOTICES</CENTER>
AddButton(15, 442, 4017, 4019, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(50, 445, 150, 18, 1011441, LabelColor, false, false); // EXIT
AddButton(115, 442, 4017, 4019, GetButtonID(6, 11), GumpButtonType.Reply, 0);
AddHtmlLocalized(150, 445, 150, 18, 1112698, LabelColor, false, false); // CANCEL MAKE
// Repair option
if (m_CraftSystem.Repair)
{
AddButton(270, 342, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0);
AddHtmlLocalized(305, 345, 150, 18, 1044260, LabelColor, false, false); // REPAIR ITEM
}
// ****************************************
// Mark option
if (m_CraftSystem.MarkOption)
{
AddButton(270, 362, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0);
AddHtmlLocalized(305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false); // MARK ITEM
}
// ****************************************
// Enhance option
if (m_CraftSystem.CanEnhance)
{
AddButton(270, 382, 4005, 4007, GetButtonID(6, 8), GumpButtonType.Reply, 0);
AddHtmlLocalized(305, 385, 150, 18, 1061001, LabelColor, false, false); // ENHANCE ITEM
}
// ****************************************
#region SA
// Alter option
if (Core.SA && m_CraftSystem.CanAlter)
{
AddButton(270, 402, 4005, 4007, GetButtonID(6, 9), GumpButtonType.Reply, 0);
AddHtmlLocalized(304, 405, 250, 18, 1094726, LabelColor, false, false); // ALTER ITEM (Gargoyle)
}
// ****************************************
// Quest item
if (Core.SA)
{
AddButton(270, 422, 4005, 4007, GetButtonID(6, 10), GumpButtonType.Reply, 0);
AddHtmlLocalized(305, 425, 150, 18, context != null && context.QuestOption == CraftQuestOption.QuestItem ? 1112534 : 1112533, LabelColor, false, false); // QUEST ITEM
}
// ****************************************
#endregion
AddButton(270, 442, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0);
AddHtmlLocalized(305, 445, 150, 18, 1044013, LabelColor, false, false); // MAKE LAST
#region Stygian Abyss
int total = 1;
int made = 0;
if (Locked && AutoCraftTimer.AutoCraftTable.ContainsKey(m_From))
{
AutoCraftTimer timer = AutoCraftTimer.AutoCraftTable[m_From];
if (timer != null)
{
total = timer.Amount;
made = timer.Attempts;
}
else
{
if (context != null)
total = context.MakeTotal;
}
}
string args = String.Format("{0}\t{1}", made.ToString(), total.ToString());
AddHtmlLocalized(270, 468, 150, 18, 1079443, args, LabelColor, false, false); //~1_DONE~/~2_TOTAL~ COMPLETED
#endregion
// Resmelt option
if (m_CraftSystem.Resmelt)
{
AddButton(15, 342, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0);
AddHtmlLocalized(50, 345, 150, 18, 1044259, LabelColor, false, false); // SMELT ITEM
}
// ****************************************
if (notice is int && (int)notice > 0)
AddHtmlLocalized(170, 295, 350, 40, (int)notice, LabelColor, false, false);
else if (notice is string)
AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false);
// If the system has more than one resource
if (craftSystem.CraftSubRes.Init)
{
string nameString = craftSystem.CraftSubRes.NameString;
int nameNumber = craftSystem.CraftSubRes.NameNumber;
int resIndex = (context == null ? -1 : context.LastResourceIndex);
Type resourceType = craftSystem.CraftSubRes.ResType;
if (resIndex > -1)
{
CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex);
nameString = subResource.NameString;
nameNumber = subResource.NameNumber;
resourceType = subResource.ItemType;
}
Type resourceType2 = GetAltType(resourceType);
int resourceCount = 0;
if (from.Backpack != null)
{
Item[] items = from.Backpack.FindItemsByType(resourceType, true);
for (int i = 0; i < items.Length; ++i)
resourceCount += items[i].Amount;
if (resourceType2 != null)
{
Item[] items2 = m_From.Backpack.FindItemsByType(resourceType2, true);
for (int i = 0; i < items2.Length; ++i)
resourceCount += items2[i].Amount;
}
}
AddButton(15, 362, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0);
if (nameNumber > 0)
{
if (context.DoNotColor)
AddLabel(50, 365, LabelHue, "*");
AddHtmlLocalized(50 + (context.DoNotColor ? 13 : 0), 365, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false);
}
else
AddLabel(50, 362, LabelHue, (context.DoNotColor ? "*" : "") + String.Format("{0} ({1} Available)", nameString, resourceCount));
}
// ****************************************
// For dragon scales
if (craftSystem.CraftSubRes2.Init)
{
string nameString = craftSystem.CraftSubRes2.NameString;
int nameNumber = craftSystem.CraftSubRes2.NameNumber;
int resIndex = (context == null ? -1 : context.LastResourceIndex2);
Type resourceType = craftSystem.CraftSubRes2.ResType;
if (resIndex > -1)
{
CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt(resIndex);
nameString = subResource.NameString;
nameNumber = subResource.NameNumber;
resourceType = subResource.ItemType;
}
int resourceCount = 0;
if (from.Backpack != null)
{
Item[] items = from.Backpack.FindItemsByType(resourceType, true);
for (int i = 0; i < items.Length; ++i)
resourceCount += items[i].Amount;
}
AddButton(15, 382, 4005, 4007, GetButtonID(6, 7), GumpButtonType.Reply, 0);
if (nameNumber > 0)
AddHtmlLocalized(50, 385, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false);
else
AddLabel(50, 385, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount));
}
// ****************************************
CreateGroupList();
if (page == CraftPage.PickResource)
CreateResList(false, from);
else if (page == CraftPage.PickResource2)
CreateResList(true, from);
else if (context != null && context.LastGroupIndex > -1)
CreateItemList(context.LastGroupIndex);
}
private Type GetAltType(Type original)
{
for (int i = 0; i < m_TypesTable.Length; i++)
{
if (original == m_TypesTable[i][0] && m_TypesTable[i].Length > 1)
return m_TypesTable[i][1];
if (m_TypesTable[i].Length > 1 && original == m_TypesTable[i][1])
return m_TypesTable[i][0];
}
return null;
}
private Type[][] m_TypesTable = new Type[][]
{
new Type[]{ typeof( Log ), typeof( Board ) },
new Type[]{ typeof( HeartwoodLog ), typeof( HeartwoodBoard ) },
new Type[]{ typeof( BloodwoodLog ), typeof( BloodwoodBoard ) },
new Type[]{ typeof( FrostwoodLog ), typeof( FrostwoodBoard ) },
new Type[]{ typeof( OakLog ), typeof( OakBoard ) },
new Type[]{ typeof( AshLog ), typeof( AshBoard ) },
new Type[]{ typeof( YewLog ), typeof( YewBoard ) },
new Type[]{ typeof( Leather ), typeof( Hides ) },
new Type[]{ typeof( SpinedLeather ), typeof( SpinedHides ) },
new Type[]{ typeof( HornedLeather ), typeof( HornedHides ) },
new Type[]{ typeof( BarbedLeather ), typeof( BarbedHides ) },
};
public void CreateResList(bool opt, Mobile from)
{
CraftSubResCol res = (opt ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes);
for (int i = 0; i < res.Count; ++i)
{
int index = i % 10;
CraftSubRes subResource = res.GetAt(i);
if (index == 0)
{
if (i > 0)
AddButton(485, 290, 4005, 4007, 0, GumpButtonType.Page, (i / 10) + 1);
AddPage((i / 10) + 1);
if (i > 0)
AddButton(455, 290, 4014, 4015, 0, GumpButtonType.Page, i / 10);
CraftContext context = m_CraftSystem.GetContext(m_From);
AddButton(220, 260, 4005, 4007, GetButtonID(6, 4), GumpButtonType.Reply, 0);
AddHtmlLocalized(255, 260, 200, 18, (context == null || !context.DoNotColor) ? 1061591 : 1061590, LabelColor, false, false);
}
int resourceCount = 0;
if (from.Backpack != null)
{
Item[] items = from.Backpack.FindItemsByType(subResource.ItemType, true);
for (int j = 0; j < items.Length; ++j)
resourceCount += items[j].Amount;
Type alt = GetAltType(subResource.ItemType);
if (alt != null)
{
Item[] items2 = m_From.Backpack.FindItemsByType(alt, true);
for (int j = 0; j < items2.Length; ++j)
resourceCount += items2[j].Amount;
}
}
AddButton(220, 60 + (index * 20), 4005, 4007, GetButtonID(5, i), GumpButtonType.Reply, 0);
if (subResource.NameNumber > 0)
AddHtmlLocalized(255, 63 + (index * 20), 250, 18, subResource.NameNumber, resourceCount.ToString(), LabelColor, false, false);
else
AddLabel(255, 60 + (index * 20), LabelHue, String.Format("{0} ({1})", subResource.NameString, resourceCount));
}
}
public void CreateMakeLastList()
{
CraftContext context = m_CraftSystem.GetContext(m_From);
if (context == null)
return;
List<CraftItem> items = context.Items;
if (items.Count > 0)
{
for (int i = 0; i < items.Count; ++i)
{
int index = i % 10;
CraftItem craftItem = items[i];
if (index == 0)
{
if (i > 0)
{
AddButton(370, 260, 4005, 4007, 0, GumpButtonType.Page, (i / 10) + 1);
AddHtmlLocalized(405, 263, 100, 18, 1044045, LabelColor, false, false); // NEXT PAGE
}
AddPage((i / 10) + 1);
if (i > 0)
{
AddButton(220, 260, 4014, 4015, 0, GumpButtonType.Page, i / 10);
AddHtmlLocalized(255, 263, 100, 18, 1044044, LabelColor, false, false); // PREV PAGE
}
}
AddButton(220, 60 + (index * 20), 4005, 4007, GetButtonID(3, i), GumpButtonType.Reply, 0);
if (craftItem.NameNumber > 0)
AddHtmlLocalized(255, 63 + (index * 20), 220, 18, craftItem.NameNumber, LabelColor, false, false);
else
AddLabel(255, 60 + (index * 20), LabelHue, craftItem.NameString);
AddButton(480, 60 + (index * 20), 4011, 4012, GetButtonID(4, i), GumpButtonType.Reply, 0);
}
}
else
{
// NOTE: This is not as OSI; it is an intentional difference
AddHtmlLocalized(230, 62, 200, 22, 1044165, LabelColor, false, false); // You haven't made anything yet.
}
}
public void CreateItemList(int selectedGroup)
{
if (selectedGroup == 501) // 501 : Last 10
{
CreateMakeLastList();
return;
}
CraftGroupCol craftGroupCol = m_CraftSystem.CraftGroups;
CraftGroup craftGroup = craftGroupCol.GetAt(selectedGroup);
if (craftGroup == null)
return;
CraftItemCol craftItemCol = craftGroup.CraftItems;
for (int i = 0; i < craftItemCol.Count; ++i)
{
int index = i % 10;
CraftItem craftItem = craftItemCol.GetAt(i);
if (index == 0)
{
if (i > 0)
{
AddButton(370, 260, 4005, 4007, 0, GumpButtonType.Page, (i / 10) + 1);
AddHtmlLocalized(405, 263, 100, 18, 1044045, LabelColor, false, false); // NEXT PAGE
}
AddPage((i / 10) + 1);
if (i > 0)
{
AddButton(220, 260, 4014, 4015, 0, GumpButtonType.Page, i / 10);
AddHtmlLocalized(255, 263, 100, 18, 1044044, LabelColor, false, false); // PREV PAGE
}
}
AddButton(220, 60 + (index * 20), 4005, 4007, GetButtonID(1, i), GumpButtonType.Reply, 0);
if (craftItem.NameNumber > 0)
AddHtmlLocalized(255, 63 + (index * 20), 220, 18, craftItem.NameNumber, LabelColor, false, false);
else
AddLabel(255, 60 + (index * 20), LabelHue, craftItem.NameString);
AddButton(480, 60 + (index * 20), 4011, 4012, GetButtonID(2, i), GumpButtonType.Reply, 0);
}
}
public int CreateGroupList()
{
CraftGroupCol craftGroupCol = m_CraftSystem.CraftGroups;
AddButton(15, 60, 4005, 4007, GetButtonID(6, 3), GumpButtonType.Reply, 0);
AddHtmlLocalized(50, 63, 150, 18, 1044014, LabelColor, false, false); // LAST TEN
for (int i = 0; i < craftGroupCol.Count; i++)
{
CraftGroup craftGroup = craftGroupCol.GetAt(i);
AddButton(15, 80 + (i * 20), 4005, 4007, GetButtonID(0, i), GumpButtonType.Reply, 0);
if (craftGroup.NameNumber > 0)
AddHtmlLocalized(50, 83 + (i * 20), 150, 18, craftGroup.NameNumber, LabelColor, false, false);
else
AddLabel(50, 80 + (i * 20), LabelHue, craftGroup.NameString);
}
return craftGroupCol.Count;
}
public static int GetButtonID(int type, int index)
{
return 1 + type + (index * 7);
}
public void CraftItem(CraftItem item)
{
if (item.TryCraft != null)
{
item.TryCraft(m_From, item, m_Tool);
return;
}
int num = m_CraftSystem.CanCraft(m_From, m_Tool, item.ItemType);
if (num > 0)
{
m_From.SendGump(new CraftGump(m_From, m_CraftSystem, m_Tool, num));
}
else
{
Type type = null;
CraftContext context = m_CraftSystem.GetContext(m_From);
if (context != null)
{
CraftSubResCol res = (item.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes);
int resIndex = (item.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);
if (resIndex >= 0 && resIndex < res.Count)
type = res.GetAt(resIndex).ItemType;
}
m_CraftSystem.CreateItem(m_From, item.ItemType, type, m_Tool, item);
}
}
public override void OnResponse(NetState sender, RelayInfo info)
{
if (info.ButtonID <= 0)
return; // Canceled
int buttonID = info.ButtonID - 1;
int type = buttonID % 7;
int index = buttonID / 7;
CraftSystem system = m_CraftSystem;
CraftGroupCol groups = system.CraftGroups;
CraftContext context = system.GetContext(m_From);
#region Stygian Abyss
if (Locked)
{
if (type == 6 && index == 11)
{
// Cancel Make
AutoCraftTimer.EndTimer(m_From);
}
return;
}
#endregion
switch ( type )
{
case 0: // Show group
{
if (context == null)
break;
if (index >= 0 && index < groups.Count)
{
context.LastGroupIndex = index;
m_From.SendGump(new CraftGump(m_From, system, m_Tool, null));
}
break;
}
case 1: // Create item
{
if (context == null)
break;
int groupIndex = context.LastGroupIndex;
if (groupIndex >= 0 && groupIndex < groups.Count)
{
CraftGroup group = groups.GetAt(groupIndex);
if (index >= 0 && index < group.CraftItems.Count)
CraftItem(group.CraftItems.GetAt(index));
}
break;
}
case 2: // Item details
{
if (context == null)
break;
int groupIndex = context.LastGroupIndex;
if (groupIndex >= 0 && groupIndex < groups.Count)
{
CraftGroup group = groups.GetAt(groupIndex);
if (index >= 0 && index < group.CraftItems.Count)
m_From.SendGump(new CraftGumpItem(m_From, system, group.CraftItems.GetAt(index), m_Tool));
}
break;
}
case 3: // Create item (last 10)
{
if (context == null)
break;
List<CraftItem> lastTen = context.Items;
if (index >= 0 && index < lastTen.Count)
CraftItem(lastTen[index]);
break;
}
case 4: // Item details (last 10)
{
if (context == null)
break;
List<CraftItem> lastTen = context.Items;
if (index >= 0 && index < lastTen.Count)
m_From.SendGump(new CraftGumpItem(m_From, system, lastTen[index], m_Tool));
break;
}
case 5: // Resource selected
{
if (m_Page == CraftPage.PickResource && index >= 0 && index < system.CraftSubRes.Count)
{
int groupIndex = (context == null ? -1 : context.LastGroupIndex);
CraftSubRes res = system.CraftSubRes.GetAt(index);
if (m_From.Skills[system.MainSkill].Base < res.RequiredSkill)
{
m_From.SendGump(new CraftGump(m_From, system, m_Tool, res.Message));
}
else
{
if (context != null)
context.LastResourceIndex = index;
m_From.SendGump(new CraftGump(m_From, system, m_Tool, null));
}
}
else if (m_Page == CraftPage.PickResource2 && index >= 0 && index < system.CraftSubRes2.Count)
{
int groupIndex = (context == null ? -1 : context.LastGroupIndex);
CraftSubRes res = system.CraftSubRes2.GetAt(index);
if (m_From.Skills[system.MainSkill].Base < res.RequiredSkill)
{
m_From.SendGump(new CraftGump(m_From, system, m_Tool, res.Message));
}
else
{
if (context != null)
context.LastResourceIndex2 = index;
m_From.SendGump(new CraftGump(m_From, system, m_Tool, null));
}
}
break;
}
case 6: // Misc. buttons
{
switch ( index )
{
case 0: // Resource selection
{
if (system.CraftSubRes.Init)
m_From.SendGump(new CraftGump(m_From, system, m_Tool, null, CraftPage.PickResource));
break;
}
case 1: // Smelt item
{
if (system.Resmelt)
Resmelt.Do(m_From, system, m_Tool);
break;
}
case 2: // Make last
{
if (context == null)
break;
CraftItem item = context.LastMade;
if (item != null)
CraftItem(item);
else
m_From.SendGump(new CraftGump(m_From, m_CraftSystem, m_Tool, 1044165, m_Page)); // You haven't made anything yet.
break;
}
case 3: // Last 10
{
if (context == null)
break;
context.LastGroupIndex = 501;
m_From.SendGump(new CraftGump(m_From, system, m_Tool, null));
break;
}
case 4: // Toggle use resource hue
{
if (context == null)
break;
context.DoNotColor = !context.DoNotColor;
m_From.SendGump(new CraftGump(m_From, m_CraftSystem, m_Tool, null, m_Page));
break;
}
case 5: // Repair item
{
if (system.Repair)
Repair.Do(m_From, system, m_Tool);
break;
}
case 6: // Toggle mark option
{
if (context == null || !system.MarkOption)
break;
switch ( context.MarkOption )
{
case CraftMarkOption.MarkItem:
context.MarkOption = CraftMarkOption.DoNotMark;
break;
case CraftMarkOption.DoNotMark:
context.MarkOption = CraftMarkOption.PromptForMark;
break;
case CraftMarkOption.PromptForMark:
context.MarkOption = CraftMarkOption.MarkItem;
break;
}
m_From.SendGump(new CraftGump(m_From, m_CraftSystem, m_Tool, null, m_Page));
break;
}
case 7: // Resource selection 2
{
if (system.CraftSubRes2.Init)
m_From.SendGump(new CraftGump(m_From, system, m_Tool, null, CraftPage.PickResource2));
break;
}
case 8: // Enhance item
{
if (system.CanEnhance)
Enhance.BeginTarget(m_From, system, m_Tool);
break;
}
case 9: // Alter Item (Gargoyle)
{
if (system.CanAlter)
{
if (Server.SkillHandlers.Imbuing.CheckSoulForge(m_From, 1, false))
{
AlterItem.BeginTarget(m_From, system, m_Tool);
}
else
m_From.SendLocalizedMessage(1111867); // You must be near a soulforge to alter an item.
}
break;
}
case 10: // Quest Item/Non Quest Item toggle
{
//if (context == null || !system.QuestOption)
//break;
switch ( context.QuestOption )
{
case CraftQuestOption.QuestItem:
context.QuestOption = CraftQuestOption.NonQuestItem;
break;
case CraftQuestOption.NonQuestItem:
context.QuestOption = CraftQuestOption.QuestItem;
break;
}
m_From.SendGump(new CraftGump(m_From, m_CraftSystem, m_Tool, null, m_Page));
break;
}
case 11: // Cancel Make
{
AutoCraftTimer.EndTimer(m_From);
break;
}
}
break;
}
}
}
}
}

View File

@@ -0,0 +1,342 @@
using System;
using Server.Gumps;
using Server.Items;
using Server.Mobiles;
using Server.Network;
namespace Server.Engines.Craft
{
public class CraftGumpItem : Gump
{
private readonly Mobile m_From;
private readonly CraftSystem m_CraftSystem;
private readonly CraftItem m_CraftItem;
private readonly ITool m_Tool;
private const int LabelHue = 0x480; // 0x384
private const int RedLabelHue = 0x20;
private const int LabelColor = 0x7FFF;
private const int RedLabelColor = 0x6400;
private const int GreyLabelColor = 0x3DEF;
private int m_OtherCount;
public CraftGumpItem(Mobile from, CraftSystem craftSystem, CraftItem craftItem, ITool tool)
: base(40, 40)
{
m_From = from;
m_CraftSystem = craftSystem;
m_CraftItem = craftItem;
m_Tool = tool;
from.CloseGump(typeof(CraftGump));
from.CloseGump(typeof(CraftGumpItem));
AddPage(0);
AddBackground(0, 0, 530, 417, 5054);
AddImageTiled(10, 10, 510, 22, 2624);
AddImageTiled(10, 37, 150, 148, 2624);
AddImageTiled(165, 37, 355, 90, 2624);
AddImageTiled(10, 190, 155, 22, 2624);
AddImageTiled(10, 240, 150, 57, 2624);
AddImageTiled(165, 132, 355, 80, 2624);
AddImageTiled(10, 325, 150, 57, 2624);
AddImageTiled(165, 217, 355, 80, 2624);
AddImageTiled(165, 302, 355, 80, 2624);
AddImageTiled(10, 387, 510, 22, 2624);
AddAlphaRegion(10, 10, 510, 399);
AddHtmlLocalized(170, 40, 150, 20, 1044053, LabelColor, false, false); // ITEM
AddHtmlLocalized(10, 217, 150, 22, 1044055, LabelColor, false, false); // <CENTER>MATERIALS</CENTER>
AddHtmlLocalized(10, 302, 150, 22, 1044056, LabelColor, false, false); // <CENTER>OTHER</CENTER>
if (craftSystem.GumpTitleNumber > 0)
AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false);
else
AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false);
bool needsRecipe = (craftItem.Recipe != null && from is PlayerMobile && !((PlayerMobile)from).HasRecipe(craftItem.Recipe));
if (needsRecipe)
{
AddButton(405, 387, 4005, 4007, 0, GumpButtonType.Page, 0);
AddHtmlLocalized(440, 390, 150, 18, 1044151, GreyLabelColor, false, false); // MAKE NOW
}
else
{
AddButton(405, 387, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(445, 390, 150, 18, 1044151, LabelColor, false, false); // MAKE NOW
}
#region Stygian Abyss
AddButton(265, 387, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(300, 390, 150, 18, 1112623, LabelColor, false, false); //MAKE NUMBER
AddButton(135, 387, 4005, 4007, 3, GumpButtonType.Reply, 0);
AddHtmlLocalized(170, 390, 150, 18, 1112624, LabelColor, false, false); //MAKE MAX
#endregion
AddButton(15, 387, 4014, 4016, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(50, 390, 150, 18, 1044150, LabelColor, false, false); // BACK
if (craftItem.NameNumber > 0)
AddHtmlLocalized(330, 40, 180, 18, craftItem.NameNumber, LabelColor, false, false);
else
AddLabel(330, 40, LabelHue, craftItem.NameString);
if (craftItem.UseAllRes)
AddHtmlLocalized(170, 302 + (m_OtherCount++ * 20), 310, 18, 1048176, LabelColor, false, false); // Makes as many as possible at once
DrawItem();
DrawSkill();
DrawResource();
/*
if( craftItem.RequiresSE )
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1063363, LabelColor, false, false ); //* Requires the "Samurai Empire" expansion
* */
if (craftItem.RequiredExpansion != Expansion.None)
{
bool supportsEx = (from.NetState != null && from.NetState.SupportsExpansion(craftItem.RequiredExpansion));
TextDefinition.AddHtmlText(this, 170, 302 + (m_OtherCount++ * 20), 310, 18, RequiredExpansionMessage(craftItem.RequiredExpansion), false, false, supportsEx ? LabelColor : RedLabelColor, supportsEx ? LabelHue : RedLabelHue);
}
if (craftItem.RequiredThemePack != ThemePack.None)
{
TextDefinition.AddHtmlText(this, 170, 302 + (m_OtherCount++ * 20), 310, 18, RequiredThemePackMessage(craftItem.RequiredThemePack), false, false, LabelColor, LabelHue);
}
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
case Expansion.SA:
return 1094732; // * Requires the "Stygian Abyss" expansion
case Expansion.HS:
return 1116296; // * Requires the "High Seas" booster
case Expansion.TOL:
return 1155876; // * Requires the "Time of Legends" expansion.
default:
return String.Format("* Requires the \"{0}\" expansion", ExpansionInfo.GetInfo(expansion).Name);
}
}
private TextDefinition RequiredThemePackMessage(ThemePack pack)
{
switch (pack)
{
case ThemePack.Kings:
return 1154195; // *Requires the "King's Collection" theme pack
case ThemePack.Rustic:
return 1150651; // * Requires the "Rustic" theme pack
case ThemePack.Gothic:
return 1150650; // * Requires the "Gothic" theme pack
default:
return String.Format("Requires the \"{0}\" theme pack.", null);
}
}
private bool m_ShowExceptionalChance;
public void DrawItem()
{
Type type = m_CraftItem.ItemType;
int id = m_CraftItem.DisplayID;
if (id == 0) id = CraftItem.ItemIDOf(type);
Rectangle2D b = ItemBounds.Table[id];
AddItem(90 - b.Width / 2 - b.X, 110 - b.Height / 2 - b.Y, id, 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;
}
else if (typeof(IQuality).IsAssignableFrom(m_CraftItem.ItemType))
{
m_ShowExceptionalChance = true;
}
}
public void DrawSkill()
{
for (int i = 0; i < m_CraftItem.Skills.Count; i++)
{
CraftSkill skill = m_CraftItem.Skills.GetAt(i);
double minSkill = skill.MinSkill, maxSkill = skill.MaxSkill;
if (minSkill < 0)
minSkill = 0;
AddHtmlLocalized(170, 132 + (i * 20), 200, 18, AosSkillBonuses.GetLabel(skill.SkillToMake), LabelColor, false, false);
AddLabel(430, 132 + (i * 20), LabelHue, String.Format("{0:F1}", minSkill));
}
CraftSubResCol res = (m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes);
int resIndex = -1;
CraftContext context = m_CraftSystem.GetContext(m_From);
if (context != null)
resIndex = (m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);
bool allRequiredSkills = true;
double chance = m_CraftItem.GetSuccessChance(m_From, resIndex > -1 ? res.GetAt(resIndex).ItemType : null, m_CraftSystem, false, ref allRequiredSkills);
double excepChance = m_CraftItem.GetExceptionalChance(m_CraftSystem, chance, m_From);
if (chance < 0.0)
chance = 0.0;
else if (chance > 1.0)
chance = 1.0;
AddHtmlLocalized(170, 80, 250, 18, 1044057, LabelColor, false, false); // Success Chance:
AddLabel(430, 80, LabelHue, String.Format("{0:F1}%", chance * 100));
if (m_ShowExceptionalChance)
{
if (excepChance < 0.0)
excepChance = 0.0;
else if (excepChance > 1.0)
excepChance = 1.0;
AddHtmlLocalized(170, 100, 250, 18, 1044058, 32767, false, false); // Exceptional Chance:
AddLabel(430, 100, LabelHue, String.Format("{0:F1}%", excepChance * 100));
}
}
private static readonly Type typeofBlankScroll = typeof(BlankScroll);
private static readonly Type typeofSpellScroll = typeof(SpellScroll);
public void DrawResource()
{
bool retainedColor = false;
CraftContext context = m_CraftSystem.GetContext(m_From);
CraftSubResCol res = (m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes);
int resIndex = -1;
if (context != null)
resIndex = (m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);
bool cropScroll = (m_CraftItem.Resources.Count > 1) &&
m_CraftItem.Resources.GetAt(m_CraftItem.Resources.Count - 1).ItemType == typeofBlankScroll &&
typeofSpellScroll.IsAssignableFrom(m_CraftItem.ItemType);
for (int i = 0; i < m_CraftItem.Resources.Count - (cropScroll ? 1 : 0) && i < 4; i++)
{
Type type;
string nameString;
int nameNumber;
CraftRes craftResource = m_CraftItem.Resources.GetAt(i);
type = craftResource.ItemType;
nameString = craftResource.NameString;
nameNumber = craftResource.NameNumber;
// Resource Mutation
if (type == res.ResType && resIndex > -1)
{
CraftSubRes subResource = res.GetAt(resIndex);
type = subResource.ItemType;
nameString = subResource.NameString;
nameNumber = subResource.GenericNameNumber;
if (nameNumber <= 0)
nameNumber = subResource.NameNumber;
}
// ******************
if (!retainedColor && m_CraftItem.RetainsColorFrom(m_CraftSystem, type))
{
retainedColor = true;
AddHtmlLocalized(170, 302 + (m_OtherCount++ * 20), 310, 18, 1044152, LabelColor, false, false); // * The item retains the color of this material
AddLabel(500, 219 + (i * 20), LabelHue, "*");
}
if (nameNumber > 0)
AddHtmlLocalized(170, 219 + (i * 20), 310, 18, nameNumber, LabelColor, false, false);
else
AddLabel(170, 219 + (i * 20), LabelHue, nameString);
AddLabel(430, 219 + (i * 20), LabelHue, craftResource.Amount.ToString());
}
if (m_CraftItem.NameNumber == 1041267) // runebook
{
AddHtmlLocalized(170, 219 + (m_CraftItem.Resources.Count * 20), 310, 18, 1044447, LabelColor, false, false);
AddLabel(430, 219 + (m_CraftItem.Resources.Count * 20), LabelHue, "1");
}
if (cropScroll)
AddHtmlLocalized(170, 302 + (m_OtherCount++ * 20), 360, 18, 1044379, LabelColor, false, false); // Inscribing scrolls also requires a blank scroll and mana.
}
public override void OnResponse(NetState sender, RelayInfo info)
{
switch (info.ButtonID)
{
case 0: // Back Button
{
CraftGump craftGump = new CraftGump(m_From, m_CraftSystem, m_Tool, null);
m_From.SendGump(craftGump);
break;
}
case 1: // Make Button
{
if (m_CraftItem.TryCraft != null)
{
m_CraftItem.TryCraft(m_From, m_CraftItem, m_Tool);
return;
}
int num = m_CraftSystem.CanCraft(m_From, m_Tool, m_CraftItem.ItemType);
if (num > 0)
{
m_From.SendGump(new CraftGump(m_From, m_CraftSystem, m_Tool, num));
}
else
{
Type type = null;
CraftContext context = m_CraftSystem.GetContext(m_From);
if (context != null)
{
CraftSubResCol res = (m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes);
int resIndex = (m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);
if (resIndex > -1)
type = res.GetAt(resIndex).ItemType;
}
m_CraftSystem.CreateItem(m_From, m_CraftItem.ItemType, type, m_Tool, m_CraftItem);
}
break;
}
case 2: //Make Number
m_From.Prompt = new MakeNumberCraftPrompt(m_From, m_CraftSystem, m_CraftItem, m_Tool);
m_From.SendLocalizedMessage(1112576); //Please type the amount you wish to create(1 - 100): <Escape to cancel>
break;
case 3: //Make Max
AutoCraftTimer.EndTimer(m_From);
new AutoCraftTimer(m_From, m_CraftSystem, m_CraftItem, m_Tool, 9999, TimeSpan.FromSeconds(m_CraftSystem.Delay * m_CraftSystem.MaxCraftEffect + 1.0), TimeSpan.FromSeconds(m_CraftSystem.Delay * m_CraftSystem.MaxCraftEffect + 1.0));
break;
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -0,0 +1,22 @@
using System;
namespace Server.Engines.Craft
{
[AttributeUsage(AttributeTargets.Class)]
public class CraftItemIDAttribute : Attribute
{
private readonly int m_ItemID;
public CraftItemIDAttribute(int itemID)
{
this.m_ItemID = itemID;
}
public int ItemID
{
get
{
return this.m_ItemID;
}
}
}
}

View File

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

View File

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

View File

@@ -0,0 +1,39 @@
using System;
namespace Server.Engines.Craft
{
public class CraftSkill
{
private readonly SkillName m_SkillToMake;
private readonly double m_MinSkill;
private readonly double m_MaxSkill;
public CraftSkill(SkillName skillToMake, double minSkill, double maxSkill)
{
this.m_SkillToMake = skillToMake;
this.m_MinSkill = minSkill;
this.m_MaxSkill = maxSkill;
}
public SkillName SkillToMake
{
get
{
return this.m_SkillToMake;
}
}
public double MinSkill
{
get
{
return this.m_MinSkill;
}
}
public double MaxSkill
{
get
{
return this.m_MaxSkill;
}
}
}
}

View File

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

View File

@@ -0,0 +1,71 @@
using System;
namespace Server.Engines.Craft
{
public class CraftSubRes
{
private readonly Type m_Type;
private readonly double m_ReqSkill;
private readonly string m_NameString;
private readonly int m_NameNumber;
private readonly int m_GenericNameNumber;
private readonly object m_Message;
public CraftSubRes(Type type, TextDefinition name, double reqSkill, object message)
: this(type, name, reqSkill, 0, message)
{
}
public CraftSubRes(Type type, TextDefinition name, double reqSkill, int genericNameNumber, object message)
{
this.m_Type = type;
this.m_NameNumber = name;
this.m_NameString = name;
this.m_ReqSkill = reqSkill;
this.m_GenericNameNumber = genericNameNumber;
this.m_Message = message;
}
public Type ItemType
{
get
{
return this.m_Type;
}
}
public string NameString
{
get
{
return this.m_NameString;
}
}
public int NameNumber
{
get
{
return this.m_NameNumber;
}
}
public int GenericNameNumber
{
get
{
return this.m_GenericNameNumber;
}
}
public object Message
{
get
{
return this.m_Message;
}
}
public double RequiredSkill
{
get
{
return this.m_ReqSkill;
}
}
}
}

View File

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

View File

@@ -0,0 +1,632 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Server.Items;
namespace Server.Engines.Craft
{
public enum CraftECA
{
ChanceMinusSixty,
FiftyPercentChanceMinusTenPercent,
ChanceMinusSixtyToFourtyFive
}
public abstract class CraftSystem
{
public static List<CraftSystem> Systems { get; set; }
private readonly int m_MinCraftEffect;
private readonly int m_MaxCraftEffect;
private readonly double m_Delay;
private bool m_Resmelt;
private bool m_Repair;
private bool m_MarkOption;
private bool m_CanEnhance;
private bool m_QuestOption;
private bool m_CanAlter;
private readonly CraftItemCol m_CraftItems;
private readonly CraftGroupCol m_CraftGroups;
private readonly CraftSubResCol m_CraftSubRes;
private readonly CraftSubResCol m_CraftSubRes2;
public int MinCraftEffect
{
get
{
return m_MinCraftEffect;
}
}
public int MaxCraftEffect
{
get
{
return m_MaxCraftEffect;
}
}
public double Delay
{
get
{
return m_Delay;
}
}
public CraftItemCol CraftItems
{
get
{
return m_CraftItems;
}
}
public CraftGroupCol CraftGroups
{
get
{
return m_CraftGroups;
}
}
public CraftSubResCol CraftSubRes
{
get
{
return m_CraftSubRes;
}
}
public CraftSubResCol CraftSubRes2
{
get
{
return m_CraftSubRes2;
}
}
public abstract SkillName MainSkill { get; }
public virtual int GumpTitleNumber
{
get
{
return 0;
}
}
public virtual string GumpTitleString
{
get
{
return "";
}
}
public virtual CraftECA ECA
{
get
{
return CraftECA.ChanceMinusSixty;
}
}
private readonly Dictionary<Mobile, CraftContext> m_ContextTable = new Dictionary<Mobile, CraftContext>();
public abstract double GetChanceAtMin(CraftItem item);
public virtual bool RetainsColorFrom(CraftItem item, Type type)
{
return false;
}
public void AddContext(Mobile m, CraftContext c)
{
if (c == null || m == null || c.System != this)
return;
m_ContextTable[m] = c;
}
public CraftContext GetContext(Mobile m)
{
if (m == null)
return null;
if (m.Deleted)
{
m_ContextTable.Remove(m);
return null;
}
CraftContext c = null;
m_ContextTable.TryGetValue(m, out c);
if (c == null)
m_ContextTable[m] = c = new CraftContext(m, this);
return c;
}
public void OnMade(Mobile m, CraftItem item)
{
CraftContext c = GetContext(m);
if (c != null)
c.OnMade(item);
}
public void OnRepair(Mobile m, ITool tool, Item deed, Item addon, IEntity e)
{
Item source;
if (tool is Item)
{
source = (Item)tool;
}
else
{
source = deed ?? addon;
}
EventSink.InvokeRepairItem(new RepairItemEventArgs(m, source, e));
}
public bool Resmelt
{
get
{
return m_Resmelt;
}
set
{
m_Resmelt = value;
}
}
public bool Repair
{
get
{
return m_Repair;
}
set
{
m_Repair = value;
}
}
public bool MarkOption
{
get
{
return m_MarkOption;
}
set
{
m_MarkOption = value;
}
}
public bool CanEnhance
{
get
{
return m_CanEnhance;
}
set
{
m_CanEnhance = value;
}
}
public bool QuestOption
{
get
{
return m_QuestOption;
}
set
{
m_QuestOption = value;
}
}
public bool CanAlter
{
get
{
return m_CanAlter;
}
set
{
m_CanAlter = value;
}
}
public CraftSystem(int minCraftEffect, int maxCraftEffect, double delay)
{
m_MinCraftEffect = minCraftEffect;
m_MaxCraftEffect = maxCraftEffect;
m_Delay = delay;
m_CraftItems = new CraftItemCol();
m_CraftGroups = new CraftGroupCol();
m_CraftSubRes = new CraftSubResCol();
m_CraftSubRes2 = new CraftSubResCol();
InitCraftList();
AddSystem(this);
}
private void AddSystem(CraftSystem system)
{
if (Systems == null)
Systems = new List<CraftSystem>();
Systems.Add(system);
}
private Type[] _GlobalNoConsume =
{
typeof(CapturedEssence), typeof(EyeOfTheTravesty), typeof(DiseasedBark), typeof(LardOfParoxysmus), typeof(GrizzledBones), typeof(DreadHornMane),
typeof(Blight), typeof(Corruption), typeof(Muculent), typeof(Scourge), typeof(Putrefaction), typeof(Taint),
// Tailoring
typeof(MidnightBracers), typeof(CrimsonCincture), typeof(GargishCrimsonCincture), typeof(LeurociansMempoOfFortune),
// Blacksmithy
typeof(LeggingsOfBane), typeof(GauntletsOfNobility),
// Carpentry
typeof(StaffOfTheMagi), typeof(BlackrockMoonstone),
// Tinkering
typeof(Server.Factions.Silver), typeof(RingOfTheElements), typeof(HatOfTheMagi), typeof(AutomatonActuator),
// Inscription
typeof(AntiqueDocumentsKit)
};
public virtual bool ConsumeOnFailure(Mobile from, Type resourceType, CraftItem craftItem)
{
return !_GlobalNoConsume.Any(t => t == resourceType);
}
public virtual bool ConsumeOnFailure(Mobile from, Type resourceType, CraftItem craftItem, ref MasterCraftsmanTalisman talisman)
{
if (!ConsumeOnFailure(from, resourceType, craftItem))
return false;
Item item = from.FindItemOnLayer(Layer.Talisman);
if (item is MasterCraftsmanTalisman)
{
MasterCraftsmanTalisman mct = (MasterCraftsmanTalisman)item;
if (mct.Charges > 0)
{
talisman = mct;
return false;
}
}
return true;
}
public void CreateItem(Mobile from, Type type, Type typeRes, ITool tool, CraftItem realCraftItem)
{
// Verify if the type is in the list of the craftable item
CraftItem craftItem = m_CraftItems.SearchFor(type);
if (craftItem != null)
{
// The item is in the list, try to create it
// Test code: items like sextant parts can be crafted either directly from ingots, or from different parts
realCraftItem.Craft(from, this, typeRes, tool);
//craftItem.Craft( from, this, typeRes, tool );
}
}
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount)
{
return AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, "");
}
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount, TextDefinition message)
{
return AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, message);
}
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount)
{
return AddCraft(typeItem, group, name, skillToMake, minSkill, maxSkill, typeRes, nameRes, amount, "");
}
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount, TextDefinition message)
{
CraftItem craftItem = new CraftItem(typeItem, group, name);
craftItem.AddRes(typeRes, nameRes, amount, message);
craftItem.AddSkill(skillToMake, minSkill, maxSkill);
DoGroup(group, craftItem);
return m_CraftItems.Add(craftItem);
}
private void DoGroup(TextDefinition groupName, CraftItem craftItem)
{
int index = m_CraftGroups.SearchFor(groupName);
if (index == -1)
{
CraftGroup craftGroup = new CraftGroup(groupName);
craftGroup.AddCraftItem(craftItem);
m_CraftGroups.Add(craftGroup);
}
else
{
m_CraftGroups.GetAt(index).AddCraftItem(craftItem);
}
}
public void SetItemHue(int index, int hue)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.ItemHue = hue;
}
public void SetManaReq(int index, int mana)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.Mana = mana;
}
public void SetStamReq(int index, int stam)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.Stam = stam;
}
public void SetHitsReq(int index, int hits)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.Hits = hits;
}
public void SetUseAllRes(int index, bool useAll)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.UseAllRes = useAll;
}
public void SetForceTypeRes(int index, bool value)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.ForceTypeRes = value;
}
public void SetNeedHeat(int index, bool needHeat)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.NeedHeat = needHeat;
}
public void SetNeedOven(int index, bool needOven)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.NeedOven = needOven;
}
public void SetNeedMaker(int index, bool needMaker)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.NeedMaker = needMaker;
}
public void SetNeedWater(int index, bool needWater)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.NeedWater = needWater;
}
public void SetBeverageType(int index, BeverageType requiredBeverage)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.RequiredBeverage = requiredBeverage;
}
public void SetNeedMill(int index, bool needMill)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.NeedMill = needMill;
}
public void SetNeededThemePack(int index, ThemePack pack)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.RequiredThemePack = pack;
}
public void SetRequiresBasketWeaving(int index)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.RequiresBasketWeaving = true;
}
public void SetRequireResTarget(int index)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.RequiresResTarget = true;
}
public void SetRequiresMechanicalLife(int index)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.RequiresMechanicalLife = true;
}
public void SetData(int index, object data)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.Data = data;
}
public void SetDisplayID(int index, int id)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.DisplayID = id;
}
/// <summary>
/// Add a callback Action to allow mutating the crafted item. Handy when you have a single Item Type but you want to create variations of it.
/// </summary>
/// <param name="index"></param>
/// <param name="action"></param>
public void SetMutateAction(int index, Action<Mobile, Item, ITool> action)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.MutateAction = action;
}
public void SetForceSuccess(int index, int success)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.ForceSuccessChance = success;
}
public void AddRes(int index, Type type, TextDefinition name, int amount)
{
AddRes(index, type, name, amount, "");
}
public void AddRes(int index, Type type, TextDefinition name, int amount, TextDefinition message)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.AddRes(type, name, amount, message);
}
public void AddResCallback(int index, Func<Mobile, ConsumeType, int> func)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.ConsumeResCallback = func;
}
public void AddSkill(int index, SkillName skillToMake, double minSkill, double maxSkill)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.AddSkill(skillToMake, minSkill, maxSkill);
}
public void SetUseSubRes2(int index, bool val)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.UseSubRes2 = val;
}
public void AddRecipe(int index, int id)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.AddRecipe(id, this);
}
public void ForceNonExceptional(int index)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.ForceNonExceptional = true;
}
public void ForceExceptional(int index)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.ForceExceptional = true;
}
public void SetMinSkillOffset(int index, double skillOffset)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.MinSkillOffset = skillOffset;
}
public void AddCraftAction(int index, Action<Mobile, CraftItem, ITool> action)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.TryCraft = action;
}
public void AddCreateItem(int index, Func<Mobile, CraftItem, ITool, Item> func)
{
CraftItem craftItem = m_CraftItems.GetAt(index);
craftItem.CreateItem = func;
}
public void SetSubRes(Type type, string name)
{
m_CraftSubRes.ResType = type;
m_CraftSubRes.NameString = name;
m_CraftSubRes.Init = true;
}
public void SetSubRes(Type type, int name)
{
m_CraftSubRes.ResType = type;
m_CraftSubRes.NameNumber = name;
m_CraftSubRes.Init = true;
}
public void AddSubRes(Type type, int name, double reqSkill, object message)
{
CraftSubRes craftSubRes = new CraftSubRes(type, name, reqSkill, message);
m_CraftSubRes.Add(craftSubRes);
}
public void AddSubRes(Type type, int name, double reqSkill, int genericName, object message)
{
CraftSubRes craftSubRes = new CraftSubRes(type, name, reqSkill, genericName, message);
m_CraftSubRes.Add(craftSubRes);
}
public void AddSubRes(Type type, string name, double reqSkill, object message)
{
CraftSubRes craftSubRes = new CraftSubRes(type, name, reqSkill, message);
m_CraftSubRes.Add(craftSubRes);
}
public void SetSubRes2(Type type, string name)
{
m_CraftSubRes2.ResType = type;
m_CraftSubRes2.NameString = name;
m_CraftSubRes2.Init = true;
}
public void SetSubRes2(Type type, int name)
{
m_CraftSubRes2.ResType = type;
m_CraftSubRes2.NameNumber = name;
m_CraftSubRes2.Init = true;
}
public void AddSubRes2(Type type, int name, double reqSkill, object message)
{
CraftSubRes craftSubRes = new CraftSubRes(type, name, reqSkill, message);
m_CraftSubRes2.Add(craftSubRes);
}
public void AddSubRes2(Type type, int name, double reqSkill, int genericName, object message)
{
CraftSubRes craftSubRes = new CraftSubRes(type, name, reqSkill, genericName, message);
m_CraftSubRes2.Add(craftSubRes);
}
public void AddSubRes2(Type type, string name, double reqSkill, object message)
{
CraftSubRes craftSubRes = new CraftSubRes(type, name, reqSkill, message);
m_CraftSubRes2.Add(craftSubRes);
}
public abstract void InitCraftList();
public abstract void PlayCraftEffect(Mobile from);
public abstract int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item);
public abstract int CanCraft(Mobile from, ITool tool, Type itemType);
}
}

View File

@@ -0,0 +1,70 @@
using System;
using Server.Items;
namespace Server.Engines.Craft
{
public abstract class CustomCraft
{
private readonly Mobile m_From;
private readonly CraftItem m_CraftItem;
private readonly CraftSystem m_CraftSystem;
private readonly Type m_TypeRes;
private readonly ITool m_Tool;
private readonly int m_Quality;
public CustomCraft(Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, ITool tool, int quality)
{
this.m_From = from;
this.m_CraftItem = craftItem;
this.m_CraftSystem = craftSystem;
this.m_TypeRes = typeRes;
this.m_Tool = tool;
this.m_Quality = quality;
}
public Mobile From
{
get
{
return this.m_From;
}
}
public CraftItem CraftItem
{
get
{
return this.m_CraftItem;
}
}
public CraftSystem CraftSystem
{
get
{
return this.m_CraftSystem;
}
}
public Type TypeRes
{
get
{
return this.m_TypeRes;
}
}
public ITool Tool
{
get
{
return this.m_Tool;
}
}
public int Quality
{
get
{
return this.m_Quality;
}
}
public abstract void EndCraftAction();
public abstract Item CompleteCraft(out int message);
}
}

View File

@@ -0,0 +1,435 @@
using System;
using Server.Items;
using Server.Targeting;
using Server.Mobiles;
using System.Collections.Generic;
namespace Server.Engines.Craft
{
public enum EnhanceResult
{
None,
NotInBackpack,
BadItem,
BadResource,
AlreadyEnhanced,
Success,
Failure,
Broken,
NoResources,
NoSkill,
Enchanted
}
public class Enhance
{
private static Dictionary<Type, CraftSystem> _SpecialTable;
public static void Initialize()
{
_SpecialTable = new Dictionary<Type, CraftSystem>();
_SpecialTable[typeof(ClockworkLeggings)] = DefBlacksmithy.CraftSystem;
_SpecialTable[typeof(GargishClockworkLeggings)] = DefBlacksmithy.CraftSystem;
}
private static bool IsSpecial(Item item, CraftSystem system)
{
foreach (KeyValuePair<Type, CraftSystem> kvp in _SpecialTable)
{
if (kvp.Key == item.GetType() && kvp.Value == system)
return true;
}
return false;
}
private static bool CanEnhance(Item item)
{
return item is BaseArmor || item is BaseWeapon || item is FishingPole;
}
public static EnhanceResult Invoke(Mobile from, CraftSystem craftSystem, ITool tool, Item item, CraftResource resource, Type resType, ref object resMessage)
{
if (item == null)
return EnhanceResult.BadItem;
if (item is GargishNecklace || item is GargishEarrings)
return EnhanceResult.BadItem;
if (!item.IsChildOf(from.Backpack))
return EnhanceResult.NotInBackpack;
IResource ires = item as IResource;
if (!CanEnhance(item) || ires == null)
return EnhanceResult.BadItem;
if (item is IArcaneEquip)
{
IArcaneEquip eq = (IArcaneEquip)item;
if (eq.IsArcane)
return EnhanceResult.BadItem;
}
if (item is BaseWeapon && Spells.Mysticism.EnchantSpell.IsUnderSpellEffects(from, (BaseWeapon)item))
return EnhanceResult.Enchanted;
if (CraftResources.IsStandard(resource))
return EnhanceResult.BadResource;
int num = craftSystem.CanCraft(from, tool, item.GetType());
if (num > 0)
{
resMessage = num;
return EnhanceResult.None;
}
CraftItem craftItem = craftSystem.CraftItems.SearchFor(item.GetType());
if (IsSpecial(item, craftSystem))
{
craftItem = craftSystem.CraftItems.SearchForSubclass(item.GetType());
}
if (craftItem == null || craftItem.Resources.Count == 0)
{
return EnhanceResult.BadItem;
}
#region Mondain's Legacy
if (craftItem.ForceNonExceptional)
return EnhanceResult.BadItem;
#endregion
bool allRequiredSkills = false;
if (craftItem.GetSuccessChance(from, resType, craftSystem, false, ref allRequiredSkills) <= 0.0)
return EnhanceResult.NoSkill;
CraftResourceInfo info = CraftResources.GetInfo(resource);
if (info == null || info.ResourceTypes.Length == 0)
return EnhanceResult.BadResource;
CraftAttributeInfo attributes = info.AttributeInfo;
if (attributes == null)
return EnhanceResult.BadResource;
int resHue = 0, maxAmount = 0;
if (!craftItem.ConsumeRes(from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.None, ref resMessage))
return EnhanceResult.NoResources;
if (!CraftResources.IsStandard(ires.Resource))
return EnhanceResult.AlreadyEnhanced;
if (craftSystem is DefBlacksmithy)
{
AncientSmithyHammer hammer = from.FindItemOnLayer(Layer.OneHanded) as AncientSmithyHammer;
if (hammer != null)
{
hammer.UsesRemaining--;
if (hammer.UsesRemaining < 1)
hammer.Delete();
}
}
int phys = 0, fire = 0, cold = 0, pois = 0, nrgy = 0;
int dura = 0, luck = 0, lreq = 0, dinc = 0;
int baseChance = 0;
bool physBonus = false;
bool fireBonus = false;
bool coldBonus = false;
bool nrgyBonus = false;
bool poisBonus = false;
bool duraBonus = false;
bool luckBonus = false;
bool lreqBonus = false;
bool dincBonus = false;
if (item is BaseWeapon)
{
BaseWeapon weapon = (BaseWeapon)item;
if(weapon.ExtendedWeaponAttributes.AssassinHoned > 0)
return EnhanceResult.BadItem;
baseChance = 20;
dura = weapon.MaxHitPoints;
luck = weapon.Attributes.Luck;
lreq = weapon.WeaponAttributes.LowerStatReq;
dinc = weapon.Attributes.WeaponDamage;
fireBonus = (attributes.WeaponFireDamage > 0);
coldBonus = (attributes.WeaponColdDamage > 0);
nrgyBonus = (attributes.WeaponEnergyDamage > 0);
poisBonus = (attributes.WeaponPoisonDamage > 0);
duraBonus = (attributes.WeaponDurability > 0);
luckBonus = (attributes.WeaponLuck > 0);
lreqBonus = (attributes.WeaponLowerRequirements > 0);
dincBonus = (dinc > 0);
}
else if (item is BaseArmor)
{
BaseArmor armor = (BaseArmor)item;
baseChance = 20;
phys = armor.PhysicalResistance;
fire = armor.FireResistance;
cold = armor.ColdResistance;
pois = armor.PoisonResistance;
nrgy = armor.EnergyResistance;
dura = armor.MaxHitPoints;
luck = armor.Attributes.Luck;
lreq = armor.ArmorAttributes.LowerStatReq;
physBonus = (attributes.ArmorPhysicalResist > 0);
fireBonus = (attributes.ArmorFireResist > 0);
coldBonus = (attributes.ArmorColdResist > 0);
nrgyBonus = (attributes.ArmorEnergyResist > 0);
poisBonus = (attributes.ArmorPoisonResist > 0);
duraBonus = (attributes.ArmorDurability > 0);
luckBonus = (attributes.ArmorLuck > 0);
lreqBonus = (attributes.ArmorLowerRequirements > 0);
dincBonus = false;
}
else if (item is FishingPole)
{
FishingPole pole = (FishingPole)item;
baseChance = 20;
luck = pole.Attributes.Luck;
luckBonus = (attributes.ArmorLuck > 0);
lreqBonus = (attributes.ArmorLowerRequirements > 0);
dincBonus = false;
}
int skill = from.Skills[craftSystem.MainSkill].Fixed / 10;
if (skill >= 100)
baseChance -= (skill - 90) / 10;
EnhanceResult res = EnhanceResult.Success;
PlayerMobile user = from as PlayerMobile;
if (physBonus)
CheckResult(ref res, baseChance + phys);
if (fireBonus)
CheckResult(ref res, baseChance + fire);
if (coldBonus)
CheckResult(ref res, baseChance + cold);
if (nrgyBonus)
CheckResult(ref res, baseChance + nrgy);
if (poisBonus)
CheckResult(ref res, baseChance + pois);
if (duraBonus)
CheckResult(ref res, baseChance + (dura / 40));
if (luckBonus)
CheckResult(ref res, baseChance + 10 + (luck / 2));
if (lreqBonus)
CheckResult(ref res, baseChance + (lreq / 4));
if (dincBonus)
CheckResult(ref res, baseChance + (dinc / 4));
if (user.NextEnhanceSuccess)
{
user.NextEnhanceSuccess = false;
user.SendLocalizedMessage(1149969); // The magical aura that surrounded you disipates and you feel that your item enhancement chances have returned to normal.
res = EnhanceResult.Success;
}
switch (res)
{
case EnhanceResult.Broken:
{
if (!craftItem.ConsumeRes(from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.Half, ref resMessage))
return EnhanceResult.NoResources;
item.Delete();
break;
}
case EnhanceResult.Success:
{
if (!craftItem.ConsumeRes(from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.All, ref resMessage))
return EnhanceResult.NoResources;
if (craftItem.CaddelliteCraft)
{
Caddellite.TryInfuse(from, item, craftSystem);
}
if (item is IResource)
((IResource)item).Resource = resource;
if (item is BaseWeapon)
{
BaseWeapon w = (BaseWeapon)item;
w.DistributeMaterialBonus(attributes);
int hue = w.GetElementalDamageHue();
if (hue > 0)
w.Hue = hue;
}
else if (item is BaseArmor)
{
((BaseArmor)item).DistributeMaterialBonus(attributes);
}
else if (item is FishingPole)
{
((FishingPole)item).DistributeMaterialBonus(attributes);
}
break;
}
case EnhanceResult.Failure:
{
if (!craftItem.ConsumeRes(from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.Half, ref resMessage))
return EnhanceResult.NoResources;
break;
}
}
return res;
}
public static void CheckResult(ref EnhanceResult res, int chance)
{
if (res != EnhanceResult.Success)
return; // we've already failed..
int random = Utility.Random(100);
if (10 > random)
res = EnhanceResult.Failure;
else if (chance > random)
res = EnhanceResult.Broken;
}
public static void BeginTarget(Mobile from, CraftSystem craftSystem, ITool tool)
{
CraftContext context = craftSystem.GetContext(from);
PlayerMobile user = from as PlayerMobile;
if (context == null)
return;
int lastRes = context.LastResourceIndex;
CraftSubResCol subRes = craftSystem.CraftSubRes;
if (lastRes >= 0 && lastRes < subRes.Count)
{
CraftSubRes res = subRes.GetAt(lastRes);
if (from.Skills[craftSystem.MainSkill].Value < res.RequiredSkill)
{
from.SendGump(new CraftGump(from, craftSystem, tool, res.Message));
}
else
{
CraftResource resource = CraftResources.GetFromType(res.ItemType);
if (resource != CraftResource.None)
{
from.Target = new InternalTarget(craftSystem, tool, res.ItemType, resource);
if (user.NextEnhanceSuccess)
{
from.SendLocalizedMessage(1149869, "100"); // Target an item to enhance with the properties of your selected material (Success Rate: ~1_VAL~%).
}
else
{
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 readonly CraftSystem m_CraftSystem;
private readonly ITool m_Tool;
private readonly Type m_ResourceType;
private readonly CraftResource m_Resource;
public InternalTarget(CraftSystem craftSystem, ITool tool, Type resourceType, CraftResource resource)
: base(2, false, TargetFlags.None)
{
m_CraftSystem = craftSystem;
m_Tool = tool;
m_ResourceType = resourceType;
m_Resource = resource;
}
protected override void OnTarget(Mobile from, object targeted)
{
if (targeted is Item)
{
object message = null;
EnhanceResult res = Enhance.Invoke(from, m_CraftSystem, m_Tool, (Item)targeted, m_Resource, m_ResourceType, ref message);
switch (res)
{
case EnhanceResult.NotInBackpack:
message = 1061005;
break; // The item must be in your backpack to enhance it.
case EnhanceResult.AlreadyEnhanced:
message = 1061012;
break; // This item is already enhanced with the properties of a special material.
case EnhanceResult.BadItem:
message = 1061011;
break; // You cannot enhance this type of item with the properties of the selected special material.
case EnhanceResult.BadResource:
message = 1061010;
break; // You must select a special material in order to enhance an item with its properties.
case EnhanceResult.Broken:
message = 1061080;
break; // You attempt to enhance the item, but fail catastrophically. The item is lost.
case EnhanceResult.Failure:
message = 1061082;
break; // You attempt to enhance the item, but fail. Some material is lost in the process.
case EnhanceResult.Success:
message = 1061008;
break; // You enhance the item with the properties of the special material.
case EnhanceResult.NoSkill:
message = 1044153;
break; // You don't have the required skills to attempt this item.
case EnhanceResult.Enchanted:
message = 1080131;
break; // You cannot enhance an item that is currently enchanted.
}
from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, message));
}
}
}
}
}

View File

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

View File

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

View File

@@ -0,0 +1,787 @@
using System;
using Server.Items;
using Server.Mobiles;
using Server.Targeting;
using Server.Factions;
namespace Server.Engines.Craft
{
public interface IRepairable
{
CraftSystem RepairSystem { get; }
}
public class Repair
{
public Repair()
{
}
public static void Do(Mobile from, CraftSystem craftSystem, ITool 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, RepairBenchAddon addon)
{
from.Target = new InternalTarget(craftSystem, addon);
from.SendLocalizedMessage(500436); // Select item to repair.
}
private class InternalTarget : Target
{
private readonly CraftSystem m_CraftSystem;
private readonly ITool m_Tool;
private readonly RepairDeed m_Deed;
private readonly RepairBenchAddon m_Addon;
public InternalTarget(CraftSystem craftSystem, ITool tool)
: base(10, 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, RepairBenchAddon addon)
: base(2, false, TargetFlags.None)
{
m_CraftSystem = craftSystem;
m_Addon = addon;
}
private static void EndMobileRepair(object state)
{
((Mobile)state).EndAction(typeof(IRepairableMobile));
}
private int GetWeakenChance(Mobile mob, SkillName skill, int curHits, int maxHits)
{
double value = 0;
if (m_Deed != null)
{
value = m_Deed.SkillLevel;
}
else if (m_Addon != null)
{
value = m_Addon.Tools.Find(x => x.System == m_CraftSystem).SkillValue;
}
else
{
value = mob.Skills[skill].Value;
}
// 40% - (1% per hp lost) - (1% per 10 craft skill)
return (40 + (maxHits - curHits)) - (int)(value / 10);
}
private bool CheckWeaken(Mobile mob, SkillName skill, int curHits, int maxHits)
{
return (GetWeakenChance(mob, skill, curHits, maxHits) > Utility.Random(100));
}
private int GetRepairDifficulty(int curHits, int maxHits)
{
return (((maxHits - curHits) * 1250) / Math.Max(maxHits, 1)) - 250;
}
private bool CheckRepairDifficulty(Mobile mob, SkillName skill, int curHits, int maxHits)
{
double difficulty = GetRepairDifficulty(curHits, maxHits) * 0.1;
if (m_Deed != null)
{
double value = m_Deed.SkillLevel;
double minSkill = difficulty - 25.0;
double maxSkill = difficulty + 25;
if (value < minSkill)
return false; // Too difficult
else if (value >= maxSkill)
return true; // No challenge
double chance = (value - minSkill) / (maxSkill - minSkill);
return (chance >= Utility.RandomDouble());
}
else if (m_Addon != null)
{
double value = m_Addon.Tools.Find(x => x.System == m_CraftSystem).SkillValue;
double minSkill = difficulty - 25.0;
double maxSkill = difficulty + 25;
if (value < minSkill)
return false; // Too difficult
else if (value >= maxSkill)
return true; // No challenge
double chance = (value - minSkill) / (maxSkill - minSkill);
return (chance >= Utility.RandomDouble());
}
else
{
SkillLock sl = mob.Skills[SkillName.Tinkering].Lock;
mob.Skills[SkillName.Tinkering].SetLockNoRelay(SkillLock.Locked);
bool check = mob.CheckSkill(skill, difficulty - 25.0, difficulty + 25.0);
mob.Skills[SkillName.Tinkering].SetLockNoRelay(sl);
return check;
}
}
private bool CheckDeed(Mobile from)
{
if (m_Deed != null)
{
return m_Deed.Check(from);
}
return true;
}
private bool CheckSpecial(Item item)
{
return item is IRepairable && ((IRepairable)item).RepairSystem == m_CraftSystem;
}
protected override void OnTarget(Mobile from, object targeted)
{
bool usingDeed = (m_Deed != null) || (m_Addon != null);
bool toDelete = false;
int number;
double value = 0;
if (m_Deed != null)
{
value = m_Deed.SkillLevel;
}
else if (m_Addon != null)
{
var tool = m_Addon.Tools.Find(x => x.System == m_CraftSystem);
if (tool.Charges == 0)
{
from.SendLocalizedMessage(1019073);// This item is out of charges.
m_Addon.Using = false;
return;
}
value = tool.SkillValue;
}
else
{
value = from.Skills[m_CraftSystem.MainSkill].Base;
}
if (m_CraftSystem is DefTinkering && targeted is IRepairableMobile)
{
if (TryRepairMobile(from, (IRepairableMobile)targeted, usingDeed, out toDelete))
{
number = 1044279; // You repair the item.
m_CraftSystem.OnRepair(from, m_Tool, m_Deed, m_Addon, (IRepairableMobile)targeted);
}
else
{
number = 500426; // You can't repair that.
}
}
else if (targeted is Item)
{
if (from.InRange(((Item)targeted).GetWorldLocation(), 2))
{
if (!CheckDeed(from))
{
if (m_Addon != null)
m_Addon.Using = false;
return;
}
if (!AllowsRepair(targeted, m_CraftSystem))
{
from.SendLocalizedMessage(500426); // You can't repair that.
if (m_Addon != null)
m_Addon.Using = false;
return;
}
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 (!usingDeed && m_CraftSystem is DefTinkering && targeted is BrokenAutomatonHead)
{
if (((BrokenAutomatonHead)targeted).TryRepair(from))
number = 1044279; // You repair the item.
else
number = 1044280; // You fail to repair the item.
}
else if (targeted is BaseWeapon)
{
BaseWeapon weapon = (BaseWeapon)targeted;
SkillName skill = m_CraftSystem.MainSkill;
int toWeaken = 0;
if (Core.AOS)
{
toWeaken = 1;
}
else if (skill != SkillName.Tailoring)
{
double skillLevel = value;
if (skillLevel >= 90.0)
toWeaken = 1;
else if (skillLevel >= 70.0)
toWeaken = 2;
else
toWeaken = 3;
}
if (m_CraftSystem.CraftItems.SearchForSubclass(weapon.GetType()) == null && !CheckSpecial(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 (weapon.NegativeAttributes.NoRepair > 0)
{
number = 1044277; // That item cannot be repaired.
}
else
{
if (CheckWeaken(from, skill, weapon.HitPoints, weapon.MaxHitPoints))
{
weapon.MaxHitPoints -= toWeaken;
weapon.HitPoints = Math.Max(0, weapon.HitPoints - toWeaken);
}
if (CheckRepairDifficulty(from, skill, weapon.HitPoints, weapon.MaxHitPoints))
{
number = 1044279; // You repair the item.
m_CraftSystem.PlayCraftEffect(from);
weapon.HitPoints = weapon.MaxHitPoints;
m_CraftSystem.OnRepair(from, m_Tool, m_Deed, m_Addon, weapon);
}
else
{
number = (usingDeed) ? 1061137 : 1044280; // You fail to repair the item. [And the contract is destroyed]
m_CraftSystem.PlayCraftEffect(from);
}
toDelete = true;
}
}
else if (targeted is BaseArmor)
{
BaseArmor armor = (BaseArmor)targeted;
SkillName skill = m_CraftSystem.MainSkill;
int toWeaken = 0;
if (Core.AOS)
{
toWeaken = 1;
}
else if (skill != SkillName.Tailoring)
{
double skillLevel = value;
if (skillLevel >= 90.0)
toWeaken = 1;
else if (skillLevel >= 70.0)
toWeaken = 2;
else
toWeaken = 3;
}
if (m_CraftSystem.CraftItems.SearchForSubclass(armor.GetType()) == null && !CheckSpecial(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 (armor.NegativeAttributes.NoRepair > 0)
{
number = 1044277; // That item cannot be repaired.
}
else
{
if (CheckWeaken(from, skill, armor.HitPoints, armor.MaxHitPoints))
{
armor.MaxHitPoints -= toWeaken;
armor.HitPoints = Math.Max(0, armor.HitPoints - toWeaken);
}
if (CheckRepairDifficulty(from, skill, armor.HitPoints, armor.MaxHitPoints))
{
number = 1044279; // You repair the item.
m_CraftSystem.PlayCraftEffect(from);
armor.HitPoints = armor.MaxHitPoints;
m_CraftSystem.OnRepair(from, m_Tool, m_Deed, m_Addon, armor);
}
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 BaseJewel)
{
BaseJewel jewel = (BaseJewel)targeted;
SkillName skill = m_CraftSystem.MainSkill;
int toWeaken = 0;
if (Core.AOS)
{
toWeaken = 1;
}
else if (skill != SkillName.Tailoring)
{
double skillLevel = value;
if (skillLevel >= 90.0)
toWeaken = 1;
else if (skillLevel >= 70.0)
toWeaken = 2;
else
toWeaken = 3;
}
if (m_CraftSystem.CraftItems.SearchForSubclass(jewel.GetType()) == null && !CheckSpecial(jewel))
{
number = (usingDeed) ? 1061136 : 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
}
else if (!jewel.IsChildOf(from.Backpack))
{
number = 1044275; // The item must be in your backpack to repair it.
}
else if (jewel.MaxHitPoints <= 0 || jewel.HitPoints == jewel.MaxHitPoints)
{
number = 1044281; // That item is in full repair
}
else if (jewel.MaxHitPoints <= toWeaken)
{
number = 1044278; // That item has been repaired many times, and will break if repairs are attempted again.
}
else if (jewel.NegativeAttributes.NoRepair > 0)
{
number = 1044277; // That item cannot be repaired.
}
else
{
if (CheckWeaken(from, skill, jewel.HitPoints, jewel.MaxHitPoints))
{
jewel.MaxHitPoints -= toWeaken;
jewel.HitPoints = Math.Max(0, jewel.HitPoints - toWeaken);
}
if (CheckRepairDifficulty(from, skill, jewel.HitPoints, jewel.MaxHitPoints))
{
number = 1044279; // You repair the item.
m_CraftSystem.PlayCraftEffect(from);
jewel.HitPoints = jewel.MaxHitPoints;
m_CraftSystem.OnRepair(from, m_Tool, m_Deed, m_Addon, jewel);
}
else
{
number = (usingDeed) ? 1061137 : 1044280; // You fail to repair the item. [And the contract is destroyed]
m_CraftSystem.PlayCraftEffect(from);
}
toDelete = true;
}
}
else if (targeted is BaseClothing)
{
BaseClothing clothing = (BaseClothing)targeted;
SkillName skill = m_CraftSystem.MainSkill;
int toWeaken = 0;
if (Core.AOS)
{
toWeaken = 1;
}
else if (skill != SkillName.Tailoring)
{
double skillLevel = value;
if (skillLevel >= 90.0)
toWeaken = 1;
else if (skillLevel >= 70.0)
toWeaken = 2;
else
toWeaken = 3;
}
if (m_CraftSystem.CraftItems.SearchForSubclass(clothing.GetType()) == null && !CheckSpecial(clothing))
{
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 (clothing.NegativeAttributes.NoRepair > 0)// quick fix
{
number = 1044277; // That item cannot be repaired.
}
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;
m_CraftSystem.OnRepair(from, m_Tool, m_Deed, m_Addon, clothing);
}
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 BaseTalisman)
{
BaseTalisman talisman = (BaseTalisman)targeted;
SkillName skill = m_CraftSystem.MainSkill;
int toWeaken = 0;
if (Core.AOS)
{
toWeaken = 1;
}
else if (skill != SkillName.Tailoring)
{
double skillLevel = value;
if (skillLevel >= 90.0)
toWeaken = 1;
else if (skillLevel >= 70.0)
toWeaken = 2;
else
toWeaken = 3;
}
if (!(m_CraftSystem is DefTinkering))
{
number = (usingDeed) ? 1061136 : 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
}
else if (!talisman.IsChildOf(from.Backpack) && (!Core.ML || talisman.Parent != from))
{
number = 1044275; // The item must be in your backpack to repair it.
}
else if (talisman.MaxHitPoints <= 0 || talisman.HitPoints == talisman.MaxHitPoints)
{
number = 1044281; // That item is in full repair
}
else if (talisman.MaxHitPoints <= toWeaken)
{
number = 1044278; // That item has been repaired many times, and will break if repairs are attempted again.
}
else if (!talisman.CanRepair)// quick fix
{
number = 1044277; // That item cannot be repaired.
}
else
{
if (CheckWeaken(from, skill, talisman.HitPoints, talisman.MaxHitPoints))
{
talisman.MaxHitPoints -= toWeaken;
talisman.HitPoints = Math.Max(0, talisman.HitPoints - toWeaken);
}
if (CheckRepairDifficulty(from, skill, talisman.HitPoints, talisman.MaxHitPoints))
{
number = 1044279; // You repair the item.
m_CraftSystem.PlayCraftEffect(from);
talisman.HitPoints = talisman.MaxHitPoints;
m_CraftSystem.OnRepair(from, m_Tool, m_Deed, m_Addon, talisman);
}
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 BlankScroll)
{
if (!usingDeed)
{
SkillName skill = m_CraftSystem.MainSkill;
if (from.Skills[skill].Value >= 50.0)
{
((BlankScroll)targeted).Consume(1);
RepairDeed deed = new RepairDeed(RepairDeed.GetTypeFor(m_CraftSystem), from.Skills[skill].Value, from);
from.AddToBackpack(deed);
number = 500442; // You create the item and put it in your backpack.
}
else
{
number = 1047005; // You must be at least apprentice level to create a repair service contract.
}
}
else
{
number = 1061136; // You cannot repair that item with this type of repair contract.
}
}
else
{
number = 500426; // You can't repair that.
}
}
else
{
number = 500446; // That is too far away.
}
}
else
{
number = 500426; // You can't repair that.
}
if (!usingDeed)
{
CraftContext context = m_CraftSystem.GetContext(from);
from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, number));
}
else
{
if (m_Addon != null && !m_Addon.Deleted)
{
var tool = m_Addon.Tools.Find(x => x.System == m_CraftSystem);
tool.Charges--;
from.SendGump(new RepairBenchGump(from, m_Addon));
from.SendLocalizedMessage(number);
}
else
{
from.SendLocalizedMessage(number);
if (toDelete)
m_Deed.Delete();
}
}
}
protected override void OnTargetCancel(Mobile from, TargetCancelType cancelType)
{
if (m_Addon != null && !m_Addon.Deleted)
{
from.SendGump(new RepairBenchGump(from, m_Addon));
}
}
public bool TryRepairMobile(Mobile from, IRepairableMobile m, bool usingDeed, out bool toDelete)
{
int damage = m.HitsMax - m.Hits;
BaseCreature bc = m as BaseCreature;
toDelete = false;
string name = bc != null ? bc.Name : "the creature";
if (!from.InRange(m.Location, 2))
{
from.SendLocalizedMessage(1113612, name); // You must move closer to attempt to repair ~1_CREATURE~.
}
else if (bc != null && bc.IsDeadBondedPet)
{
from.SendLocalizedMessage(500426); // You can't repair that.
}
else if (damage <= 0)
{
from.SendLocalizedMessage(1113613, name); // ~1_CREATURE~ doesn't appear to be damaged.
}
else
{
double value = 0;
if (m_Deed != null)
{
value = m_Deed.SkillLevel;
}
else if (m_Addon != null)
{
value = m_Addon.Tools.Find(x => x.System == m_CraftSystem).SkillValue;
}
else
{
value = from.Skills[SkillName.Tinkering].Value;
}
double skillValue = value;
double required = m is KotlAutomaton ? 80.0 : 0.1;
if (skillValue < required)
{
if (required == 80.0)
from.SendLocalizedMessage(1157049, name); // You must have at least 80 tinkering skill to attempt to repair ~1_CREATURE~.
else
from.SendLocalizedMessage(1113614, name); // You must have some tinkering skills to attempt to repair a ~1_CREATURE~.
}
else if (!from.CanBeginAction(typeof(IRepairableMobile)))
{
from.SendLocalizedMessage(1113611, name); // You must wait a moment before attempting to repair ~1_CREATURE~ again.
}
else if (bc != null && bc.GetMaster() != null && bc.GetMaster() != from && !bc.GetMaster().InRange(from.Location, 10))
{
from.SendLocalizedMessage(1157045); // The pet's owner must be nearby to attempt repair.
}
else if (!from.CanBeBeneficial(bc, false, false))
{
from.SendLocalizedMessage(1001017); // You cannot perform beneficial acts on your target.
}
else
{
if (damage > (int)(skillValue * 0.6))
damage = (int)(skillValue * 0.6);
SkillLock sl = from.Skills[SkillName.Tinkering].Lock;
from.Skills[SkillName.Tinkering].SetLockNoRelay(SkillLock.Locked);
if (!from.CheckSkill(SkillName.Tinkering, 0.0, 100.0))
damage /= 6;
from.Skills[SkillName.Tinkering].SetLockNoRelay(sl);
Container pack = from.Backpack;
if (pack != null)
{
int v = pack.ConsumeUpTo(m.RepairResource, (damage + 4) / 5);
if (v <= 0 && m is Golem)
v = pack.ConsumeUpTo(typeof(BronzeIngot), (damage + 4) / 5);
if (v > 0)
{
m.Hits += damage;
if (damage > 1)
from.SendLocalizedMessage(1113616, name); // You repair ~1_CREATURE~.
else
from.SendLocalizedMessage(1157030, name); // You repair ~1_CREATURE~, but it barely helps.
toDelete = true;
double delay = 10 - (skillValue / 16.65);
from.BeginAction(typeof(IRepairableMobile));
Timer.DelayCall(TimeSpan.FromSeconds(delay), new TimerStateCallback(EndMobileRepair), from);
return true;
}
else if (m is Golem)
{
from.SendLocalizedMessage(1113615, name); // You need some iron or bronze ingots to repair the ~1_CREATURE~.
}
else
{
from.SendLocalizedMessage(1044037); // You do not have sufficient metal to make that.
}
}
else
{
from.SendLocalizedMessage(1044037); // You do not have sufficient metal to make that.
}
}
}
return false;
}
}
public static bool AllowsRepair(object targeted, CraftSystem system)
{
if (targeted is IFactionItem && ((IFactionItem)targeted).FactionItemState != null)
return false;
if (targeted is BrokenAutomatonHead || targeted is IRepairableMobile)
return true;
return (targeted is BlankScroll ||
(targeted is BaseArmor && ((BaseArmor)targeted).CanRepair) ||
(targeted is BaseWeapon && ((BaseWeapon)targeted).CanRepair) ||
(targeted is BaseClothing && ((BaseClothing)targeted).CanRepair) ||
(targeted is BaseJewel && ((BaseJewel)targeted).CanRepair)) ||
(targeted is BaseTalisman && ((BaseTalisman)targeted).CanRepair);
}
}
}

View File

@@ -0,0 +1,189 @@
using System;
using Server.Items;
using Server.Targeting;
namespace Server.Engines.Craft
{
public enum SmeltResult
{
Success,
Invalid,
NoSkill
}
public class Resmelt
{
public Resmelt()
{
}
public static void Do(Mobile from, CraftSystem craftSystem, ITool 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.
}
}
private class InternalTarget : Target
{
private readonly CraftSystem m_CraftSystem;
private readonly ITool m_Tool;
public InternalTarget(CraftSystem craftSystem, ITool tool)
: base(2, false, TargetFlags.None)
{
m_CraftSystem = craftSystem;
m_Tool = tool;
}
protected override void OnTarget(Mobile from, object targeted)
{
int num = m_CraftSystem.CanCraft(from, m_Tool, null);
if (num > 0)
{
if (num == 1044267)
{
bool anvil, forge;
DefBlacksmithy.CheckAnvilAndForge(from, 2, out anvil, out forge);
if (!anvil)
num = 1044266; // You must be near an anvil
else if (!forge)
num = 1044265; // You must be near a forge.
}
from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, num));
}
else
{
SmeltResult result = SmeltResult.Invalid;
bool isStoreBought = false;
int message;
if (targeted is BaseArmor)
{
result = Resmelt(from, (BaseArmor)targeted, ((BaseArmor)targeted).Resource);
isStoreBought = !((BaseArmor)targeted).PlayerConstructed;
}
else if (targeted is BaseWeapon)
{
result = Resmelt(from, (BaseWeapon)targeted, ((BaseWeapon)targeted).Resource);
isStoreBought = !((BaseWeapon)targeted).PlayerConstructed;
}
else if (targeted is DragonBardingDeed)
{
result = Resmelt(from, (DragonBardingDeed)targeted, ((DragonBardingDeed)targeted).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));
}
}
private SmeltResult Resmelt(Mobile from, Item item, CraftResource resource)
{
try
{
if (Ethics.Ethic.IsImbued(item))
return SmeltResult.Invalid;
if (CraftResources.GetType(resource) != CraftResourceType.Metal)
return SmeltResult.Invalid;
CraftResourceInfo info = CraftResources.GetInfo(resource);
if (info == null || info.ResourceTypes.Length == 0)
return SmeltResult.Invalid;
CraftItem craftItem = m_CraftSystem.CraftItems.SearchFor(item.GetType());
if (craftItem == null || craftItem.Resources.Count == 0)
return SmeltResult.Invalid;
CraftRes craftResource = craftItem.Resources.GetAt(0);
if (craftResource.Amount < 2)
return SmeltResult.Invalid; // Not enough metal to resmelt
double difficulty = 0.0;
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 skill = Math.Max(from.Skills[SkillName.Mining].Value, from.Skills[SkillName.Blacksmith].Value);
if (difficulty > skill)
return SmeltResult.NoSkill;
Type resourceType = info.ResourceTypes[0];
Item ingot = (Item)Activator.CreateInstance(resourceType);
if (item is DragonBardingDeed || (item is BaseArmor && ((BaseArmor)item).PlayerConstructed) || (item is BaseWeapon && ((BaseWeapon)item).PlayerConstructed) || (item is BaseClothing && ((BaseClothing)item).PlayerConstructed))
ingot.Amount = (int)((double)craftResource.Amount * .66);
else
ingot.Amount = 1;
item.Delete();
from.AddToBackpack(ingot);
from.PlaySound(0x2A);
from.PlaySound(0x240);
return SmeltResult.Success;
}
catch
{
}
return SmeltResult.Invalid;
}
}
}
}

View File

@@ -0,0 +1,378 @@
using System;
using Server.Items;
namespace Server.Engines.Craft
{
public enum AlchemyRecipes
{
BarrabHemolymphConcentrate = 900,
JukariBurnPoiltice = 901,
KurakAmbushersEssence = 902,
BarakoDraftOfMight = 903,
UraliTranceTonic = 904,
SakkhraProphylaxisPotion = 905,
}
public class DefAlchemy : CraftSystem
{
public override SkillName MainSkill
{
get
{
return SkillName.Alchemy;
}
}
public override int GumpTitleNumber
{
get
{
return 1044001;
}// <CENTER>ALCHEMY MENU</CENTER>
}
private static CraftSystem m_CraftSystem;
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefAlchemy();
return m_CraftSystem;
}
}
public override double GetChanceAtMin(CraftItem item)
{
return 0.0; // 0%
}
private DefAlchemy()
: base(1, 1, 1.25)// base( 1, 1, 3.1 )
{
}
public override int CanCraft(Mobile from, ITool tool, Type itemType)
{
int num = 0;
if (tool == null || tool.Deleted || tool.UsesRemaining <= 0)
return 1044038; // You have worn out your tool!
else if (!tool.CheckAccessible(from, ref num))
return num; // The tool must be on your person to use.
return 0;
}
public override void PlayCraftEffect(Mobile from)
{
from.PlaySound(0x242);
}
private static readonly Type typeofPotion = typeof(BasePotion);
public static bool IsPotion(Type type)
{
return typeofPotion.IsAssignableFrom(type);
}
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if (failed)
{
if (IsPotion(item.ItemType))
{
from.AddToBackpack(new Bottle());
return 500287; // You fail to create a useful potion.
}
else
{
return 1044043; // You failed to create the item, and some of your materials are lost.
}
}
else
{
from.PlaySound(0x240); // Sound of a filling bottle
if (IsPotion(item.ItemType))
{
if (quality == -1)
return 1048136; // You create the potion and pour it into a keg.
else
return 500279; // You pour the potion into a bottle...
}
else
{
return 1044154; // You create the item.
}
}
}
public override void InitCraftList()
{
int index = -1;
// Healing and Curative
index = AddCraft(typeof(RefreshPotion), 1116348, 1044538, -25, 25.0, typeof(BlackPearl), 1044353, 1, 1044361);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(TotalRefreshPotion), 1116348, 1044539, 25.0, 75.0, typeof(BlackPearl), 1044353, 5, 1044361);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(LesserHealPotion), 1116348, 1044543, -25.0, 25.0, typeof(Ginseng), 1044356, 1, 1044364);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(HealPotion), 1116348, 1044544, 15.0, 65.0, typeof(Ginseng), 1044356, 3, 1044364);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(GreaterHealPotion), 1116348, 1044545, 55.0, 105.0, typeof(Ginseng), 1044356, 7, 1044364);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(LesserCurePotion), 1116348, 1044552, -10.0, 40.0, typeof(Garlic), 1044355, 1, 1044363);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(CurePotion), 1116348, 1044553, 25.0, 75.0, typeof(Garlic), 1044355, 3, 1044363);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(GreaterCurePotion), 1116348, 1044554, 65.0, 115.0, typeof(Garlic), 1044355, 6, 1044363);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
if (Core.SA)
{
index = AddCraft(typeof(ElixirOfRebirth), 1116348, 1112762, 65.0, 115.0, typeof(MedusaBlood), 1031702, 1, 1044253);
AddRes(index, typeof(SpidersSilk), 1044360, 3, 1044368);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
}
if (Core.TOL)
{
index = AddCraft(typeof(BarrabHemolymphConcentrate), 1116348, 1156724, 51.0, 151.0, typeof(Bottle), 1044529, 1, 500315);
AddRes(index, typeof(Ginseng), 1044356, 20, 1044364);
AddRes(index, typeof(PlantClippings), 1112131, 5, 1044253);
AddRes(index, typeof(MyrmidexEggsac), 1156725, 5, 1044253);
AddRecipe(index, (int)AlchemyRecipes.BarrabHemolymphConcentrate);
}
// Enhancement
index = AddCraft(typeof(AgilityPotion), 1116349, 1044540, 15.0, 65.0, typeof(Bloodmoss), 1044354, 1, 1044362);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(GreaterAgilityPotion), 1116349, 1044541, 35.0, 85.0, typeof(Bloodmoss), 1044354, 3, 1044362);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(NightSightPotion), 1116349, 1044542, -25.0, 25.0, typeof(SpidersSilk), 1044360, 1, 1044368);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(StrengthPotion), 1116349, 1044546, 25.0, 75.0, typeof(MandrakeRoot), 1044357, 2, 1044365);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(GreaterStrengthPotion), 1116349, 1044547, 45.0, 95.0, typeof(MandrakeRoot), 1044357, 5, 1044365);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
if (Core.ML)
{
index = AddCraft(typeof(InvisibilityPotion), 1116349, 1074860, 65.0, 115.0, typeof(Bottle), 1044529, 1, 500315);
AddRes(index, typeof(Bloodmoss), 1044354, 4, 1044362);
AddRes(index, typeof(Nightshade), 1044358, 3, 1044366);
AddRecipe(index, (int)TinkerRecipes.InvisibilityPotion);
}
if (Core.TOL)
{
index = AddCraft(typeof(JukariBurnPoiltice), 1116349, 1156726, 51.0, 151.0, typeof(Bottle), 1044529, 1, 500315);
AddRes(index, typeof(BlackPearl), 1044353, 20, 1044361);
AddRes(index, typeof(Vanilla), 1080000, 10, 1080008);
AddRes(index, typeof(LavaBerry), 1156727, 5, 1044253);
AddRecipe(index, (int)AlchemyRecipes.JukariBurnPoiltice);
index = AddCraft(typeof(KurakAmbushersEssence), 1116349, 1156728, 51.0, 151.0, typeof(Bottle), 1044529, 1, 500315);
AddRes(index, typeof(Bloodmoss), 1044354, 20, 1044362);
AddRes(index, typeof(BlueDiamond), 1032696, 1, 1044253);
AddRes(index, typeof(TigerPelt), 1156727, 10, 1044253);
AddRecipe(index, (int)AlchemyRecipes.KurakAmbushersEssence);
index = AddCraft(typeof(BarakoDraftOfMight), 1116349, 1156729, 51.0, 151.0, typeof(Bottle), 1044529, 1, 500315);
AddRes(index, typeof(SpidersSilk), 1044360, 20, 1044368);
AddRes(index, typeof(BaseBeverage), 1022459, 10, 1044253);
AddRes(index, typeof(PerfectBanana), 1156730, 5, 1044253);
SetBeverageType(index, BeverageType.Liquor);
AddRecipe(index, (int)AlchemyRecipes.BarakoDraftOfMight);
index = AddCraft(typeof(UraliTranceTonic), 1116349, 1156734, 51.0, 151.0, typeof(Bottle), 1044529, 1, 500315);
AddRes(index, typeof(MandrakeRoot), 1044357, 20, 1044365);
AddRes(index, typeof(YellowScales), 1156799, 10, 1044253);
AddRes(index, typeof(RiverMoss), 1156731, 5, 1044253);
AddRecipe(index, (int)AlchemyRecipes.UraliTranceTonic);
index = AddCraft(typeof(SakkhraProphylaxisPotion), 1116349, 1156732, 51.0, 151.0, typeof(Bottle), 1044529, 1, 500315);
AddRes(index, typeof(Nightshade), 1044358, 20, 1044366);
AddRes(index, typeof(BaseBeverage), 1022503, 10, 1044253);
AddRes(index, typeof(BlueCorn), 1156733, 5, 1044253);
SetBeverageType(index, BeverageType.Wine);
AddRecipe(index, (int)AlchemyRecipes.SakkhraProphylaxisPotion);
}
// Toxic
index = AddCraft(typeof(LesserPoisonPotion), 1116350, 1044548, -5.0, 45.0, typeof(Nightshade), 1044358, 1, 1044366);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(PoisonPotion), 1116350, 1044549, 15.0, 65.0, typeof(Nightshade), 1044358, 2, 1044366);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(GreaterPoisonPotion), 1116350, 1044550, 55.0, 105.0, typeof(Nightshade), 1044358, 4, 1044366);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(DeadlyPoisonPotion), 1116350, 1044551, 90.0, 140.0, typeof(Nightshade), 1044358, 8, 1044366);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
if (Core.ML)
{
index = AddCraft(typeof(ParasiticPotion), 1116350, 1072942, 65.0, 115.0, typeof(Bottle), 1044529, 1, 500315);
AddRes(index, typeof(ParasiticPlant), 1073474, 5, 1044253);
AddRecipe(index, (int)TinkerRecipes.ParasiticPotion);
index = AddCraft(typeof(DarkglowPotion), 1116350, 1072943, 65.0, 115.0, typeof(Bottle), 1044529, 1, 500315);
AddRes(index, typeof(LuminescentFungi), 1073475, 5, 1044253);
AddRecipe(index, (int)TinkerRecipes.DarkglowPotion);
index = AddCraft(typeof(ScouringToxin), 1116350, 1112292, 75.0, 100.0, typeof(ToxicVenomSac), 1112291, 1, 1044253);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
}
// Explosive
index = AddCraft(typeof(LesserExplosionPotion), 1116351, 1044555, 5.0, 55.0, typeof(SulfurousAsh), 1044359, 3, 1044367);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(ExplosionPotion), 1116351, 1044556, 35.0, 85.0, typeof(SulfurousAsh), 1044359, 5, 1044367);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(GreaterExplosionPotion), 1116351, 1044557, 65.0, 115.0, typeof(SulfurousAsh), 1044359, 10, 1044367);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
if (Core.ML)
{
index = AddCraft(typeof(ConflagrationPotion), 1116351, 1072096, 55.0, 105.0, typeof(Bottle), 1044529, 1, 500315);
AddRes(index, typeof(GraveDust), 1023983, 5, 1044253);
index = AddCraft(typeof(GreaterConflagrationPotion), 1116351, 1072099, 70.0, 120.0, typeof(Bottle), 1044529, 1, 500315);
AddRes(index, typeof(GraveDust), 1023983, 10, 1044253);
index = AddCraft(typeof(ConfusionBlastPotion), 1116351, 1072106, 55.0, 105.0, typeof(Bottle), 1044529, 1, 500315);
AddRes(index, typeof(PigIron), 1023978, 5, 1044253);
index = AddCraft(typeof(GreaterConfusionBlastPotion), 1116351, 1072109, 70.0, 120.0, typeof(Bottle), 1044529, 1, 500315);
AddRes(index, typeof(PigIron), 1023978, 10, 1044253);
}
if (Core.SA)
{
index = AddCraft(typeof(BlackPowder), 1116351, 1095826, 65.0, 115.0, typeof(SulfurousAsh), 1023980, 1, 1044253);
AddRes(index, typeof(Saltpeter), 1116302, 6, 1044253);
AddRes(index, typeof(Charcoal), 1116303, 1, 1044253);
if (Core.EJ) SetUseAllRes(index, true);
// Removed for Dark Tides Cannon Changes
if (!Core.EJ)
{
index = AddCraft(typeof(Matchcord), 1116351, 1095184, 25.0, 80.0, typeof(DarkYarn), 1023615, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1024088, 1, 1044253);
AddRes(index, typeof(Saltpeter), 1116302, 1, 1044253);
AddRes(index, typeof(Potash), 1116319, 1, 1044253);
}
index = AddCraft(typeof(FuseCord), 1116351, 1116305, 55.0, 105.0, typeof(DarkYarn), 1023615, 1, 1044253);
AddRes(index, typeof(BlackPowder), 1095826, 1, 1044253);
AddRes(index, typeof(Potash), 1116319, 1, 1044253);
SetNeedWater(index, true);
}
// Strange Brew
if (Core.SE)
{
index = AddCraft(typeof(SmokeBomb), 1116353, 1030248, 90.0, 120.0, typeof(Eggs), 1044477, 1, 1044253);
AddRes(index, typeof(Ginseng), 1044356, 3, 1044364);
}
if (Core.ML)
{
index = AddCraft(typeof(HoveringWisp), 1116353, 1072881, 75.0, 125.0, typeof(CapturedEssence), 1032686, 4, 1044253);
if (!Core.TOL) // Removed at OSI Publish 103
AddRecipe(index, (int)TinkerRecipes.HoveringWisp);
}
if (Core.SA)
{
index = AddCraft(typeof(NaturalDye), 1116353, 1112136, 75.0, 100.0, typeof(PlantPigment), 1112132, 1, 1044253);
AddRes(index, typeof(ColorFixative), 1112135, 1, 1044253);
SetItemHue(index, 2101);
SetRequireResTarget(index);
index = AddCraft(typeof(NexusCore), 1116353, 1153501, 90.0, 120.0, typeof(MandrakeRoot), 1015013, 10, 1044253);
AddRes(index, typeof(SpidersSilk), 1015007, 10, 1044253);
AddRes(index, typeof(DarkSapphire), 1032690, 5, 1044253);
AddRes(index, typeof(CrushedGlass), 1113351, 5, 1044253);
ForceNonExceptional(index);
}
// Ingrediants
if (Core.SA)
{
// Ingrediants
index = AddCraft(typeof(PlantPigment), 1044495, 1112132, 33.0, 83.0, typeof(PlantClippings), 1112131, 1, 1044253);
AddRes(index, typeof(Bottle), 1023854, 1, 1044253);
SetItemHue(index, 2101);
SetRequireResTarget(index);
index = AddCraft(typeof(ColorFixative), 1044495, 1112135, 75.0, 100.0, typeof(SilverSerpentVenom), 1112173, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1022503, 1, 1044253);
SetBeverageType(index, BeverageType.Wine);
index = AddCraft(typeof(CrystalGranules), 1044495, 1112329, 75.0, 100.0, typeof(ShimmeringCrystals), 1075095, 1, 1044253);
SetItemHue(index, 2625);
index = AddCraft(typeof(CrystalDust), 1044495, 1112328, 75.0, 100.0, typeof(CrystallineFragments), 1153988, 4, 1044253);
SetItemHue(index, 2103);
index = AddCraft(typeof(SoftenedReeds), 1044495, 1112249, 75.0, 100.0, typeof(DryReeds), 1112248, 1, 1112250);
AddRes(index, typeof(ScouringToxin), 1112292, 2, 1112326);
SetRequireResTarget(index);
SetRequiresBasketWeaving(index);
index = AddCraft(typeof(VialOfVitriol), 1044495, 1113331, 90.0, 100.0, typeof(ParasiticPotion), 1072848, 1, 1113754);
AddRes(index, typeof (Nightshade), 1044358, 30, 1044366);
AddSkill(index, SkillName.Magery, 75.0, 100.0);
index = AddCraft(typeof(BottleIchor), 1044495, 1113361, 90.0, 100.0, typeof(DarkglowPotion), 1072849, 1, 1113755);
AddRes(index, typeof(SpidersSilk), 1044360, 1, 1044368);
AddSkill(index, SkillName.Magery, 75.0, 100.0);
}
if (Core.HS)
{
index = AddCraft(typeof(Potash), 1044495, 1116319, 0.0, 50.0, typeof(Board), 1044041, 1, 1044253);
if (Core.EJ)
{
SetNeedWater(index, true);
SetUseAllRes(index, true);
}
else
{
AddRes(index, typeof(BaseBeverage), 1024088, 1, 1044253);
}
}
if (Core.SA)
{
index = AddCraft(typeof(GoldDust), 1044495, 1153504, 90.0, 120.0, typeof(Gold), 3000083, 1000, 1150747);
ForceNonExceptional(index);
}
}
}
}

View File

@@ -0,0 +1,977 @@
#region References
using System;
using Server.Items;
#endregion
namespace Server.Engines.Craft
{
#region Mondain's Legacy
public enum SmithRecipes
{
// magical
TrueSpellblade = 300,
IcySpellblade = 301,
FierySpellblade = 302,
SpellbladeOfDefense = 303,
TrueAssassinSpike = 304,
ChargedAssassinSpike = 305,
MagekillerAssassinSpike = 306,
WoundingAssassinSpike = 307,
TrueLeafblade = 308,
Luckblade = 309,
MagekillerLeafblade = 310,
LeafbladeOfEase = 311,
KnightsWarCleaver = 312,
ButchersWarCleaver = 313,
SerratedWarCleaver = 314,
TrueWarCleaver = 315,
AdventurersMachete = 316,
OrcishMachete = 317,
MacheteOfDefense = 318,
DiseasedMachete = 319,
Runesabre = 320,
MagesRuneBlade = 321,
RuneBladeOfKnowledge = 322,
CorruptedRuneBlade = 323,
TrueRadiantScimitar = 324,
DarkglowScimitar = 325,
IcyScimitar = 326,
TwinklingScimitar = 327,
GuardianAxe = 328,
SingingAxe = 329,
ThunderingAxe = 330,
HeavyOrnateAxe = 331,
RubyMace = 332, //good
EmeraldMace = 333, //good
SapphireMace = 334, //good
SilverEtchedMace = 335, //good
BoneMachete = 336,
// arties
RuneCarvingKnife = 350,
ColdForgedBlade = 351,
OverseerSunderedBlade = 352,
LuminousRuneBlade = 353,
ShardTrasher = 354, //good
// doom
BritchesOfWarding = 355,
GlovesOfFeudalGrip = 356
}
#endregion
public class DefBlacksmithy : CraftSystem
{
public override SkillName MainSkill { get { return SkillName.Blacksmith; } }
public override int GumpTitleNumber
{
get { return 1044002; } // <CENTER>BLACKSMITHY MENU</CENTER>
}
private static CraftSystem m_CraftSystem;
public static CraftSystem CraftSystem { get { return m_CraftSystem ?? (m_CraftSystem = new DefBlacksmithy()); } }
public override CraftECA ECA { get { return CraftECA.ChanceMinusSixtyToFourtyFive; } }
public override double GetChanceAtMin(CraftItem item)
{
if (item.NameNumber == 1157349 || item.NameNumber == 1157345) // Gloves Of FeudalGrip and Britches Of Warding
return 0.05; // 5%
return 0.0; // 0%
}
private DefBlacksmithy()
: base(1, 1, 1.25) // base( 1, 2, 1.7 )
{
/*
base( MinCraftEffect, MaxCraftEffect, Delay )
MinCraftEffect : The minimum number of time the mobile will play the craft effect
MaxCraftEffect : The maximum number of time the mobile will play the craft effect
Delay : The delay between each craft effect
Example: (3, 6, 1.7) would make the mobile do the PlayCraftEffect override
function between 3 and 6 time, with a 1.7 second delay each time.
*/
}
private static readonly Type typeofAnvil = typeof(AnvilAttribute);
private static readonly Type typeofForge = typeof(ForgeAttribute);
public static void CheckAnvilAndForge(Mobile from, int range, out bool anvil, out bool forge)
{
anvil = false;
forge = false;
Map map = from.Map;
if (map == null)
{
return;
}
IPooledEnumerable eable = map.GetItemsInRange(from.Location, range);
foreach (Item item in eable)
{
Type type = item.GetType();
bool isAnvil = (type.IsDefined(typeofAnvil, false) || item.ItemID == 4015 || item.ItemID == 4016 ||
item.ItemID == 0x2DD5 || item.ItemID == 0x2DD6);
bool isForge = (type.IsDefined(typeofForge, false) || item.ItemID == 4017 ||
(item.ItemID >= 6522 && item.ItemID <= 6569) || item.ItemID == 0x2DD8) ||
item.ItemID == 0xA531 || item.ItemID == 0xA535;
if (!isAnvil && !isForge)
{
continue;
}
if ((from.Z + 16) < item.Z || (item.Z + 16) < from.Z || !from.InLOS(item))
{
continue;
}
anvil = anvil || isAnvil;
forge = forge || isForge;
if (anvil && forge)
{
break;
}
}
eable.Free();
for (int x = -range; (!anvil || !forge) && x <= range; ++x)
{
for (int y = -range; (!anvil || !forge) && y <= range; ++y)
{
var tiles = map.Tiles.GetStaticTiles(from.X + x, from.Y + y, true);
for (int i = 0; (!anvil || !forge) && i < tiles.Length; ++i)
{
int id = tiles[i].ID;
bool isAnvil = (id == 4015 || id == 4016 || id == 0x2DD5 || id == 0x2DD6);
bool isForge = (id == 4017 || (id >= 6522 && id <= 6569) || id == 0x2DD8);
if (!isAnvil && !isForge)
{
continue;
}
if ((from.Z + 16) < tiles[i].Z || (tiles[i].Z + 16) < from.Z ||
!from.InLOS(new Point3D(from.X + x, from.Y + y, tiles[i].Z + (tiles[i].Height / 2) + 1)))
{
continue;
}
anvil = anvil || isAnvil;
forge = forge || isForge;
}
}
}
}
public override int CanCraft(Mobile from, ITool tool, Type itemType)
{
int num = 0;
if (tool == null || tool.Deleted || tool.UsesRemaining <= 0)
{
return 1044038; // You have worn out your tool!
}
if (tool is Item && !BaseTool.CheckTool((Item)tool, from))
{
return 1048146; // If you have a tool equipped, you must use that tool.
}
else if (!tool.CheckAccessible(from, ref num))
{
return num; // The tool must be on your person to use.
}
if (tool is AddonToolComponent && from.InRange(((AddonToolComponent)tool).GetWorldLocation(), 2))
{
return 0;
}
bool anvil, forge;
CheckAnvilAndForge(from, 2, out anvil, out forge);
if (anvil && forge)
{
return 0;
}
return 1044267; // You must be near an anvil and a forge to smith items.
}
public override void PlayCraftEffect(Mobile from)
{
// no animation, instant sound
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
// from.Animate( 9, 5, 1, true, false, 0 );
//new InternalTimer( from ).Start();
from.PlaySound(0x2A);
}
// Delay to synchronize the sound with the hit on the anvil
private class InternalTimer : Timer
{
private readonly Mobile m_From;
public InternalTimer(Mobile from)
: base(TimeSpan.FromSeconds(0.7))
{
m_From = from;
}
protected override void OnTick()
{
m_From.PlaySound(0x2A);
}
}
public override int PlayEndingEffect(
Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
{
if (toolBroken)
{
from.SendLocalizedMessage(1044038); // You have worn out your tool
}
if (failed)
{
if (lostMaterial)
{
return 1044043; // You failed to create the item, and some of your materials are lost.
}
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()
{
/*
Synthax for a SIMPLE craft item
AddCraft( ObjectType, Group, MinSkill, MaxSkill, ResourceType, Amount, Message )
ObjectType : The type of the object you want to add to the build list.
Group : The group in wich the object will be showed in the craft menu.
MinSkill : The minimum of skill value
MaxSkill : The maximum of skill value
ResourceType : The type of the resource the mobile need to create the item
Amount : The amount of the ResourceType it need to create the item
Message : String or Int for Localized. The message that will be sent to the mobile, if the specified resource is missing.
Synthax for a COMPLEXE craft item. A complexe item is an item that need either more than
only one skill, or more than only one resource.
Coming soon....
*/
int index;
#region Metal Armor
#region Ringmail
AddCraft(typeof(RingmailGloves), 1111704, 1025099, 12.0, 62.0, typeof(IronIngot), 1044036, 10, 1044037);
AddCraft(typeof(RingmailLegs), 1111704, 1025104, 19.4, 69.4, typeof(IronIngot), 1044036, 16, 1044037);
AddCraft(typeof(RingmailArms), 1111704, 1025103, 16.9, 66.9, typeof(IronIngot), 1044036, 14, 1044037);
AddCraft(typeof(RingmailChest), 1111704, 1025100, 21.9, 71.9, typeof(IronIngot), 1044036, 18, 1044037);
#endregion
#region Chainmail
AddCraft(typeof(ChainCoif), 1111704, 1025051, 14.5, 64.5, typeof(IronIngot), 1044036, 10, 1044037);
AddCraft(typeof(ChainLegs), 1111704, 1025054, 36.7, 86.7, typeof(IronIngot), 1044036, 18, 1044037);
AddCraft(typeof(ChainChest), 1111704, 1025055, 39.1, 89.1, typeof(IronIngot), 1044036, 20, 1044037);
#endregion
#region Platemail
AddCraft(typeof(PlateArms), 1111704, 1025136, 66.3, 116.3, typeof(IronIngot), 1044036, 18, 1044037);
AddCraft(typeof(PlateGloves), 1111704, 1025140, 58.9, 108.9, typeof(IronIngot), 1044036, 12, 1044037);
AddCraft(typeof(PlateGorget), 1111704, 1025139, 56.4, 106.4, typeof(IronIngot), 1044036, 10, 1044037);
AddCraft(typeof(PlateLegs), 1111704, 1025137, 68.8, 118.8, typeof(IronIngot), 1044036, 20, 1044037);
AddCraft(typeof(PlateChest), 1111704, 1046431, 75.0, 125.0, typeof(IronIngot), 1044036, 25, 1044037);
AddCraft(typeof(FemalePlateChest), 1111704, 1046430, 44.1, 94.1, typeof(IronIngot), 1044036, 20, 1044037);
if (Core.AOS) // exact pre-aos functionality unknown
{
AddCraft(typeof(DragonBardingDeed), 1111704, 1053012, 72.5, 122.5, typeof(IronIngot), 1044036, 750, 1044037);
}
if (Core.SE)
{
index = AddCraft(typeof(PlateMempo), 1111704, 1030180, 80.0, 130.0, typeof(IronIngot), 1044036, 18, 1044037);
index = AddCraft(typeof(PlateDo), 1111704, 1030184, 80.0, 130.0, typeof(IronIngot), 1044036, 28, 1044037);
//Double check skill
index = AddCraft(typeof(PlateHiroSode), 1111704, 1030187, 80.0, 130.0, typeof(IronIngot), 1044036, 16, 1044037);
index = AddCraft(typeof(PlateSuneate), 1111704, 1030195, 65.0, 115.0, typeof(IronIngot), 1044036, 20, 1044037);
index = AddCraft(typeof(PlateHaidate), 1111704, 1030200, 65.0, 115.0, typeof(IronIngot), 1044036, 20, 1044037);
}
if (Core.SA)
{
#region SA
index = AddCraft(typeof(FemaleGargishPlateArms), 1111704, 1095336, 66.3, 116.3, typeof(IronIngot), 1044036, 18, 1044037);
index = AddCraft(typeof(FemaleGargishPlateChest), 1111704, 1095338, 75.0, 125.0, typeof(IronIngot), 1044036, 25, 1044037);
index = AddCraft(typeof(FemaleGargishPlateLegs), 1111704, 1095342, 68.8, 118.8, typeof(IronIngot), 1044036, 20, 1044037);
index = AddCraft(typeof(FemaleGargishPlateKilt), 1111704, 1095340, 58.9, 108.9, typeof(IronIngot), 1044036, 12, 1044037);
index = AddCraft(typeof(GargishPlateArms), 1111704, 1095336, 66.3, 116.3, typeof(IronIngot), 1044036, 18, 1044037);
index = AddCraft(typeof(GargishPlateChest), 1111704, 1095338, 75.0, 125.0, typeof(IronIngot), 1044036, 25, 1044037);
index = AddCraft(typeof(GargishPlateLegs), 1111704, 1095342, 68.8, 118.8, typeof(IronIngot), 1044036, 20, 1044037);
index = AddCraft(typeof(GargishPlateKilt), 1111704, 1095340, 58.9, 108.9, typeof(IronIngot), 1044036, 12, 1044037);
index = AddCraft(typeof(GargishAmulet), 1111704, 1098595, 60.0, 110.0, typeof(IronIngot), 1044036, 3, 1044037);
index = AddCraft(typeof(BritchesOfWarding), 1111704, 1157345, 120.0, 120.1, typeof(IronIngot), 1044036, 18, 1044037);
AddRes(index, typeof(LeggingsOfBane), 1061100, 1, 1053098);
AddRes(index, typeof(Turquoise), 1032691, 4, 1053098);
AddRes(index, typeof(BloodOfTheDarkFather), 1157343, 5, 1053098);
AddRecipe(index, (int)SmithRecipes.BritchesOfWarding);
ForceNonExceptional(index);
#endregion
}
#endregion
#endregion
#region Helmets
AddCraft(typeof(Bascinet), 1011079, 1025132, 8.3, 58.3, typeof(IronIngot), 1044036, 15, 1044037);
AddCraft(typeof(CloseHelm), 1011079, 1025128, 37.9, 87.9, typeof(IronIngot), 1044036, 15, 1044037);
AddCraft(typeof(Helmet), 1011079, 1025130, 37.9, 87.9, typeof(IronIngot), 1044036, 15, 1044037);
AddCraft(typeof(NorseHelm), 1011079, 1025134, 37.9, 87.9, typeof(IronIngot), 1044036, 15, 1044037);
AddCraft(typeof(PlateHelm), 1011079, 1025138, 62.6, 112.6, typeof(IronIngot), 1044036, 15, 1044037);
if (Core.SE)
{
index = AddCraft(typeof(ChainHatsuburi), 1011079, 1030175, 30.0, 80.0, typeof(IronIngot), 1044036, 20, 1044037);
index = AddCraft(typeof(PlateHatsuburi), 1011079, 1030176, 45.0, 95.0, typeof(IronIngot), 1044036, 20, 1044037);
index = AddCraft(typeof(HeavyPlateJingasa), 1011079, 1030178, 45.0, 95.0, typeof(IronIngot), 1044036, 20, 1044037);
index = AddCraft(typeof(LightPlateJingasa), 1011079, 1030188, 45.0, 95.0, typeof(IronIngot), 1044036, 20, 1044037);
index = AddCraft(typeof(SmallPlateJingasa), 1011079, 1030191, 45.0, 95.0, typeof(IronIngot), 1044036, 20, 1044037);
index = AddCraft(typeof(DecorativePlateKabuto), 1011079, 1030179, 90.0, 140.0, typeof(IronIngot), 1044036, 25, 1044037);
index = AddCraft(typeof(PlateBattleKabuto), 1011079, 1030192, 90.0, 140.0, typeof(IronIngot), 1044036, 25, 1044037);
index = AddCraft(typeof(StandardPlateKabuto), 1011079, 1030196, 90.0, 140.0, typeof(IronIngot), 1044036, 25, 1044037);
if (Core.ML)
{
index = AddCraft(typeof(Circlet), 1011079, 1032645, 62.1, 112.1, typeof(IronIngot), 1044036, 6, 1044037);
index = AddCraft(typeof(RoyalCirclet), 1011079, 1032646, 70.0, 120.0, typeof(IronIngot), 1044036, 6, 1044037);
index = AddCraft(typeof(GemmedCirclet), 1011079, 1032647, 75.0, 125.0, typeof(IronIngot), 1044036, 6, 1044037);
AddRes(index, typeof(Tourmaline), 1044237, 1, 1044240);
AddRes(index, typeof(Amethyst), 1044236, 1, 1044240);
AddRes(index, typeof(BlueDiamond), 1032696, 1, 1044240);
}
}
#endregion
#region Shields
AddCraft(typeof(Buckler), 1011080, 1027027, -25.0, 25.0, typeof(IronIngot), 1044036, 10, 1044037);
AddCraft(typeof(BronzeShield), 1011080, 1027026, -15.2, 34.8, typeof(IronIngot), 1044036, 12, 1044037);
AddCraft(typeof(HeaterShield), 1011080, 1027030, 24.3, 74.3, typeof(IronIngot), 1044036, 18, 1044037);
AddCraft(typeof(MetalShield), 1011080, 1027035, -10.2, 39.8, typeof(IronIngot), 1044036, 14, 1044037);
AddCraft(typeof(MetalKiteShield), 1011080, 1027028, 4.6, 54.6, typeof(IronIngot), 1044036, 16, 1044037);
AddCraft(typeof(WoodenKiteShield), 1011080, 1027032, -15.2, 34.8, typeof(IronIngot), 1044036, 8, 1044037);
if (Core.AOS)
{
AddCraft(typeof(ChaosShield), 1011080, 1027107, 85.0, 135.0, typeof(IronIngot), 1044036, 25, 1044037);
AddCraft(typeof(OrderShield), 1011080, 1027108, 85.0, 135.0, typeof(IronIngot), 1044036, 25, 1044037);
}
if (Core.SA)
{
index = AddCraft(typeof(SmallPlateShield), 1011080, 1095770, -25.0, 25.0, typeof(IronIngot), 1044036, 12, 1044037);
index = AddCraft(typeof(GargishKiteShield), 1011080, 1095774, 4.6, 54.6, typeof(IronIngot), 1044036, 16, 1044037);
index = AddCraft(typeof(LargePlateShield), 1011080, 1095772, 24.3, 74.3, typeof(IronIngot), 1044036, 18, 1044037);
index = AddCraft(typeof(MediumPlateShield), 1011080, 1095771, -10.2, 39.8, typeof(IronIngot), 1044036, 14, 1044037);
index = AddCraft(typeof(GargishChaosShield), 1011080, 1095808, 85.0, 135.0, typeof(IronIngot), 1044036, 25, 1044037);
index = AddCraft(typeof(GargishOrderShield), 1011080, 1095810, 85.0, 135.0, typeof(IronIngot), 1044036, 25, 1044037);
}
#endregion
#region Bladed
if (Core.AOS)
{
AddCraft(typeof(BoneHarvester), 1011081, 1029915, 33.0, 83.0, typeof(IronIngot), 1044036, 10, 1044037);
}
AddCraft(typeof(Broadsword), 1011081, 1023934, 35.4, 85.4, typeof(IronIngot), 1044036, 10, 1044037);
if (Core.AOS)
{
AddCraft(typeof(CrescentBlade), 1011081, 1029921, 45.0, 95.0, typeof(IronIngot), 1044036, 14, 1044037);
}
AddCraft(typeof(Cutlass), 1011081, 1025185, 24.3, 74.3, typeof(IronIngot), 1044036, 8, 1044037);
AddCraft(typeof(Dagger), 1011081, 1023921, -0.4, 49.6, typeof(IronIngot), 1044036, 3, 1044037);
AddCraft(typeof(Katana), 1011081, 1025119, 44.1, 94.1, typeof(IronIngot), 1044036, 8, 1044037);
AddCraft(typeof(Kryss), 1011081, 1025121, 36.7, 86.7, typeof(IronIngot), 1044036, 8, 1044037);
AddCraft(typeof(Longsword), 1011081, 1023937, 28.0, 78.0, typeof(IronIngot), 1044036, 12, 1044037);
AddCraft(typeof(Scimitar), 1011081, 1025046, 31.7, 81.7, typeof(IronIngot), 1044036, 10, 1044037);
AddCraft(typeof(VikingSword), 1011081, 1025049, 24.3, 74.3, typeof(IronIngot), 1044036, 14, 1044037);
if (Core.SE)
{
index = AddCraft(typeof(NoDachi), 1011081, 1030221, 75.0, 125.0, typeof(IronIngot), 1044036, 18, 1044037);
index = AddCraft(typeof(Wakizashi), 1011081, 1030223, 50.0, 100.0, typeof(IronIngot), 1044036, 8, 1044037);
index = AddCraft(typeof(Lajatang), 1011081, 1030226, 80.0, 130.0, typeof(IronIngot), 1044036, 25, 1044037);
index = AddCraft(typeof(Daisho), 1011081, 1030228, 60.0, 110.0, typeof(IronIngot), 1044036, 15, 1044037);
index = AddCraft(typeof(Tekagi), 1011081, 1030230, 55.0, 105.0, typeof(IronIngot), 1044036, 12, 1044037);
index = AddCraft(typeof(Shuriken), 1011081, 1030231, 45.0, 95.0, typeof(IronIngot), 1044036, 5, 1044037);
index = AddCraft(typeof(Kama), 1011081, 1030232, 40.0, 90.0, typeof(IronIngot), 1044036, 14, 1044037);
index = AddCraft(typeof(Sai), 1011081, 1030234, 50.0, 100.0, typeof(IronIngot), 1044036, 12, 1044037);
if (Core.ML)
{
index = AddCraft(typeof(RadiantScimitar), 1011081, 1031571, 75.0, 125.0, typeof(IronIngot), 1044036, 15, 1044037);
index = AddCraft(typeof(WarCleaver), 1011081, 1031567, 70.0, 120.0, typeof(IronIngot), 1044036, 18, 1044037);
index = AddCraft(typeof(ElvenSpellblade), 1011081, 1031564, 70.0, 120.0, typeof(IronIngot), 1044036, 14, 1044037);
index = AddCraft(typeof(AssassinSpike), 1011081, 1031565, 70.0, 120.0, typeof(IronIngot), 1044036, 9, 1044037);
index = AddCraft(typeof(Leafblade), 1011081, 1031566, 70.0, 120.0, typeof(IronIngot), 1044036, 12, 1044037);
index = AddCraft(typeof(RuneBlade), 1011081, 1031570, 70.0, 120.0, typeof(IronIngot), 1044036, 15, 1044037);
index = AddCraft(typeof(ElvenMachete), 1011081, 1031573, 70.0, 120.0, typeof(IronIngot), 1044036, 14, 1044037);
index = AddCraft(typeof(RuneCarvingKnife), 1011081, 1072915, 70.0, 120.0, typeof(IronIngot), 1044036, 9, 1044037);
AddRes(index, typeof(DreadHornMane), 1032682, 1, 1053098);
AddRes(index, typeof(Putrefaction), 1032678, 10, 1053098);
AddRes(index, typeof(Muculent), 1032680, 10, 1053098);
AddRecipe(index, (int)SmithRecipes.RuneCarvingKnife);
ForceNonExceptional(index);
index = AddCraft(typeof(ColdForgedBlade), 1011081, 1072916, 70.0, 120.0, typeof(IronIngot), 1044036, 18, 1044037);
AddRes(index, typeof(GrizzledBones), 1032684, 1, 1053098);
AddRes(index, typeof(Taint), 1032684, 10, 1053098);
AddRes(index, typeof(Blight), 1032675, 10, 1053098);
AddRecipe(index, (int)SmithRecipes.ColdForgedBlade);
ForceNonExceptional(index);
index = AddCraft(typeof(OverseerSunderedBlade), 1011081, 1072920, 70.0, 120.0, typeof(IronIngot), 1044036, 15, 1044037);
AddRes(index, typeof(GrizzledBones), 1032684, 1, 1053098);
AddRes(index, typeof(Blight), 1032675, 10, 1053098);
AddRes(index, typeof(Scourge), 1032677, 10, 1053098);
AddRecipe(index, (int)SmithRecipes.OverseerSunderedBlade);
ForceNonExceptional(index);
index = AddCraft(typeof(LuminousRuneBlade), 1011081, 1072922, 70.0, 120.0, typeof(IronIngot), 1044036, 15, 1044037);
AddRes(index, typeof(GrizzledBones), 1032684, 1, 1053098);
AddRes(index, typeof(Corruption), 1032676, 10, 1053098);
AddRes(index, typeof(Putrefaction), 1032678, 10, 1053098);
AddRecipe(index, (int)SmithRecipes.LuminousRuneBlade);
ForceNonExceptional(index);
index = AddCraft(typeof(TrueSpellblade), 1011081, 1073513, 75.0, 125.0, typeof(IronIngot), 1044036, 14, 1044037);
AddRes(index, typeof(BlueDiamond), 1032696, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.TrueSpellblade);
index = AddCraft(typeof(IcySpellblade), 1011081, 1073514, 75.0, 125.0, typeof(IronIngot), 1044036, 14, 1044037);
AddRes(index, typeof(Turquoise), 1032691, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.IcySpellblade);
index = AddCraft(typeof(FierySpellblade), 1011081, 1073515, 75.0, 125.0, typeof(IronIngot), 1044036, 14, 1044037);
AddRes(index, typeof(FireRuby), 1032695, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.FierySpellblade);
index = AddCraft(typeof(SpellbladeOfDefense), 1011081, 1073516, 75.0, 125.0, typeof(IronIngot), 1044036, 18, 1044037);
AddRes(index, typeof(WhitePearl), 1032694, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.SpellbladeOfDefense);
index = AddCraft(typeof(TrueAssassinSpike), 1011081, 1073517, 75.0, 125.0, typeof(IronIngot), 1044036, 9, 1044037);
AddRes(index, typeof(DarkSapphire), 1032690, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.TrueAssassinSpike);
index = AddCraft(typeof(ChargedAssassinSpike), 1011081, 1073518, 75.0, 125.0, typeof(IronIngot), 1044036, 9, 1044037);
AddRes(index, typeof(EcruCitrine), 1032693, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.ChargedAssassinSpike);
index = AddCraft(typeof(MagekillerAssassinSpike), 1011081, 1073519, 75.0, 125.0, typeof(IronIngot), 1044036, 9, 1044037);
AddRes(index, typeof(BrilliantAmber), 1032697, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.MagekillerAssassinSpike);
index = AddCraft(typeof(WoundingAssassinSpike), 1011081, 1073520, 75.0, 125.0, typeof(IronIngot), 1044036, 9, 1044037);
AddRes(index, typeof(PerfectEmerald), 1032692, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.WoundingAssassinSpike);
index = AddCraft(typeof(TrueLeafblade), 1011081, 1073521, 75.0, 125.0, typeof(IronIngot), 1044036, 12, 1044037);
AddRes(index, typeof(BlueDiamond), 1032696, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.TrueLeafblade);
index = AddCraft(typeof(Luckblade), 1011081, 1073522, 75.0, 125.0, typeof(IronIngot), 1044036, 12, 1044037);
AddRes(index, typeof(WhitePearl), 1032694, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.Luckblade);
index = AddCraft(typeof(MagekillerLeafblade), 1011081, 1073523, 75.0, 125.0, typeof(IronIngot), 1044036, 12, 1044037);
AddRes(index, typeof(FireRuby), 1032695, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.MagekillerLeafblade);
index = AddCraft(typeof(LeafbladeOfEase), 1011081, 1073524, 75.0, 125.0, typeof(IronIngot), 1044036, 12, 1044037);
AddRes(index, typeof(PerfectEmerald), 1032692, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.LeafbladeOfEase);
index = AddCraft(typeof(KnightsWarCleaver), 1011081, 1073525, 75.0, 125.0, typeof(IronIngot), 1044036, 18, 1044037);
AddRes(index, typeof(PerfectEmerald), 1032692, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.KnightsWarCleaver);
index = AddCraft(typeof(ButchersWarCleaver), 1011081, 1073526, 75.0, 125.0, typeof(IronIngot), 1044036, 18, 1044037);
AddRes(index, typeof(Turquoise), 1032691, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.ButchersWarCleaver);
index = AddCraft(typeof(SerratedWarCleaver), 1011081, 1073527, 75.0, 125.0, typeof(IronIngot), 1044036, 18, 1044037);
AddRes(index, typeof(EcruCitrine), 1032693, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.SerratedWarCleaver);
index = AddCraft(typeof(TrueWarCleaver), 1011081, 1073528, 75.0, 125.0, typeof(IronIngot), 1044036, 18, 1044037);
AddRes(index, typeof(BrilliantAmber), 1032697, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.TrueWarCleaver);
index = AddCraft(typeof(AdventurersMachete), 1011081, 1073533, 75.0, 125.0, typeof(IronIngot), 1044036, 14, 1044037);
AddRes(index, typeof(WhitePearl), 1032694, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.AdventurersMachete);
index = AddCraft(typeof(OrcishMachete), 1011081, 1073534, 75.0, 125.0, typeof(IronIngot), 1044036, 14, 1044037);
AddRes(index, typeof(Scourge), 1072136, 1, 1042081);
AddRecipe(index, (int)SmithRecipes.OrcishMachete);
index = AddCraft(typeof(MacheteOfDefense), 1011081, 1073535, 75.0, 125.0, typeof(IronIngot), 1044036, 14, 1044037);
AddRes(index, typeof(BrilliantAmber), 1032697, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.MacheteOfDefense);
index = AddCraft(typeof(DiseasedMachete), 1011081, 1073536, 75.0, 125.0, typeof(IronIngot), 1044036, 14, 1044037);
AddRes(index, typeof(Blight), 1072134, 1, 1042081);
AddRecipe(index, (int)SmithRecipes.DiseasedMachete);
index = AddCraft(typeof(Runesabre), 1011081, 1073537, 75.0, 125.0, typeof(IronIngot), 1044036, 15, 1044037);
AddRes(index, typeof(Turquoise), 1032691, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.Runesabre);
index = AddCraft(typeof(MagesRuneBlade), 1011081, 1073538, 75.0, 125.0, typeof(IronIngot), 1044036, 15, 1044037);
AddRes(index, typeof(BlueDiamond), 1032696, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.MagesRuneBlade);
index = AddCraft(typeof(RuneBladeOfKnowledge), 1011081, 1073539, 75.0, 125.0, typeof(IronIngot), 1044036, 15, 1044037);
AddRes(index, typeof(EcruCitrine), 1032693, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.RuneBladeOfKnowledge);
index = AddCraft(typeof(CorruptedRuneBlade), 1011081, 1073540, 75.0, 125.0, typeof(IronIngot), 1044036, 15, 1044037);
AddRes(index, typeof(Corruption), 1072135, 1, 1042081);
AddRecipe(index, (int)SmithRecipes.CorruptedRuneBlade);
index = AddCraft(typeof(TrueRadiantScimitar), 1011081, 1073541, 75.0, 125.0, typeof(IronIngot), 1044036, 15, 1044037);
AddRes(index, typeof(BrilliantAmber), 1032697, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.TrueRadiantScimitar);
index = AddCraft(typeof(DarkglowScimitar), 1011081, 1073542, 75.0, 125.0, typeof(IronIngot), 1044036, 15, 1044037);
AddRes(index, typeof(DarkSapphire), 1032690, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.DarkglowScimitar);
index = AddCraft(typeof(IcyScimitar), 1011081, 1073543, 75.0, 125.0, typeof(IronIngot), 1044036, 15, 1044037);
AddRes(index, typeof(DarkSapphire), 1032690, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.IcyScimitar);
index = AddCraft(typeof(TwinklingScimitar), 1011081, 1073544, 75.0, 125.0, typeof(IronIngot), 1044036, 15, 1044037);
AddRes(index, typeof(DarkSapphire), 1032690, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.TwinklingScimitar);
index = AddCraft(typeof(BoneMachete), 1011081, 1020526, 45.0, 95.0, typeof(IronIngot), 1044036, 20, 1044037);
AddRes(index, typeof(Bone), 1049064, 6, 1049063);
AddRecipe(index, (int)SmithRecipes.BoneMachete);
}
}
if (Core.SA)
{
#region SA
index = AddCraft(typeof(GargishKatana), 1011081, 1097490, 44.1, 94.1, typeof(IronIngot), 1044036, 8, 1044037);
index = AddCraft(typeof(GargishKryss), 1011081, 1097492, 36.7, 86.7, typeof(IronIngot), 1044036, 8, 1044037);
index = AddCraft(typeof(GargishBoneHarvester), 1011081, 1097502, 33.0, 83.0, typeof(IronIngot), 1044036, 10, 1044037);
index = AddCraft(typeof(GargishTekagi), 1011081, 1097510, 55.0, 105.0, typeof(IronIngot), 1044036, 12, 1044037);
index = AddCraft(typeof(GargishDaisho), 1011081, 1097512, 60.0, 110.0, typeof(IronIngot), 1044036, 15, 1044037);
index = AddCraft(typeof(DreadSword), 1011081, 1095372, 75.0, 125.0, typeof(IronIngot), 1044036, 14, 1044037);
index = AddCraft(typeof(GargishTalwar), 1011081, 1095373, 75.0, 150.0, typeof(IronIngot), 1044036, 18, 1044037);
index = AddCraft(typeof(GargishDagger), 1011081, 1095362, 0.0, 100.0, typeof(IronIngot), 1044036, 3, 1044037);
index = AddCraft(typeof(BloodBlade), 1011081, 1095370, 44.1, 125.0, typeof(IronIngot), 1044036, 8, 1044037);
index = AddCraft(typeof(Shortblade), 1011081, 1095374, 28.0, 100.0, typeof(IronIngot), 1044036, 12, 1044037);
#endregion
}
#endregion
#region Axes
AddCraft(typeof(Axe), 1011082, 1023913, 34.2, 84.2, typeof(IronIngot), 1044036, 14, 1044037);
AddCraft(typeof(BattleAxe), 1011082, 1023911, 30.5, 80.5, typeof(IronIngot), 1044036, 14, 1044037);
AddCraft(typeof(DoubleAxe), 1011082, 1023915, 29.3, 79.3, typeof(IronIngot), 1044036, 12, 1044037);
AddCraft(typeof(ExecutionersAxe), 1011082, 1023909, 34.2, 84.2, typeof(IronIngot), 1044036, 14, 1044037);
AddCraft(typeof(LargeBattleAxe), 1011082, 1025115, 28.0, 78.0, typeof(IronIngot), 1044036, 12, 1044037);
AddCraft(typeof(TwoHandedAxe), 1011082, 1025187, 33.0, 83.0, typeof(IronIngot), 1044036, 16, 1044037);
AddCraft(typeof(WarAxe), 1011082, 1025040, 39.1, 89.1, typeof(IronIngot), 1044036, 16, 1044037);
if (Core.ML)
{
index = AddCraft(typeof(OrnateAxe), 1011082, 1031572, 70.0, 120.0, typeof(IronIngot), 1044036, 18, 1044037);
index = AddCraft(typeof(GuardianAxe), 1011082, 1073545, 75.0, 125.0, typeof(IronIngot), 1044036, 15, 1044037);
AddRes(index, typeof(BlueDiamond), 1032696, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.GuardianAxe);
index = AddCraft(typeof(SingingAxe), 1011082, 1073546, 75.0, 125.0, typeof(IronIngot), 1044036, 15, 1044037);
AddRes(index, typeof(BrilliantAmber), 1032697, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.SingingAxe);
index = AddCraft(typeof(ThunderingAxe), 1011082, 1073547, 75.0, 125.0, typeof(IronIngot), 1044036, 15, 1044037);
AddRes(index, typeof(EcruCitrine), 1032693, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.ThunderingAxe);
index = AddCraft(typeof(HeavyOrnateAxe), 1011082, 1073548, 75.0, 125.0, typeof(IronIngot), 1044036, 15, 1044037);
AddRes(index, typeof(Turquoise), 1032691, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.HeavyOrnateAxe);
}
#region SA
if (Core.SA)
{
index = AddCraft(typeof(GargishBattleAxe), 1011082, 1097480, 30.5, 80.5, typeof(IronIngot), 1044036, 14, 1044037);
index = AddCraft(typeof(GargishAxe), 1011082, 1097482, 34.2, 84.2, typeof(IronIngot), 1044036, 14, 1044037);
index = AddCraft(typeof(DualShortAxes), 1011082, 1095360, 75.0, 125.0, typeof(IronIngot), 1044036, 24, 1044037);
}
#endregion
#endregion
#region Pole Arms
AddCraft(typeof(Bardiche), 1011083, 1023917, 31.7, 81.7, typeof(IronIngot), 1044036, 18, 1044037);
if (Core.AOS)
{
AddCraft(typeof(BladedStaff), 1011083, 1029917, 40.0, 90.0, typeof(IronIngot), 1044036, 12, 1044037);
}
if (Core.AOS)
{
AddCraft(typeof(DoubleBladedStaff), 1011083, 1029919, 45.0, 95.0, typeof(IronIngot), 1044036, 16, 1044037);
}
AddCraft(typeof(Halberd), 1011083, 1025183, 39.1, 89.1, typeof(IronIngot), 1044036, 20, 1044037);
if (Core.AOS)
{
AddCraft(typeof(Lance), 1011083, 1029920, 48.0, 98.0, typeof(IronIngot), 1044036, 20, 1044037);
}
if (Core.AOS)
{
AddCraft(typeof(Pike), 1011083, 1029918, 47.0, 97.0, typeof(IronIngot), 1044036, 12, 1044037);
}
AddCraft(typeof(ShortSpear), 1011083, 1025123, 45.3, 95.3, typeof(IronIngot), 1044036, 6, 1044037);
if (Core.AOS)
{
AddCraft(typeof(Scythe), 1011083, 1029914, 39.0, 89.0, typeof(IronIngot), 1044036, 14, 1044037);
}
AddCraft(typeof(Spear), 1011083, 1023938, 49.0, 99.0, typeof(IronIngot), 1044036, 12, 1044037);
AddCraft(typeof(WarFork), 1011083, 1025125, 42.9, 92.9, typeof(IronIngot), 1044036, 12, 1044037);
#region SA
if (Core.SA)
{
index = AddCraft(typeof(GargishBardiche), 1011083, 1097484, 31.7, 81.7, typeof(IronIngot), 1044036, 18, 1044037);
index = AddCraft(typeof(GargishWarFork), 1011083, 1097494, 42.9, 92.9, typeof(IronIngot), 1044036, 12, 1044037);
index = AddCraft(typeof(GargishScythe), 1011083, 1097500, 39.0, 89.0, typeof(IronIngot), 1044036, 14, 1044037);
index = AddCraft(typeof(GargishPike), 1011083, 1097504, 47.0, 97.0, typeof(IronIngot), 1044036, 12, 1044037);
index = AddCraft(typeof(GargishLance), 1011083, 1097506, 48.0, 98.0, typeof(IronIngot), 1044036, 20, 1044037);
index = AddCraft(typeof(DualPointedSpear), 1011083, 1095365, 47.0, 97.0, typeof(IronIngot), 1044036, 16, 1044037);
}
#endregion
#endregion
#region Bashing
AddCraft(typeof(HammerPick), 1011084, 1025181, 34.2, 84.2, typeof(IronIngot), 1044036, 16, 1044037);
AddCraft(typeof(Mace), 1011084, 1023932, 14.5, 64.5, typeof(IronIngot), 1044036, 6, 1044037);
AddCraft(typeof(Maul), 1011084, 1025179, 19.4, 69.4, typeof(IronIngot), 1044036, 10, 1044037);
if (Core.AOS)
{
AddCraft(typeof(Scepter), 1011084, 1029916, 21.4, 71.4, typeof(IronIngot), 1044036, 10, 1044037);
}
AddCraft(typeof(WarMace), 1011084, 1025127, 28.0, 78.0, typeof(IronIngot), 1044036, 14, 1044037);
AddCraft(typeof(WarHammer), 1011084, 1025177, 34.2, 84.2, typeof(IronIngot), 1044036, 16, 1044037);
if (Core.SE)
{
index = AddCraft(typeof(Tessen), 1011084, 1030222, 85.0, 135.0, typeof(IronIngot), 1044036, 16, 1044037);
AddSkill(index, SkillName.Tailoring, 50.0, 55.0);
AddRes(index, typeof(Cloth), 1044286, 10, 1044287);
}
#region Mondain's Legacy
if (Core.ML)
{
index = AddCraft(typeof(DiamondMace), 1011084, 1031568, 70.0, 120.0, typeof(IronIngot), 1044036, 20, 1044037);
index = AddCraft(typeof(ShardThrasher), 1011084, 1072918, 70.0, 120.0, typeof(IronIngot), 1044036, 20, 1044037);
AddRes(index, typeof(EyeOfTheTravesty), 1073126, 1, 1042081);
AddRes(index, typeof(Muculent), 1072139, 10, 1042081);
AddRes(index, typeof(Corruption), 1072135, 10, 1042081);
AddRecipe(index, (int)SmithRecipes.ShardTrasher);
ForceNonExceptional(index);
index = AddCraft(typeof(RubyMace), 1011084, 1073529, 75.0, 125.0, typeof(IronIngot), 1044036, 20, 1044037);
AddRes(index, typeof(FireRuby), 1032695, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.RubyMace);
index = AddCraft(typeof(EmeraldMace), 1011084, 1073530, 75.0, 125.0, typeof(IronIngot), 1044036, 20, 1044037);
AddRes(index, typeof(PerfectEmerald), 1032692, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.EmeraldMace);
index = AddCraft(typeof(SapphireMace), 1011084, 1073531, 75.0, 125.0, typeof(IronIngot), 1044036, 20, 1044037);
AddRes(index, typeof(DarkSapphire), 1032690, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.SapphireMace);
index = AddCraft(typeof(SilverEtchedMace), 1011084, 1073532, 75.0, 125.0, typeof(IronIngot), 1044036, 20, 1044037);
AddRes(index, typeof(BlueDiamond), 1032696, 1, 1044240);
AddRecipe(index, (int)SmithRecipes.SilverEtchedMace);
}
#endregion
#region Stygian Abyss
if (Core.SA)
{
index = AddCraft(typeof(GargishWarHammer), 1011084, 1097496, 34.2, 84.2, typeof(IronIngot), 1044036, 16, 1044037);
index = AddCraft(typeof(GargishMaul), 1011084, 1097498, 19.4, 69.4, typeof(IronIngot), 1044036, 10, 1044037);
index = AddCraft(typeof(GargishTessen), 1011084, 1097508, 85.0, 135.0, typeof(IronIngot), 1044036, 16, 1044037);
AddSkill(index, SkillName.Tailoring, 50.0, 55.0);
AddRes(index, typeof(Cloth), 1044286, 10, 1044287);
index = AddCraft(typeof(DiscMace), 1011084, 1095366, 70.0, 120.0, typeof(IronIngot), 1044036, 20, 1044037);
}
#endregion
#endregion
#region High Seas Cannons
if (Core.HS)
{
if (Core.EJ)
{
index = AddCraft(typeof(Cannonball), 1116354, 1116029, 10.0, 60.0, typeof(IronIngot), 1044036, 12, 1044037);
SetUseAllRes(index, true);
}
else
{
AddCraft(typeof(LightCannonball), 1116354, 1116266, 0.0, 50.0, typeof(IronIngot), 1044036, 6, 1044037);
AddCraft(typeof(HeavyCannonball), 1116354, 1116267, 10.0, 60.0, typeof(IronIngot), 1044036, 12, 1044037);
}
if (Core.EJ)
{
index = AddCraft(typeof(Grapeshot), 1116354, 1116030, 15.0, 70.0, typeof(IronIngot), 1044036, 12, 1044037);
AddRes(index, typeof(Cloth), 1044286, 2, 1044287);
SetUseAllRes(index, true);
}
else
{
index = AddCraft(typeof(LightGrapeshot), 1116354, 1116030, 0.0, 50.0, typeof(IronIngot), 1044036, 6, 1044037);
AddRes(index, typeof(Cloth), 1044286, 1, 1044287);
index = AddCraft(typeof(HeavyGrapeshot), 1116354, 1116166, 15.0, 70.0, typeof(IronIngot), 1044036, 12, 1044037);
AddRes(index, typeof(Cloth), 1044286, 2, 1044287);
}
index = AddCraft(typeof(LightShipCannonDeed), 1116354, 1095790, 65.0, 120.0, typeof(IronIngot), 1044036, 900, 1044037);
AddRes(index, typeof(Board), 1044041, 50, 1044351);
AddSkill(index, SkillName.Carpentry, 65.0, 100.0);
index = AddCraft(typeof(HeavyShipCannonDeed), 1116354, 1095794, 70.0, 120.0, typeof(IronIngot), 1044036, 1800, 1044037);
AddRes(index, typeof(Board), 1044041, 75, 1044351);
AddSkill(index, SkillName.Carpentry, 70.0, 100.0);
}
#endregion
#region Throwing
if (Core.SA)
{
index = AddCraft(typeof(Boomerang), 1079508, 1095359, 75.0, 125.0, typeof(IronIngot), 1044036, 5, 1044037);
index = AddCraft(typeof(Cyclone), 1079508, 1095364, 75.0, 125.0, typeof(IronIngot), 1044036, 9, 1044037);
index = AddCraft(typeof(SoulGlaive), 1079508, 1095363, 75.0, 125.0, typeof(IronIngot), 1044036, 9, 1044037);
}
#endregion
#region Miscellaneous
index = AddCraft(typeof(DragonGloves), 1011173, 1029795, 68.9, 118.9, typeof(RedScales), 1060883, 16, 1060884);
SetUseSubRes2(index, true);
index = AddCraft(typeof(DragonHelm), 1011173, 1029797, 72.6, 122.6, typeof(RedScales), 1060883, 20, 1060884);
SetUseSubRes2(index, true);
index = AddCraft(typeof(DragonLegs), 1011173, 1029799, 78.8, 128.8, typeof(RedScales), 1060883, 28, 1060884);
SetUseSubRes2(index, true);
index = AddCraft(typeof(DragonArms), 1011173, 1029815, 76.3, 126.3, typeof(RedScales), 1060883, 24, 1060884);
SetUseSubRes2(index, true);
index = AddCraft(typeof(DragonChest), 1011173, 1029793, 85.0, 135.0, typeof(RedScales), 1060883, 36, 1060884);
SetUseSubRes2(index, true);
if (Core.SA)
{
index = AddCraft(typeof(CrushedGlass), 1011173, 1113351, 110.0, 135.0, typeof(BlueDiamond), 1032696, 1, 1044253);
AddRes(index, typeof(GlassSword), 1095371, 5, 1044253);
index = AddCraft(typeof(PowderedIron), 1011173, 1113353, 110.0, 135.0, typeof(WhitePearl), 1026253, 1, 1044253);
AddRes(index, typeof(IronIngot), 1044036, 20, 1044037);
}
AddCraft(typeof(MetalKeg), 1011173, 1150675, 85.0, 100.0, typeof(IronIngot), 1044036, 25, 1044253);
if (Core.SA)
{
index = AddCraft(typeof(ExodusSacrificalDagger), 1011173, 1153500, 95.0, 120.0, typeof(IronIngot), 1044036, 12, 1044253);
AddRes(index, typeof(BlueDiamond), 1032696, 2, 1044253);
AddRes(index, typeof(FireRuby), 1032695, 2, 1044253);
AddRes(index, typeof(SmallPieceofBlackrock), 1150016, 10, 1044253);
ForceNonExceptional(index);
index = AddCraft(typeof(GlovesOfFeudalGrip), 1011173, 1157349, 120.0, 120.1, typeof(RedScales), 1060883, 18, 1060884);
SetUseSubRes2(index, true);
AddRes(index, typeof(BlueDiamond), 1032696, 4, 1044253);
AddRes(index, typeof(GauntletsOfNobility), 1061092, 1, 1053098);
AddRes(index, typeof(BloodOfTheDarkFather), 1157343, 5, 1053098);
AddRecipe(index, (int)SmithRecipes.GlovesOfFeudalGrip);
ForceNonExceptional(index);
}
#endregion
// Set the overridable material
SetSubRes(typeof(IronIngot), 1044022);
// Add every material you want the player to be able to choose from
// This will override the overridable material
AddSubRes(typeof(IronIngot), 1044022, 00.0, 1044036, 1044267);
AddSubRes(typeof(DullCopperIngot), 1044023, 65.0, 1044036, 1044268);
AddSubRes(typeof(ShadowIronIngot), 1044024, 70.0, 1044036, 1044268);
AddSubRes(typeof(CopperIngot), 1044025, 75.0, 1044036, 1044268);
AddSubRes(typeof(BronzeIngot), 1044026, 80.0, 1044036, 1044268);
AddSubRes(typeof(GoldIngot), 1044027, 85.0, 1044036, 1044268);
AddSubRes(typeof(AgapiteIngot), 1044028, 90.0, 1044036, 1044268);
AddSubRes(typeof(VeriteIngot), 1044029, 95.0, 1044036, 1044268);
AddSubRes(typeof(ValoriteIngot), 1044030, 99.0, 1044036, 1044268);
SetSubRes2(typeof(RedScales), 1060875);
AddSubRes2(typeof(RedScales), 1060875, 0.0, 1053137, 1044268);
AddSubRes2(typeof(YellowScales), 1060876, 0.0, 1053137, 1044268);
AddSubRes2(typeof(BlackScales), 1060877, 0.0, 1053137, 1044268);
AddSubRes2(typeof(GreenScales), 1060878, 0.0, 1053137, 1044268);
AddSubRes2(typeof(WhiteScales), 1060879, 0.0, 1053137, 1044268);
AddSubRes2(typeof(BlueScales), 1060880, 0.0, 1053137, 1044268);
Resmelt = true;
Repair = true;
MarkOption = true;
CanEnhance = Core.AOS;
CanAlter = Core.SA;
}
}
public class ForgeAttribute : Attribute
{ }
public class AnvilAttribute : Attribute
{ }
}

View File

@@ -0,0 +1,263 @@
using System;
using Server.Items;
namespace Server.Engines.Craft
{
#region Mondain's Legacy
public enum BowRecipes
{
//magical
BarbedLongbow = 200,
SlayerLongbow = 201,
FrozenLongbow = 202,
LongbowOfMight = 203,
RangersShortbow = 204,
LightweightShortbow = 205,
MysticalShortbow = 206,
AssassinsShortbow = 207,
// arties
BlightGrippedLongbow = 250,
FaerieFire = 251,
SilvanisFeywoodBow = 252,
MischiefMaker = 253,
TheNightReaper = 254,
}
#endregion
public class DefBowFletching : CraftSystem
{
public override SkillName MainSkill
{
get
{
return SkillName.Fletching;
}
}
public override int GumpTitleNumber
{
get
{
return 1044006;
}// <CENTER>BOWCRAFT AND FLETCHING MENU</CENTER>
}
private static CraftSystem m_CraftSystem;
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefBowFletching();
return m_CraftSystem;
}
}
public override double GetChanceAtMin(CraftItem item)
{
return 0.5; // 50%
}
private DefBowFletching()
: base(1, 1, 1.25)// base( 1, 2, 1.7 )
{
}
public override int CanCraft(Mobile from, ITool tool, Type itemType)
{
int num = 0;
if (tool == null || tool.Deleted || tool.UsesRemaining <= 0)
return 1044038; // You have worn out your tool!
else if (!tool.CheckAccessible(from, ref num))
return num; // The tool must be on your person to use.
return 0;
}
public override void PlayCraftEffect(Mobile from)
{
// no animation
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
// from.Animate( 33, 5, 1, true, false, 0 );
from.PlaySound(0x55);
}
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
else
return 1044157; // You failed to create the item, but no materials were lost.
}
else
{
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
else if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
else if (quality == 2)
return 1044155; // You create an exceptional quality item.
else
return 1044154; // You create the item.
}
}
public override CraftECA ECA
{
get
{
return CraftECA.FiftyPercentChanceMinusTenPercent;
}
}
public override void InitCraftList()
{
int index = -1;
// Materials
if (Core.SA)
{
index = AddCraft(typeof(ElvenFletching), 1044457, 1113346, 90.0, 130.0, typeof(Feather), 1044562, 20, 1044563);
AddRes(index, typeof(FaeryDust), 1113358, 1, 1044253);
}
this.AddCraft(typeof(Kindling), 1044457, 1023553, 0.0, 00.0, typeof(Board), 1044041, 1, 1044351);
index = this.AddCraft(typeof(Shaft), 1044457, 1027124, 0.0, 40.0, typeof(Board), 1044041, 1, 1044351);
this.SetUseAllRes(index, true);
// Ammunition
index = this.AddCraft(typeof(Arrow), 1044565, 1023903, 0.0, 40.0, typeof(Shaft), 1044560, 1, 1044561);
this.AddRes(index, typeof(Feather), 1044562, 1, 1044563);
this.SetUseAllRes(index, true);
index = this.AddCraft(typeof(Bolt), 1044565, 1027163, 0.0, 40.0, typeof(Shaft), 1044560, 1, 1044561);
this.AddRes(index, typeof(Feather), 1044562, 1, 1044563);
this.SetUseAllRes(index, true);
if (Core.SE)
{
index = AddCraft(typeof(FukiyaDarts), 1044565, 1030246, 50.0, 73.8, typeof(Board), 1044041, 1, 1044351);
this.SetUseAllRes(index, true);
}
// Weapons
this.AddCraft(typeof(Bow), 1044566, 1025042, 30.0, 70.0, typeof(Board), 1044041, 7, 1044351);
this.AddCraft(typeof(Crossbow), 1044566, 1023919, 60.0, 100.0, typeof(Board), 1044041, 7, 1044351);
this.AddCraft(typeof(HeavyCrossbow), 1044566, 1025117, 80.0, 120.0, typeof(Board), 1044041, 10, 1044351);
if (Core.AOS)
{
this.AddCraft(typeof(CompositeBow), 1044566, 1029922, 70.0, 110.0, typeof(Board), 1044041, 7, 1044351);
this.AddCraft(typeof(RepeatingCrossbow), 1044566, 1029923, 90.0, 130.0, typeof(Board), 1044041, 10, 1044351);
}
if (Core.SE)
{
index = AddCraft(typeof(Yumi), 1044566, 1030224, 90.0, 130.0, typeof(Board), 1044041, 10, 1044351);
}
#region Mondain's Legacy
if (Core.ML)
{
index = AddCraft(typeof(ElvenCompositeLongbow), 1044566, 1031562, 95.0, 145.0, typeof(Board), 1044041, 20, 1044351);
index = AddCraft(typeof(MagicalShortbow), 1044566, 1031551, 85.0, 135.0, typeof(Board), 1044041, 15, 1044351);
index = AddCraft(typeof(BlightGrippedLongbow), 1044566, 1072907, 75.0, 125.0, typeof(Board), 1044041, 20, 1044351);
AddRes(index, typeof(LardOfParoxysmus), 1032681, 1, 1053098);
AddRes(index, typeof(Blight), 1032675, 10, 1053098);
AddRes(index, typeof(Corruption), 1032676, 10, 1053098);
AddRecipe(index, (int)BowRecipes.BlightGrippedLongbow);
ForceNonExceptional(index);
index = AddCraft(typeof(FaerieFire), 1044566, 1072908, 75.0, 125.0, typeof(Board), 1044041, 20, 1044351);
AddRes(index, typeof(LardOfParoxysmus), 1032681, 1, 1053098);
AddRes(index, typeof(Putrefaction), 1032678, 10, 1053098);
AddRes(index, typeof(Taint), 1032679, 10, 1053098);
AddRecipe(index, (int)BowRecipes.FaerieFire);
ForceNonExceptional(index);
index = AddCraft(typeof(SilvanisFeywoodBow), 1044566, 1072955, 75.0, 125.0, typeof(Board), 1044041, 20, 1044351);
AddRes(index, typeof(LardOfParoxysmus), 1032681, 1, 1053098);
AddRes(index, typeof(Scourge), 1032677, 10, 1053098);
AddRes(index, typeof(Muculent), 1032680, 10, 1053098);
AddRecipe(index, (int)BowRecipes.SilvanisFeywoodBow);
ForceNonExceptional(index);
index = AddCraft(typeof(MischiefMaker), 1044566, 1072910, 75.0, 125.0, typeof(Board), 1044041, 15, 1044351);
AddRes(index, typeof(DreadHornMane), 1032682, 1, 1053098);
AddRes(index, typeof(Corruption), 1032676, 10, 1053098);
AddRes(index, typeof(Putrefaction), 1032678, 10, 1053098);
AddRecipe(index, (int)BowRecipes.MischiefMaker);
ForceNonExceptional(index);
index = AddCraft(typeof(TheNightReaper), 1044566, 1072912, 75.0, 125.0, typeof(Board), 1044041, 10, 1044351);
AddRes(index, typeof(DreadHornMane), 1032682, 1, 1053098);
AddRes(index, typeof(Blight), 1032675, 10, 1053098);
AddRes(index, typeof(Scourge), 1032677, 10, 1053098);
AddRecipe(index, (int)BowRecipes.TheNightReaper);
ForceNonExceptional(index);
index = AddCraft(typeof(BarbedLongbow), 1044566, 1073505, 75.0, 125.0, typeof(Board), 1044041, 20, 1044351);
AddRes(index, typeof(FireRuby), 1026254, 1, 1053098);
AddRecipe(index, (int)BowRecipes.BarbedLongbow);
index = AddCraft(typeof(SlayerLongbow), 1044566, 1073506, 75.0, 125.0, typeof(Board), 1044041, 20, 1044351);
AddRes(index, typeof(BrilliantAmber), 1026256, 1, 1053098);
AddRecipe(index, (int)BowRecipes.SlayerLongbow);
index = AddCraft(typeof(FrozenLongbow), 1044566, 1073507, 75.0, 125.0, typeof(Board), 1044041, 20, 1044351);
AddRes(index, typeof(Turquoise), 1026250, 1, 1053098);
AddRecipe(index, (int)BowRecipes.FrozenLongbow);
index = AddCraft(typeof(LongbowOfMight), 1044566, 1073508, 75.0, 125.0, typeof(Board), 1044041, 10, 1044351);
AddRes(index, typeof(BlueDiamond), 1026255, 1, 1053098);
AddRecipe(index, (int)BowRecipes.LongbowOfMight);
index = AddCraft(typeof(RangersShortbow), 1044566, 1073509, 75.0, 125.0, typeof(Board), 1044041, 15, 1044351);
AddRes(index, typeof(PerfectEmerald), 1026251, 1, 1053098);
AddRecipe(index, (int)BowRecipes.RangersShortbow);
index = AddCraft(typeof(LightweightShortbow), 1044566, 1073510, 75.0, 125.0, typeof(Board), 1044041, 15, 1044351);
AddRes(index, typeof(WhitePearl), 1026253, 1, 1053098);
AddRecipe(index, (int)BowRecipes.LightweightShortbow);
index = AddCraft(typeof(MysticalShortbow), 1044566, 1073511, 75.0, 125.0, typeof(Board), 1044041, 15, 1044351);
AddRes(index, typeof(EcruCitrine), 1026252, 1, 1053098);
AddRecipe(index, (int)BowRecipes.MysticalShortbow);
index = AddCraft(typeof(AssassinsShortbow), 1044566, 1073512, 75.0, 125.0, typeof(Board), 1044041, 15, 1044351);
AddRes(index, typeof(DarkSapphire), 1026249, 1, 1053098);
AddRecipe(index, (int)BowRecipes.AssassinsShortbow);
}
this.SetSubRes(typeof(Board), 1072643);
// Add every material you want the player to be able to choose from
// This will override the overridable material TODO: Verify the required skill amount
this.AddSubRes(typeof(Board), 1072643, 00.0, 1044041, 1072652);
this.AddSubRes(typeof(OakBoard), 1072644, 65.0, 1044041, 1072652);
this.AddSubRes(typeof(AshBoard), 1072645, 75.0, 1044041, 1072652);
this.AddSubRes(typeof(YewBoard), 1072646, 85.0, 1044041, 1072652);
this.AddSubRes(typeof(HeartwoodBoard), 1072647, 95.0, 1044041, 1072652);
this.AddSubRes(typeof(BloodwoodBoard), 1072648, 95.0, 1044041, 1072652);
this.AddSubRes(typeof(FrostwoodBoard), 1072649, 95.0, 1044041, 1072652);
#endregion
this.MarkOption = true;
this.Repair = Core.AOS;
this.CanEnhance = Core.ML;
}
}
}

View File

@@ -0,0 +1,995 @@
using System;
using Server.Items;
namespace Server.Engines.Craft
{
#region Mondain's Legacy
public enum CarpRecipes
{
// stuff
WarriorStatueSouth = 100,
WarriorStatueEast = 101,
SquirrelStatueSouth = 102,
SquirrelStatueEast = 103,
AcidProofRope = 104,
OrnateElvenChair = 105,
ArcaneBookshelfSouth = 106,
ArcaneBookshelfEast = 107,
OrnateElvenChestSouth = 108,
ElvenDresserSouth = 109,
ElvenDresserEast = 110,
FancyElvenArmoire = 111,
ArcanistsWildStaff = 112,
AncientWildStaff = 113,
ThornedWildStaff = 114,
HardenedWildStaff = 115,
TallElvenBedSouth = 116,
TallElvenBedEast = 117,
StoneAnvilSouth = 118,
StoneAnvilEast = 119,
OrnateElvenChestEast = 120,
// arties
PhantomStaff = 150,
IronwoodCrown = 151,
BrambleCoat = 152,
KotlBlackRod = 170,
KotlAutomaton = 171,
}
#endregion
public class DefCarpentry : CraftSystem
{
public override SkillName MainSkill
{
get
{
return SkillName.Carpentry;
}
}
public override int GumpTitleNumber
{
get
{
return 1044004;
}// <CENTER>CARPENTRY MENU</CENTER>
}
public override CraftECA ECA
{
get
{
return CraftECA.ChanceMinusSixtyToFourtyFive;
}
}
private static CraftSystem m_CraftSystem;
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefCarpentry();
return m_CraftSystem;
}
}
public override double GetChanceAtMin(CraftItem item)
{
return 0.5; // 50%
}
private DefCarpentry()
: base(1, 1, 1.25)// base( 1, 1, 3.0 )
{
}
public override int CanCraft(Mobile from, ITool tool, Type itemType)
{
int num = 0;
if (tool == null || tool.Deleted || tool.UsesRemaining <= 0)
return 1044038; // You have worn out your tool!
else if (!tool.CheckAccessible(from, ref num))
return num; // The tool must be on your person to use.
return 0;
}
public override void PlayCraftEffect(Mobile from)
{
// no animation
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
// from.Animate( 9, 5, 1, true, false, 0 );
from.PlaySound(0x23D);
}
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
else
return 1044157; // You failed to create the item, but no materials were lost.
}
else
{
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
else if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
else if (quality == 2)
return 1044155; // You create an exceptional quality item.
else
return 1044154; // You create the item.
}
}
public override void InitCraftList()
{
int index = -1;
// Other
AddCraft(typeof(BarrelStaves), 1044294, 1027857, 00.0, 25.0, typeof(Board), 1044041, 5, 1044351);
AddCraft(typeof(BarrelLid), 1044294, 1027608, 11.0, 36.0, typeof(Board), 1044041, 4, 1044351);
AddCraft(typeof(ShortMusicStandLeft), 1044294, 1044313, 78.9, 103.9, typeof(Board), 1044041, 15, 1044351);
AddCraft(typeof(ShortMusicStandRight), 1044294, 1044314, 78.9, 103.9, typeof(Board), 1044041, 15, 1044351);
AddCraft(typeof(TallMusicStandLeft), 1044294, 1044315, 81.5, 106.5, typeof(Board), 1044041, 20, 1044351);
AddCraft(typeof(TallMusicStandRight), 1044294, 1044316, 81.5, 106.5, typeof(Board), 1044041, 20, 1044351);
AddCraft(typeof(EasleSouth), 1044294, 1044317, 86.8, 111.8, typeof(Board), 1044041, 20, 1044351);
AddCraft(typeof(EasleEast), 1044294, 1044318, 86.8, 111.8, typeof(Board), 1044041, 20, 1044351);
AddCraft(typeof(EasleNorth), 1044294, 1044319, 86.8, 111.8, typeof(Board), 1044041, 20, 1044351);
if (Core.SE)
{
index = AddCraft(typeof(RedHangingLantern), 1044294, 1029412, 65.0, 90.0, typeof(Board), 1044041, 5, 1044351);
AddRes(index, typeof(BlankScroll), 1044377, 10, 1044378);
index = AddCraft(typeof(WhiteHangingLantern), 1044294, 1029416, 65.0, 90.0, typeof(Board), 1044041, 5, 1044351);
AddRes(index, typeof(BlankScroll), 1044377, 10, 1044378);
index = AddCraft(typeof(ShojiScreen), 1044294, 1029423, 80.0, 105.0, typeof(Board), 1044041, 75, 1044351);
AddSkill(index, SkillName.Tailoring, 50.0, 55.0);
AddRes(index, typeof(Cloth), 1044286, 60, 1044287);
index = AddCraft(typeof(BambooScreen), 1044294, 1029428, 80.0, 105.0, typeof(Board), 1044041, 75, 1044351);
AddSkill(index, SkillName.Tailoring, 50.0, 55.0);
AddRes(index, typeof(Cloth), 1044286, 60, 1044287);
}
if (Core.AOS) //Duplicate Entries to preserve ordering depending on era
{
index = AddCraft(typeof(FishingPole), 1044294, 1023519, 68.4, 93.4, typeof(Board), 1044041, 5, 1044351); //This is in the categor of Other during AoS
AddSkill(index, SkillName.Tailoring, 40.0, 45.0);
AddRes(index, typeof(Cloth), 1044286, 5, 1044287);
}
#region Mondain's Legacy
if (Core.ML)
{
index = AddCraft(typeof(WoodenContainerEngraver), 1044294, 1072153, 75.0, 100.0, typeof(Board), 1044041, 4, 1044351);
AddRes(index, typeof(IronIngot), 1044036, 2, 1044037);
index = AddCraft(typeof(RunedSwitch), 1044294, 1072896, 70.0, 120.0, typeof(Board), 1044041, 2, 1044351);
AddRes(index, typeof(EnchantedSwitch), 1072893, 1, 1053098);
AddRes(index, typeof(RunedPrism), 1073465, 1, 1053098);
AddRes(index, typeof(JeweledFiligree), 1072894, 1, 1053098);
index = AddCraft(typeof(ArcanistStatueSouthDeed), 1044294, 1072885, 0.0, 35.0, typeof(Board), 1044041, 250, 1044351);
ForceNonExceptional(index);
index = AddCraft(typeof(ArcanistStatueEastDeed), 1044294, 1072886, 0.0, 35.0, typeof(Board), 1044041, 250, 1044351);
ForceNonExceptional(index);
index = AddCraft(typeof(WarriorStatueSouthDeed), 1044294, 1072887, 0.0, 35.0, typeof(Board), 1044041, 250, 1044351);
AddRecipe(index, (int)CarpRecipes.WarriorStatueSouth);
ForceNonExceptional(index);
index = AddCraft(typeof(WarriorStatueEastDeed), 1044294, 1072888, 0.0, 35.0, typeof(Board), 1044041, 250, 1044351);
AddRecipe(index, (int)CarpRecipes.WarriorStatueEast);
ForceNonExceptional(index);
index = AddCraft(typeof(SquirrelStatueSouthDeed), 1044294, 1072884, 0.0, 35.0, typeof(Board), 1044041, 250, 1044351);
AddRecipe(index, (int)CarpRecipes.SquirrelStatueSouth);
ForceNonExceptional(index);
index = AddCraft(typeof(SquirrelStatueEastDeed), 1044294, 1073398, 0.0, 35.0, typeof(Board), 1044041, 250, 1044351);
AddRecipe(index, (int)CarpRecipes.SquirrelStatueEast);
ForceNonExceptional(index);
index = AddCraft(typeof(GiantReplicaAcorn), 1044294, 1072889, 80.0, 105.0, typeof(Board), 1044041, 35, 1044351);
index = AddCraft(typeof(MountedDreadHorn), 1044294, 1032632, 90.0, 115.0, typeof(Board), 1044041, 50, 1044351);
AddRes(index, typeof(PristineDreadHorn), 1032634, 1, 1053098);
ForceNonExceptional(index);
index = AddCraft(typeof(AcidProofRope), 1044294, 1074886, 80, 130.0, typeof(GreaterStrengthPotion), 1073466, 2, 1044253);
AddRes(index, typeof(ProtectionScroll), 1044395, 1, 1053098);
AddRes(index, typeof(SwitchItem), 1032127, 1, 1053098);
AddRecipe(index, (int)CarpRecipes.AcidProofRope);
ForceNonExceptional(index);
}
#endregion
#region SA
if (Core.SA)
{
index = AddCraft(typeof(GargishBanner), 1044294, 1095312, 94.7, 115.0, typeof(Board), 1044041, 50, 1044351);
AddSkill(index, SkillName.Tailoring, 75.0, 105.0);
AddRes(index, typeof(Cloth), 1044286, 50, 1044287);
index = AddCraft(typeof(Incubator), 1044294, 1112479, 90.0, 115.0, typeof(Board), 1044041, 100, 1044351);
index = AddCraft(typeof(ChickenCoop), 1044294, 1112570, 90.0, 115.0, typeof(Board), 1044041, 150, 1044351);
index = AddCraft(typeof(ExodusSummoningAlter), 1044294, 1153502, 95.0, 120.0, typeof(Board), 1044041, 100, 1044351);
AddSkill(index, SkillName.Magery, 75.0, 120.0);
AddRes(index, typeof(Granite), 1044607, 10, 1044253);
AddRes(index, typeof(SmallPieceofBlackrock), 1150016, 10, 1044253);
AddRes(index, typeof(NexusCore), 1153501, 1, 1044253);
}
#endregion
#region TOL
if (Core.TOL)
{
index = AddCraft(typeof(CraftableHouseItem), 1044294, 1155849, 42.1, 77.7, typeof(Board), 1044041, 5, 1044351);
SetData(index, CraftableItemType.DarkWoodenSignHanger);
SetDisplayID(index, 2967);
index = AddCraft(typeof(CraftableHouseItem), 1044294, 1155850, 42.1, 77.7, typeof(Board), 1044041, 5, 1044351);
SetData(index, CraftableItemType.LightWoodenSignHanger);
SetDisplayID(index, 2969);
}
#endregion
// Furniture
AddCraft(typeof(FootStool), 1044291, 1022910, 11.0, 36.0, typeof(Board), 1044041, 9, 1044351);
AddCraft(typeof(Stool), 1044291, 1022602, 11.0, 36.0, typeof(Board), 1044041, 9, 1044351);
AddCraft(typeof(BambooChair), 1044291, 1044300, 21.0, 46.0, typeof(Board), 1044041, 13, 1044351);
AddCraft(typeof(WoodenChair), 1044291, 1044301, 21.0, 46.0, typeof(Board), 1044041, 13, 1044351);
AddCraft(typeof(FancyWoodenChairCushion), 1044291, 1044302, 42.1, 67.1, typeof(Board), 1044041, 15, 1044351);
AddCraft(typeof(WoodenChairCushion), 1044291, 1044303, 42.1, 67.1, typeof(Board), 1044041, 13, 1044351);
AddCraft(typeof(WoodenBench), 1044291, 1022860, 52.6, 77.6, typeof(Board), 1044041, 17, 1044351);
AddCraft(typeof(WoodenThrone), 1044291, 1044304, 52.6, 77.6, typeof(Board), 1044041, 17, 1044351);
AddCraft(typeof(Throne), 1044291, 1044305, 73.6, 98.6, typeof(Board), 1044041, 19, 1044351);
AddCraft(typeof(Nightstand), 1044291, 1044306, 42.1, 67.1, typeof(Board), 1044041, 17, 1044351);
AddCraft(typeof(WritingTable), 1044291, 1022890, 63.1, 88.1, typeof(Board), 1044041, 17, 1044351);
AddCraft(typeof(LargeTable), 1044291, 1044308, 84.2, 109.2, typeof(Board), 1044041, 27, 1044351);
AddCraft(typeof(YewWoodTable), 1044291, 1044307, 63.1, 88.1, typeof(Board), 1044041, 23, 1044351);
if (Core.SE)
{
index = AddCraft(typeof(ElegantLowTable), 1044291, 1030265, 80.0, 105.0, typeof(Board), 1044041, 35, 1044351);
index = AddCraft(typeof(PlainLowTable), 1044291, 1030266, 80.0, 105.0, typeof(Board), 1044041, 35, 1044351);
}
#region Mondain's Legacy
if (Core.ML)
{
index = AddCraft(typeof(OrnateElvenTableSouthDeed), 1044291, 1072869, 85.0, 110.0, typeof(Board), 1044041, 60, 1044351);
ForceNonExceptional(index);
index = AddCraft(typeof(OrnateElvenTableEastDeed), 1044291, 1073384, 85.0, 110.0, typeof(Board), 1044041, 60, 1044351);
ForceNonExceptional(index);
index = AddCraft(typeof(FancyElvenTableSouthDeed), 1044291, 1073385, 80.0, 105.0, typeof(Board), 1044041, 50, 1044351);
ForceNonExceptional(index);
index = AddCraft(typeof(FancyElvenTableEastDeed), 1044291, 1073386, 80.0, 105.0, typeof(Board), 1044041, 50, 1044351);
ForceNonExceptional(index);
index = AddCraft(typeof(ElvenPodium), 1044291, 1073399, 80.0, 105.0, typeof(Board), 1044041, 20, 1044351);
index = AddCraft(typeof(OrnateElvenChair), 1044291, 1072870, 80.0, 105.0, typeof(Board), 1044041, 30, 1044351);
AddRecipe(index, (int)CarpRecipes.OrnateElvenChair);
index = AddCraft(typeof(BigElvenChair), 1044291, 1072872, 85.0, 110.0, typeof(Board), 1044041, 40, 1044351);
index = AddCraft(typeof(ElvenReadingChair), 1044291, 1072873, 80.0, 105.0, typeof(Board), 1044041, 30, 1044351);
}
if (Core.SA)
{
index = AddCraft(typeof(TerMurStyleChair), 1044291, 1095291, 85.0, 110.0, typeof(Board), 1044041, 40, 1044351);
index = AddCraft(typeof(TerMurStyleTable), 1044291, 1095321, 75.0, 100.0, typeof(Board), 1044041, 50, 1044351);
}
index = AddCraft(typeof(UpholsteredChairDeed), 1044291, 1154173, 70.0, 110.0, typeof(Board), 1044041, 40, 1044351);
AddSkill(index, SkillName.Tailoring, 55.0, 60.0);
AddRes(index, typeof(Cloth), 1044286, 12, 1044287);
SetNeededThemePack(index, ThemePack.Kings);
#endregion
// Containers
AddCraft(typeof(WoodenBox), 1044292, 1023709, 21.0, 46.0, typeof(Board), 1044041, 10, 1044351);
AddCraft(typeof(SmallCrate), 1044292, 1044309, 10.0, 35.0, typeof(Board), 1044041, 8, 1044351);
AddCraft(typeof(MediumCrate), 1044292, 1044310, 31.0, 56.0, typeof(Board), 1044041, 15, 1044351);
AddCraft(typeof(LargeCrate), 1044292, 1044311, 47.3, 72.3, typeof(Board), 1044041, 18, 1044351);
AddCraft(typeof(WoodenChest), 1044292, 1023650, 73.6, 98.6, typeof(Board), 1044041, 20, 1044351);
AddCraft(typeof(EmptyBookcase), 1044292, 1022718, 31.5, 56.5, typeof(Board), 1044041, 25, 1044351);
AddCraft(typeof(FancyArmoire), 1044292, 1044312, 84.2, 109.2, typeof(Board), 1044041, 35, 1044351);
AddCraft(typeof(Armoire), 1044292, 1022643, 84.2, 109.2, typeof(Board), 1044041, 35, 1044351);
if (Core.SE)
{
index = AddCraft(typeof(PlainWoodenChest), 1044292, 1030251, 90.0, 115.0, typeof(Board), 1044041, 30, 1044351);
index = AddCraft(typeof(OrnateWoodenChest), 1044292, 1030253, 90.0, 115.0, typeof(Board), 1044041, 30, 1044351);
index = AddCraft(typeof(GildedWoodenChest), 1044292, 1030255, 90.0, 115.0, typeof(Board), 1044041, 30, 1044351);
index = AddCraft(typeof(WoodenFootLocker), 1044292, 1030257, 90.0, 115.0, typeof(Board), 1044041, 30, 1044351);
index = AddCraft(typeof(FinishedWoodenChest), 1044292, 1030259, 90.0, 115.0, typeof(Board), 1044041, 30, 1044351);
index = AddCraft(typeof(TallCabinet), 1044292, 1030261, 90.0, 115.0, typeof(Board), 1044041, 35, 1044351);
index = AddCraft(typeof(ShortCabinet), 1044292, 1030263, 90.0, 115.0, typeof(Board), 1044041, 35, 1044351);
index = AddCraft(typeof(RedArmoire), 1044292, 1030328, 90.0, 115.0, typeof(Board), 1044041, 40, 1044351);
index = AddCraft(typeof(ElegantArmoire), 1044292, 1030330, 90.0, 115.0, typeof(Board), 1044041, 40, 1044351);
index = AddCraft(typeof(MapleArmoire), 1044292, 1030332, 90.0, 115.0, typeof(Board), 1044041, 40, 1044351);
index = AddCraft(typeof(CherryArmoire), 1044292, 1030334, 90.0, 115.0, typeof(Board), 1044041, 40, 1044351);
}
index = AddCraft(typeof(Keg), 1044292, 1023711, 57.8, 82.8, typeof(BarrelStaves), 1044288, 3, 1044253);
AddRes(index, typeof(BarrelHoops), 1044289, 1, 1044253);
AddRes(index, typeof(BarrelLid), 1044251, 1, 1044253);
ForceNonExceptional(index);
#region Mondain's Legacy
if (Core.ML)
{
index = AddCraft(typeof(ArcaneBookShelfDeedSouth), 1044292, 1072871, 94.7, 119.7, typeof(Board), 1044041, 80, 1044351);
AddRecipe(index, (int)CarpRecipes.ArcaneBookshelfSouth);
ForceNonExceptional(index);
index = AddCraft(typeof(ArcaneBookShelfDeedEast), 1044292, 1073371, 94.7, 119.7, typeof(Board), 1044041, 80, 1044351);
AddRecipe(index, (int)CarpRecipes.ArcaneBookshelfEast);
ForceNonExceptional(index);
index = AddCraft(typeof(OrnateElvenChestSouthDeed), 1044292, 1072862, 94.7, 119.7, typeof(Board), 1044041, 40, 1044351);
AddRecipe(index, (int)CarpRecipes.OrnateElvenChestSouth);
ForceNonExceptional(index);
index = AddCraft(typeof(OrnateElvenChestEastDeed), 1044292, 1073383, 94.7, 119.7, typeof(Board), 1044041, 40, 1044351);
AddRecipe(index, (int)CarpRecipes.OrnateElvenChestEast);
ForceNonExceptional(index);
index = AddCraft(typeof(ElvenWashBasinSouthWithDrawerDeed), 1044292, 1072865, 70.0, 95.0, typeof(Board), 1044041, 40, 1044351);
ForceNonExceptional(index);
index = AddCraft(typeof(ElvenWashBasinEastWithDrawerDeed), 1044292, 1073387, 70.0, 95.0, typeof(Board), 1044041, 40, 1044351);
ForceNonExceptional(index);
index = AddCraft(typeof(ElvenDresserDeedSouth), 1044292, 1072864, 75.0, 100.0, typeof(Board), 1044041, 45, 1044351);
AddRecipe(index, (int)CarpRecipes.ElvenDresserSouth);
ForceNonExceptional(index);
index = AddCraft(typeof(ElvenDresserDeedEast), 1044292, 1073388, 75.0, 100.0, typeof(Board), 1044041, 45, 1044351);
AddRecipe(index, (int)CarpRecipes.ElvenDresserEast);
ForceNonExceptional(index);
index = AddCraft(typeof(FancyElvenArmoire), 1044292, 1072866, 80.0, 105.0, typeof(Board), 1044041, 60, 1044351);
AddRecipe(index, (int)CarpRecipes.FancyElvenArmoire);
ForceNonExceptional(index);
index = AddCraft(typeof(SimpleElvenArmoire), 1044292, 1073401, 80.0, 105.0, typeof(Board), 1044041, 60, 1044351);
ForceNonExceptional(index);
index = AddCraft(typeof(RarewoodChest), 1044292, 1073402, 80.0, 105.0, typeof(Board), 1044041, 30, 1044351);
index = AddCraft(typeof(DecorativeBox), 1044292, 1073403, 80.0, 105.0, typeof(Board), 1044041, 25, 1044351);
}
#endregion
index = AddCraft(typeof(AcademicBookCase), 1044292, 1071213, 60.0, 85.0, typeof(Board), 1044041, 25, 1044351);
AddRes(index, typeof(AcademicBooksArtifact), 1071202, 1, 1044253);
if (Core.SA)
{
index = AddCraft(typeof(GargishChest), 1044292, 1095293, 80.0, 105.0, typeof(Board), 1044041, 30, 1044351);
}
AddCraft(typeof(LiquorBarrel), 1044292, 1150816, 60.0, 90.0, typeof(Board), 1044041, 50, 1044351);
// Weapons
AddCraft(typeof(ShepherdsCrook), 1044566, 1023713, 78.9, 103.9, typeof(Board), 1044041, 7, 1044351);
AddCraft(typeof(QuarterStaff), 1044566, 1023721, 73.6, 98.6, typeof(Board), 1044041, 6, 1044351);
AddCraft(typeof(GnarledStaff), 1044566, 1025112, 78.9, 103.9, typeof(Board), 1044041, 7, 1044351);
if (Core.SE)
{
index = AddCraft(typeof(Bokuto), 1044566, 1030227, 70.0, 95.0, typeof(Board), 1044041, 6, 1044351);
index = AddCraft(typeof(Fukiya), 1044566, 1030229, 60.0, 85.0, typeof(Board), 1044041, 6, 1044351);
index = AddCraft(typeof(Tetsubo), 1044566, 1030225, 80.0, 105.0, typeof(Board), 1044041, 10, 1044351);
}
#region Mondain's Legacy
if (Core.ML)
{
index = AddCraft(typeof(WildStaff), 1044566, 1031557, 63.8, 113.8, typeof(Board), 1044041, 16, 1044351);
index = AddCraft(typeof(PhantomStaff), 1044566, 1072919, 90.0, 130.0, typeof(Board), 1044041, 16, 1044351);
AddRes(index, typeof(DiseasedBark), 1032683, 1, 1053098);
AddRes(index, typeof(Putrefaction), 1032678, 10, 1053098);
AddRes(index, typeof(Taint), 1032679, 10, 1053098);
AddRecipe(index, (int)CarpRecipes.PhantomStaff);
ForceNonExceptional(index);
index = AddCraft(typeof(ArcanistsWildStaff), 1044566, 1073549, 63.8, 113.8, typeof(Board), 1044041, 16, 1044351);
AddRes(index, typeof(WhitePearl), 1026253, 1, 1053098);
AddRecipe(index, (int)CarpRecipes.ArcanistsWildStaff);
index = AddCraft(typeof(AncientWildStaff), 1044566, 1073550, 63.8, 113.8, typeof(Board), 1044041, 16, 1044351);
AddRes(index, typeof(PerfectEmerald), 1026251, 1, 1053098);
AddRecipe(index, (int)CarpRecipes.AncientWildStaff);
index = AddCraft(typeof(ThornedWildStaff), 1044566, 1073551, 63.8, 113.8, typeof(Board), 1044041, 16, 1044351);
AddRes(index, typeof(FireRuby), 1026254, 1, 1053098);
AddRecipe(index, (int)CarpRecipes.ThornedWildStaff);
index = AddCraft(typeof(HardenedWildStaff), 1044566, 1073552, 63.8, 113.8, typeof(Board), 1044041, 16, 1044351);
AddRes(index, typeof(Turquoise), 1026250, 1, 1053098);
AddRecipe(index, (int)CarpRecipes.HardenedWildStaff);
}
#endregion
#region SA
if (Core.SA)
{
index = AddCraft(typeof(SerpentStoneStaff), 1044566, 1095367, 63.8, 113.8, typeof(Board), 1044041, 16, 1044351);
AddRes(index, typeof(EcruCitrine), 1026252, 1, 1053098);
index = AddCraft(typeof(GargishGnarledStaff), 1044566, 1097488, 78.9, 128.9, typeof(Board), 1044041, 16, 1044351);
AddRes(index, typeof(EcruCitrine), 1026252, 1, 1053098);
}
#endregion
AddCraft(typeof(Club), 1044566, 1025043, 65.0, 90.0, typeof(Board), 1044041, 9, 1044351);
AddCraft(typeof(BlackStaff), 1044566, 1023568, 81.5, 106.5, typeof(Board), 1044041, 9, 1044351);
if (Core.TOL)
{
index = AddCraft(typeof(KotlBlackRod), 1044566, 1156990, 100.0, 160.0, typeof(Board), 1044041, 20, 1044351);
AddRes(index, typeof(BlackrockMoonstone), 1156993, 1, 1156992);
AddRes(index, typeof(StaffOfTheMagi), 1061600, 1, 1044253);
AddRecipe(index, (int)CarpRecipes.KotlBlackRod);
/*index = AddCraft(typeof(GargishKotlBlackRod), 1044566, 1156994, 100.0, 160.0, typeof(Board), 1044041, 20, 1044351);
AddRes(index, typeof(BlackrockMoonstone), 1156993, 1, 1156992);
AddRes(index, typeof(StaffOfTheMagi), 1061600, 1, 1044253);
AddRecipe(index, (int)CarpRecipes.KotlBlackRod);
*/
}
// Armor
AddCraft(typeof(WoodenShield), 1062760, 1027034, 52.6, 77.6, typeof(Board), 1044041, 9, 1044351);
#region Mondain's Legacy
if (Core.ML)
{
index = AddCraft(typeof(WoodlandChest), 1062760, 1031111, 90.0, 115.0, typeof(Board), 1044041, 20, 1044351);
AddRes(index, typeof(BarkFragment), 1032687, 6, 1053098);
index = AddCraft(typeof(WoodlandArms), 1062760, 1031116, 80.0, 105.0, typeof(Board), 1044041, 15, 1044351);
AddRes(index, typeof(BarkFragment), 1032687, 4, 1053098);
index = AddCraft(typeof(WoodlandGloves), 1062760, 1031114, 85.0, 110.0, typeof(Board), 1044041, 15, 1044351);
AddRes(index, typeof(BarkFragment), 1032687, 4, 1053098);
index = AddCraft(typeof(WoodlandLegs), 1062760, 1031115, 85.0, 110.0, typeof(Board), 1044041, 15, 1044351);
AddRes(index, typeof(BarkFragment), 1032687, 4, 1053098);
index = AddCraft(typeof(WoodlandGorget), 1062760, 1031113, 85.0, 110.0, typeof(Board), 1044041, 15, 1044351);
AddRes(index, typeof(BarkFragment), 1032687, 4, 1053098);
index = AddCraft(typeof(RavenHelm), 1062760, 1031121, 65.0, 115.0, typeof(Board), 1044041, 10, 1044351);
AddRes(index, typeof(BarkFragment), 1032687, 4, 1053098);
AddRes(index, typeof(Feather), 1027123, 25, 1053098);
index = AddCraft(typeof(VultureHelm), 1062760, 1031122, 63.9, 113.9, typeof(Board), 1044041, 10, 1044351);
AddRes(index, typeof(BarkFragment), 1032687, 4, 1053098);
AddRes(index, typeof(Feather), 1027123, 25, 1053098);
index = AddCraft(typeof(WingedHelm), 1062760, 1031123, 58.4, 108.4, typeof(Board), 1044041, 10, 1044351);
AddRes(index, typeof(BarkFragment), 1032687, 4, 1053098);
AddRes(index, typeof(Feather), 1027123, 60, 1053098);
index = AddCraft(typeof(IronwoodCrown), 1062760, 1072924, 85.0, 120.0, typeof(Board), 1044041, 10, 1044351);
AddRes(index, typeof(DiseasedBark), 1032683, 1, 1053098);
AddRes(index, typeof(Corruption), 1032676, 10, 1053098);
AddRes(index, typeof(Putrefaction), 1032678, 10, 1053098);
AddRecipe(index, (int)CarpRecipes.IronwoodCrown);
ForceNonExceptional(index);
index = AddCraft(typeof(BrambleCoat), 1062760, 1072925, 85.0, 120.0, typeof(Board), 1044041, 10, 1044351);
AddRes(index, typeof(DiseasedBark), 1032683, 1, 1053098);
AddRes(index, typeof(Taint), 1032679, 10, 1053098);
AddRes(index, typeof(Scourge), 1032677, 10, 1053098);
AddRecipe(index, (int)CarpRecipes.BrambleCoat);
ForceNonExceptional(index);
index = AddCraft(typeof(DarkwoodCrown), 1062760, 1073481, 85.0, 120.0, typeof(Board), 1044041, 10, 1044351);
AddRes(index, typeof(LardOfParoxysmus), 1032681, 1, 1053098);
AddRes(index, typeof(Blight), 1032675, 10, 1053098);
AddRes(index, typeof(Taint), 1032679, 10, 1053098);
ForceNonExceptional(index);
index = AddCraft(typeof(DarkwoodChest), 1062760, 1073482, 85.0, 120.0, typeof(Board), 1044041, 20, 1044351);
AddRes(index, typeof(DreadHornMane), 1032682, 1, 1053098);
AddRes(index, typeof(Corruption), 1032676, 10, 1053098);
AddRes(index, typeof(Muculent), 1032680, 10, 1053098);
ForceNonExceptional(index);
index = AddCraft(typeof(DarkwoodGorget), 1062760, 1073483, 85.0, 120.0, typeof(Board), 1044041, 15, 1044351);
AddRes(index, typeof(DiseasedBark), 1032683, 1, 1053098);
AddRes(index, typeof(Blight), 1032675, 10, 1053098);
AddRes(index, typeof(Scourge), 1032677, 10, 1053098);
ForceNonExceptional(index);
index = AddCraft(typeof(DarkwoodLegs), 1062760, 1073484, 85.0, 120.0, typeof(Board), 1044041, 15, 1044351);
AddRes(index, typeof(GrizzledBones), 1032684, 1, 1053098);
AddRes(index, typeof(Corruption), 1032676, 10, 1053098);
AddRes(index, typeof(Putrefaction), 1072137, 10, 1053098);
ForceNonExceptional(index);
index = AddCraft(typeof(DarkwoodPauldrons), 1062760, 1073485, 85.0, 120.0, typeof(Board), 1044041, 15, 1044351);
AddRes(index, typeof(EyeOfTheTravesty), 1032685, 1, 1053098);
AddRes(index, typeof(Scourge), 1032677, 10, 1053098);
AddRes(index, typeof(Taint), 1032679, 10, 1053098);
ForceNonExceptional(index);
index = AddCraft(typeof(DarkwoodGloves), 1062760, 1073486, 85.0, 120.0, typeof(Board), 1044041, 15, 1044351);
AddRes(index, typeof(CapturedEssence), 1032686, 1, 1053098);
AddRes(index, typeof(Putrefaction), 1032678, 10, 1053098);
AddRes(index, typeof(Muculent), 1032680, 10, 1053098);
ForceNonExceptional(index);
}
#endregion
#region SA
index = AddCraft(typeof(GargishWoodenShield), 1062760, 1095768, 52.6, 77.6, typeof(Board), 1044041, 9, 1044351);
#endregion
// Instruments
index = AddCraft(typeof(LapHarp), 1044293, 1023762, 63.1, 88.1, typeof(Board), 1044041, 20, 1044351);
AddSkill(index, SkillName.Musicianship, 45.0, 50.0);
AddRes(index, typeof(Cloth), 1044286, 10, 1044287);
index = AddCraft(typeof(Harp), 1044293, 1023761, 78.9, 103.9, typeof(Board), 1044041, 35, 1044351);
AddSkill(index, SkillName.Musicianship, 45.0, 50.0);
AddRes(index, typeof(Cloth), 1044286, 15, 1044287);
index = AddCraft(typeof(Drums), 1044293, 1023740, 57.8, 82.8, typeof(Board), 1044041, 20, 1044351);
AddSkill(index, SkillName.Musicianship, 45.0, 50.0);
AddRes(index, typeof(Cloth), 1044286, 10, 1044287);
index = AddCraft(typeof(Lute), 1044293, 1023763, 68.4, 93.4, typeof(Board), 1044041, 25, 1044351);
AddSkill(index, SkillName.Musicianship, 45.0, 50.0);
AddRes(index, typeof(Cloth), 1044286, 10, 1044287);
index = AddCraft(typeof(Tambourine), 1044293, 1023741, 57.8, 82.8, typeof(Board), 1044041, 15, 1044351);
AddSkill(index, SkillName.Musicianship, 45.0, 50.0);
AddRes(index, typeof(Cloth), 1044286, 10, 1044287);
index = AddCraft(typeof(TambourineTassel), 1044293, 1044320, 57.8, 82.8, typeof(Board), 1044041, 15, 1044351);
AddSkill(index, SkillName.Musicianship, 45.0, 50.0);
AddRes(index, typeof(Cloth), 1044286, 15, 1044287);
if (Core.SE)
{
index = AddCraft(typeof(BambooFlute), 1044293, 1030247, 80.0, 105.0, typeof(Board), 1044041, 15, 1044351);
AddSkill(index, SkillName.Musicianship, 45.0, 50.0);
}
if (Core.SA)
{
index = AddCraft(typeof(AudChar), 1044293, 1095315, 78.9, 103.9, typeof(Board), 1044041, 35, 1044351);
AddSkill(index, SkillName.Musicianship, 45.0, 50.0);
AddRes(index, typeof(Granite), 1044514, 3, 1044513);
index = AddCraft(typeof(SnakeCharmerFlute), 1044293, 1112174, 80.0, 105.0, typeof(Board), 1044041, 15, 1044351);
AddSkill(index, SkillName.Musicianship, 45.0, 50.0);
AddRes(index, typeof(LuminescentFungi), 1073475, 3, 1044253);
}
index = AddCraft(typeof(CelloDeed), 1044293, 1098390, 75.0, 105.0, typeof(Board), 1044041, 15, 1044351);
AddSkill(index, SkillName.Musicianship, 45.0, 50.0);
AddRes(index, typeof(Cloth), 1044286, 5, 1044287);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(WallMountedBellSouthDeed), 1044293, 1154162, 75.0, 105.0, typeof(Board), 1044041, 50, 1044351);
AddSkill(index, SkillName.Musicianship, 45.0, 50.0);
AddRes(index, typeof(IronIngot), 1044036, 50, 1044037);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(WallMountedBellEastDeed), 1044293, 1154163, 75.0, 105.0, typeof(Board), 1044041, 50, 1044351);
AddSkill(index, SkillName.Musicianship, 45.0, 50.0);
AddRes(index, typeof(IronIngot), 1044036, 50, 1044037);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(TrumpetDeed), 1044293, 1098388, 85.0, 105.0, typeof(Board), 1044041, 10, 1044351);
AddSkill(index, SkillName.Musicianship, 45.0, 50.0);
AddRes(index, typeof(IronIngot), 1044036, 15, 1044037);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(CowBellDeed), 1044293, 1098418, 85.0, 105.0, typeof(Board), 1044041, 10, 1044351);
AddSkill(index, SkillName.Musicianship, 45.0, 50.0);
AddRes(index, typeof(IronIngot), 1044036, 15, 1044037);
SetNeededThemePack(index, ThemePack.Kings);
// Misc
if (Core.AOS)
{
AddCraft(typeof(PlayerBBEast), 1044290, 1062420, 85.0, 110.0, typeof(Board), 1044041, 50, 1044351);
AddCraft(typeof(PlayerBBSouth), 1044290, 1062421, 85.0, 110.0, typeof(Board), 1044041, 50, 1044351);
}
#region Mondain's Legacy
if (Core.ML)
{
index = AddCraft(typeof(ParrotPerchAddonDeed), 1044290, 1072617, 50.0, 85.0, typeof(Board), 1044041, 100, 1044351);
ForceNonExceptional(index);
index = AddCraft(typeof(ArcaneCircleDeed), 1044290, 1072703, 94.7, 119.7, typeof(Board), 1044041, 100, 1044351);
AddRes(index, typeof(BlueDiamond), 1026255, 2, 1053098);
AddRes(index, typeof(PerfectEmerald), 1026251, 2, 1053098);
AddRes(index, typeof(FireRuby), 1026254, 2, 1053098);
ForceNonExceptional(index);
index = AddCraft(typeof(TallElvenBedSouthDeed), 1044290, 1072858, 94.7, 119.7, typeof(Board), 1044041, 200, 1044351);
AddSkill(index, SkillName.Tailoring, 75.0, 80.0);
AddRes(index, typeof(Cloth), 1044286, 100, 1044287);
AddRecipe(index, (int)CarpRecipes.TallElvenBedSouth);
ForceNonExceptional(index);
index = AddCraft(typeof(TallElvenBedEastDeed), 1044290, 1072859, 94.7, 119.7, typeof(Board), 1044041, 200, 1044351);
AddSkill(index, SkillName.Tailoring, 75.0, 80.0);
AddRes(index, typeof(Cloth), 1044286, 100, 1044287);
AddRecipe(index, (int)CarpRecipes.TallElvenBedEast);
ForceNonExceptional(index);
index = AddCraft(typeof(ElvenBedSouthDeed), 1044290, 1072860, 94.7, 119.7, typeof(Board), 1044041, 100, 1044351);
AddRes(index, typeof(Cloth), 1044286, 100, 1044287);
ForceNonExceptional(index);
index = AddCraft(typeof(ElvenBedEastDeed), 1044290, 1072861, 94.7, 119.7, typeof(Board), 1044041, 100, 1044351);
AddRes(index, typeof(Cloth), 1044286, 100, 1044287);
ForceNonExceptional(index);
index = AddCraft(typeof(ElvenLoveseatSouthDeed), 1044290, 1072867, 80.0, 105.0, typeof(Board), 1044041, 50, 1044351);
SetDisplayID(index, 0x2DDF);
ForceNonExceptional(index);
index = AddCraft(typeof(ElvenLoveseatEastDeed), 1044290, 1073372, 80.0, 105.0, typeof(Board), 1044041, 50, 1044351);
SetDisplayID(index, 0x2DE0);
ForceNonExceptional(index);
index = AddCraft(typeof(AlchemistTableSouthDeed), 1044290, 1073396, 85.0, 110.0, typeof(Board), 1044041, 70, 1044351);
SetDisplayID(index, 0x2DD4);
ForceNonExceptional(index);
index = AddCraft(typeof(AlchemistTableEastDeed), 1044290, 1073397, 85.0, 110.0, typeof(Board), 1044041, 70, 1044351);
SetDisplayID(index, 0x2DD3);
ForceNonExceptional(index);
}
#endregion
index = AddCraft(typeof(SmallBedSouthDeed), 1044290, 1044321, 94.7, 119.8, typeof(Board), 1044041, 100, 1044351);
AddSkill(index, SkillName.Tailoring, 75.0, 80.0);
AddRes(index, typeof(Cloth), 1044286, 100, 1044287);
index = AddCraft(typeof(SmallBedEastDeed), 1044290, 1044322, 94.7, 119.8, typeof(Board), 1044041, 100, 1044351);
AddSkill(index, SkillName.Tailoring, 75.0, 80.0);
AddRes(index, typeof(Cloth), 1044286, 100, 1044287);
index = AddCraft(typeof(LargeBedSouthDeed), 1044290, 1044323, 94.7, 119.8, typeof(Board), 1044041, 150, 1044351);
AddSkill(index, SkillName.Tailoring, 75.0, 80.0);
AddRes(index, typeof(Cloth), 1044286, 150, 1044287);
index = AddCraft(typeof(LargeBedEastDeed), 1044290, 1044324, 94.7, 119.8, typeof(Board), 1044041, 150, 1044351);
AddSkill(index, SkillName.Tailoring, 75.0, 80.0);
AddRes(index, typeof(Cloth), 1044286, 150, 1044287);
AddCraft(typeof(DartBoardSouthDeed), 1044290, 1044325, 15.7, 40.7, typeof(Board), 1044041, 5, 1044351);
AddCraft(typeof(DartBoardEastDeed), 1044290, 1044326, 15.7, 40.7, typeof(Board), 1044041, 5, 1044351);
AddCraft(typeof(BallotBoxDeed), 1044290, 1044327, 47.3, 72.3, typeof(Board), 1044041, 5, 1044351);
index = AddCraft(typeof(PentagramDeed), 1044290, 1044328, 100.0, 125.0, typeof(Board), 1044041, 100, 1044351);
AddSkill(index, SkillName.Magery, 75.0, 80.0);
AddRes(index, typeof(IronIngot), 1044036, 40, 1044037);
index = AddCraft(typeof(AbbatoirDeed), 1044290, 1044329, 100.0, 125.0, typeof(Board), 1044041, 100, 1044351);
AddSkill(index, SkillName.Magery, 50.0, 55.0);
AddRes(index, typeof(IronIngot), 1044036, 40, 1044037);
if (Core.SA)
{
index = AddCraft(typeof(GargishCouchEastDeed), 1044290, 1111776, 90.0, 115.0, typeof(Board), 1044041, 75, 1044351);
index = AddCraft(typeof(GargishCouchSouthDeed), 1044290, 1111775, 90.0, 115.0, typeof(Board), 1044041, 75, 1044351);
index = AddCraft(typeof(LongTableSouthDeed), 1044290, 1111781, 90.0, 115.0, typeof(Board), 1044041, 80, 1044351);
index = AddCraft(typeof(LongTableEastDeed), 1044290, 1111782, 90.0, 115.0, typeof(Board), 1044041, 80, 1044351);
index = AddCraft(typeof(TerMurDresserEastDeed), 1044290, 1111784, 90.0, 115.0, typeof(Board), 1044041, 60, 1044351);
index = AddCraft(typeof(TerMurDresserSouthDeed), 1044290, 1111783, 90.0, 115.0, typeof(Board), 1044041, 60, 1044351);
}
index = AddCraft(typeof(RusticBenchSouthDeed), 1044290, 1150593, 94.7, 119.8, typeof(Board), 1044041, 35, 1044351);
SetNeededThemePack(index, ThemePack.Rustic);
index = AddCraft(typeof(RusticBenchEastDeed), 1044290, 1150594, 94.7, 119.8, typeof(Board), 1044041, 35, 1044351);
SetNeededThemePack(index, ThemePack.Rustic);
index = AddCraft(typeof(PlainWoodenShelfSouthDeed), 1044290, 1154160, 40.0, 90.0, typeof(Board), 1044041, 15, 1044351);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(PlainWoodenShelfEastDeed), 1044290, 1154161, 40.0, 90.0, typeof(Board), 1044041, 15, 1044351);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(FancyWoodenShelfSouthDeed), 1044290, 1154158, 40.0, 90.0, typeof(Board), 1044041, 15, 1044351);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(FancyWoodenShelfEastDeed), 1044290, 1154159, 40.0, 90.0, typeof(Board), 1044041, 15, 1044351);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(FancyLoveseatSouthDeed), 1044290, 1154137, 70.0, 120.0, typeof(Board), 1044041, 80, 1044351);
AddSkill(index, SkillName.Tailoring, 55.0, 60.0);
AddRes(index, typeof(Cloth), 1044286, 24, 1044287);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(FancyLoveseatEastDeed), 1044290, 1154138, 70.0, 120.0, typeof(Board), 1044041, 80, 1044351);
AddSkill(index, SkillName.Tailoring, 55.0, 60.0);
AddRes(index, typeof(Cloth), 1044286, 24, 1044287);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(FancyCouchSouthDeed), 1044290, 1154139, 70.0, 120.0, typeof(Board), 1044041, 80, 1044351);
AddSkill(index, SkillName.Tailoring, 55.0, 60.0);
AddRes(index, typeof(Cloth), 1044286, 48, 1044287);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(FancyCouchEastDeed), 1044290, 1154140, 70.0, 120.0, typeof(Board), 1044041, 80, 1044351);
AddSkill(index, SkillName.Tailoring, 55.0, 60.0);
AddRes(index, typeof(Cloth), 1044286, 48, 1044287);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(PlushLoveseatSouthDeed), 1044290, 1154135, 70.0, 120.0, typeof(Board), 1044041, 80, 1044351);
AddSkill(index, SkillName.Tailoring, 55.0, 60.0);
AddRes(index, typeof(Cloth), 1044286, 24, 1044287);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(PlushLoveseatEastDeed), 1044290, 1154136, 70.0, 120.0, typeof(Board), 1044041, 80, 1044351);
AddSkill(index, SkillName.Tailoring, 55.0, 60.0);
AddRes(index, typeof(Cloth), 1044286, 24, 1044287);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(PlantTapestrySouthDeed), 1044290, 1154146, 85.0, 110.0, typeof(Board), 1044041, 12, 1044351);
AddSkill(index, SkillName.Tailoring, 75.0, 80.0);
AddRes(index, typeof(Cloth), 1044286, 50, 1044287);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(PlantTapestryEastDeed), 1044290, 1154147, 85.0, 110.0, typeof(Board), 1044041, 12, 1044351);
AddSkill(index, SkillName.Tailoring, 75.0, 80.0);
AddRes(index, typeof(Cloth), 1044286, 50, 1044287);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(MetalTableSouthDeed), 1044290, 1154154, 80.0, 105.0, typeof(Board), 1044041, 20, 1044351);
AddSkill(index, SkillName.Tinkering, 75.0, 80.0);
AddRes(index, typeof(IronIngot), 1044036, 15, 1044037);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(MetalTableEastDeed), 1044290, 1154155, 80.0, 105.0, typeof(Board), 1044041, 20, 1044351);
AddSkill(index, SkillName.Tinkering, 75.0, 80.0);
AddRes(index, typeof(IronIngot), 1044036, 15, 1044037);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(LongMetalTableSouthDeed), 1044290, 1154164, 80.0, 105.0, typeof(Board), 1044041, 40, 1044351);
AddSkill(index, SkillName.Tinkering, 75.0, 80.0);
AddRes(index, typeof(IronIngot), 1044036, 30, 1044037);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(LongMetalTableEastDeed), 1044290, 1154165, 80.0, 105.0, typeof(Board), 1044041, 40, 1044351);
AddSkill(index, SkillName.Tinkering, 75.0, 80.0);
AddRes(index, typeof(IronIngot), 1044036, 30, 1044037);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(WoodenTableSouthDeed), 1044290, 1154156, 80.0, 105.0, typeof(Board), 1044041, 20, 1044351);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(WoodenTableEastDeed), 1044290, 1154157, 80.0, 105.0, typeof(Board), 1044041, 20, 1044351);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(LongWoodenTableSouthDeed), 1044290, 1154166, 80.0, 105.0, typeof(Board), 1044041, 80, 1044351);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(LongWoodenTableEastDeed), 1044290, 1154167, 80.0, 105.0, typeof(Board), 1044041, 80, 1044351);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(SmallDisplayCaseSouthDeed), 1044290, 1155842, 95.0, 120.0, typeof(Board), 1044041, 40, 1044351);
AddSkill(index, SkillName.Tinkering, 75.0, 80.0);
AddRes(index, typeof(IronIngot), 1044036, 10, 1044037);
index = AddCraft(typeof(SmallDisplayCaseEastDeed), 1044290, 1155843, 95.0, 120.0, typeof(Board), 1044041, 40, 1044351);
AddSkill(index, SkillName.Tinkering, 75.0, 80.0);
AddRes(index, typeof(IronIngot), 1044036, 10, 1044037);
index = AddCraft(typeof(FancyLoveseatNorthDeed), 1044290, 1156560, 70.0, 120.0, typeof(Board), 1044041, 80, 1044351);
AddSkill(index, SkillName.Tailoring, 55.0, 60.0);
AddRes(index, typeof(Cloth), 1044286, 48, 1044287);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(FancyLoveseatWestDeed), 1044290, 1156561, 70.0, 120.0, typeof(Board), 1044041, 80, 1044351);
AddSkill(index, SkillName.Tailoring, 55.0, 60.0);
AddRes(index, typeof(Cloth), 1044286, 48, 1044287);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(FancyCouchNorthDeed), 1044290, 1156582, 70.0, 120.0, typeof(Board), 1044041, 80, 1044351);
AddSkill(index, SkillName.Tailoring, 55.0, 60.0);
AddRes(index, typeof(Cloth), 1044286, 48, 1044287);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(FancyCouchWestDeed), 1044290, 1156583, 70.0, 120.0, typeof(Board), 1044041, 80, 1044351);
AddSkill(index, SkillName.Tailoring, 55.0, 60.0);
AddRes(index, typeof(Cloth), 1044286, 48, 1044287);
SetNeededThemePack(index, ThemePack.Kings);
// Tailoring and Cooking
index = AddCraft(typeof(DressformFront), 1044298, 1044339, 63.1, 88.1, typeof(Board), 1044041, 25, 1044351);
AddSkill(index, SkillName.Tailoring, 65.0, 70.0);
AddRes(index, typeof(Cloth), 1044286, 10, 1044287);
index = AddCraft(typeof(DressformSide), 1044298, 1044340, 63.1, 88.1, typeof(Board), 1044041, 25, 1044351);
AddSkill(index, SkillName.Tailoring, 65.0, 70.0);
AddRes(index, typeof(Cloth), 1044286, 10, 1044287);
#region Mondain's Legacy
if (Core.ML)
{
index = AddCraft(typeof(ElvenSpinningwheelEastDeed), 1044298, 1073393, 75.0, 100.0, typeof(Board), 1044041, 60, 1044351);
AddSkill(index, SkillName.Tailoring, 65.0, 85.0);
AddRes(index, typeof(Cloth), 1044286, 40, 1044287);
ForceNonExceptional(index);
index = AddCraft(typeof(ElvenSpinningwheelSouthDeed), 1044298, 1072878, 75.0, 100.0, typeof(Board), 1044041, 60, 1044351);
AddSkill(index, SkillName.Tailoring, 65.0, 85.0);
AddRes(index, typeof(Cloth), 1044286, 40, 1044287);
ForceNonExceptional(index);
index = AddCraft(typeof(ElvenStoveSouthDeed), 1044298, 1073394, 85.0, 110.0, typeof(Board), 1044041, 80, 1044351);
ForceNonExceptional(index);
index = AddCraft(typeof(ElvenStoveEastDeed), 1044298, 1073395, 85.0, 110.0, typeof(Board), 1044041, 80, 1044351);
ForceNonExceptional(index);
}
#endregion
index = AddCraft(typeof(SpinningwheelEastDeed), 1044298, 1044341, 73.6, 98.6, typeof(Board), 1044041, 75, 1044351);
AddSkill(index, SkillName.Tailoring, 65.0, 70.0);
AddRes(index, typeof(Cloth), 1044286, 25, 1044287);
index = AddCraft(typeof(SpinningwheelSouthDeed), 1044298, 1044342, 73.6, 98.6, typeof(Board), 1044041, 75, 1044351);
AddSkill(index, SkillName.Tailoring, 65.0, 70.0);
AddRes(index, typeof(Cloth), 1044286, 25, 1044287);
index = AddCraft(typeof(LoomEastDeed), 1044298, 1044343, 84.2, 109.2, typeof(Board), 1044041, 85, 1044351);
AddSkill(index, SkillName.Tailoring, 65.0, 70.0);
AddRes(index, typeof(Cloth), 1044286, 25, 1044287);
index = AddCraft(typeof(LoomSouthDeed), 1044298, 1044344, 84.2, 109.2, typeof(Board), 1044041, 85, 1044351);
AddSkill(index, SkillName.Tailoring, 65.0, 70.0);
AddRes(index, typeof(Cloth), 1044286, 25, 1044287);
index = AddCraft(typeof(StoneOvenEastDeed), 1044298, 1044345, 68.4, 93.4, typeof(Board), 1044041, 85, 1044351);
AddSkill(index, SkillName.Tinkering, 50.0, 55.0);
AddRes(index, typeof(IronIngot), 1044036, 125, 1044037);
index = AddCraft(typeof(StoneOvenSouthDeed), 1044298, 1044346, 68.4, 93.4, typeof(Board), 1044041, 85, 1044351);
AddSkill(index, SkillName.Tinkering, 50.0, 55.0);
AddRes(index, typeof(IronIngot), 1044036, 125, 1044037);
index = AddCraft(typeof(FlourMillEastDeed), 1044298, 1044347, 94.7, 119.7, typeof(Board), 1044041, 100, 1044351);
AddSkill(index, SkillName.Tinkering, 50.0, 55.0);
AddRes(index, typeof(IronIngot), 1044036, 50, 1044037);
index = AddCraft(typeof(FlourMillSouthDeed), 1044298, 1044348, 94.7, 119.7, typeof(Board), 1044041, 100, 1044351);
AddSkill(index, SkillName.Tinkering, 50.0, 55.0);
AddRes(index, typeof(IronIngot), 1044036, 50, 1044037);
AddCraft(typeof(WaterTroughEastDeed), 1044298, 1044349, 94.7, 119.7, typeof(Board), 1044041, 150, 1044351);
AddCraft(typeof(WaterTroughSouthDeed), 1044298, 1044350, 94.7, 119.7, typeof(Board), 1044041, 150, 1044351);
// Anvils and Forges
#region Mondain's Legacy
if (Core.ML)
{
index = AddCraft(typeof(ElvenForgeDeed), 1111809, 1072875, 94.7, 119.7, typeof(Board), 1044041, 200, 1044351);
ForceNonExceptional(index);
}
#endregion
#region SA
if (Core.SA)
{
index = AddCraft(typeof(SoulForgeDeed), 1111809, 1095827, 100.0, 200.0, typeof(Board), 1044041, 150, 1044351);
AddSkill(index, SkillName.Imbuing, 75.0, 80.0);
AddRes(index, typeof(IronIngot), 1044036, 150, 1044037);
AddRes(index, typeof(RelicFragment), 1031699, 1, 1044253);
ForceNonExceptional(index);
}
#endregion
index = AddCraft(typeof(SmallForgeDeed), 1111809, 1044330, 73.6, 98.6, typeof(Board), 1044041, 5, 1044351);
AddSkill(index, SkillName.Blacksmith, 75.0, 80.0);
AddRes(index, typeof(IronIngot), 1044036, 75, 1044037);
index = AddCraft(typeof(LargeForgeEastDeed), 1111809, 1044331, 78.9, 103.9, typeof(Board), 1044041, 5, 1044351);
AddSkill(index, SkillName.Blacksmith, 80.0, 85.0);
AddRes(index, typeof(IronIngot), 1044036, 100, 1044037);
index = AddCraft(typeof(LargeForgeSouthDeed), 1111809, 1044332, 78.9, 103.9, typeof(Board), 1044041, 5, 1044351);
AddSkill(index, SkillName.Blacksmith, 80.0, 85.0);
AddRes(index, typeof(IronIngot), 1044036, 100, 1044037);
index = AddCraft(typeof(AnvilEastDeed), 1111809, 1044333, 73.6, 98.6, typeof(Board), 1044041, 5, 1044351);
AddSkill(index, SkillName.Blacksmith, 75.0, 80.0);
AddRes(index, typeof(IronIngot), 1044036, 150, 1044037);
index = AddCraft(typeof(AnvilSouthDeed), 1111809, 1044334, 73.6, 98.6, typeof(Board), 1044041, 5, 1044351);
AddSkill(index, SkillName.Blacksmith, 75.0, 80.0);
AddRes(index, typeof(IronIngot), 1044036, 150, 1044037);
// Training
index = AddCraft(typeof(TrainingDummyEastDeed), 1044297, 1044335, 68.4, 93.4, typeof(Board), 1044041, 55, 1044351);
AddSkill(index, SkillName.Tailoring, 50.0, 55.0);
AddRes(index, typeof(Cloth), 1044286, 60, 1044287);
index = AddCraft(typeof(TrainingDummySouthDeed), 1044297, 1044336, 68.4, 93.4, typeof(Board), 1044041, 55, 1044351);
AddSkill(index, SkillName.Tailoring, 50.0, 55.0);
AddRes(index, typeof(Cloth), 1044286, 60, 1044287);
index = AddCraft(typeof(PickpocketDipEastDeed), 1044297, 1044337, 73.6, 98.6, typeof(Board), 1044041, 65, 1044351);
AddSkill(index, SkillName.Tailoring, 50.0, 55.0);
AddRes(index, typeof(Cloth), 1044286, 60, 1044287);
index = AddCraft(typeof(PickpocketDipSouthDeed), 1044297, 1044338, 73.6, 98.6, typeof(Board), 1044041, 65, 1044351);
AddSkill(index, SkillName.Tailoring, 50.0, 55.0);
AddRes(index, typeof(Cloth), 1044286, 60, 1044287);
MarkOption = true;
Repair = Core.AOS;
CanEnhance = Core.ML;
SetSubRes(typeof(Board), 1072643);
// Add every material you want the player to be able to choose from
// This will override the overridable material TODO: Verify the required skill amount
AddSubRes(typeof(Board), 1072643, 00.0, 1044041, 1072652);
AddSubRes(typeof(OakBoard), 1072644, 65.0, 1044041, 1072652);
AddSubRes(typeof(AshBoard), 1072645, 75.0, 1044041, 1072652);
AddSubRes(typeof(YewBoard), 1072646, 85.0, 1044041, 1072652);
AddSubRes(typeof(HeartwoodBoard), 1072647, 95.0, 1044041, 1072652);
AddSubRes(typeof(BloodwoodBoard), 1072648, 95.0, 1044041, 1072652);
AddSubRes(typeof(FrostwoodBoard), 1072649, 95.0, 1044041, 1072652);
}
}
}

View File

@@ -0,0 +1,191 @@
using System;
using Server.Items;
using System.Collections.Generic;
namespace Server.Engines.Craft
{
public enum CartographyRecipes
{
EodonianWallMap = 1000
}
public class DefCartography : CraftSystem
{
private static CraftSystem m_CraftSystem;
private DefCartography()
: base(1, 1, 1.25)// base( 1, 1, 3.0 )
{
}
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefCartography();
return m_CraftSystem;
}
}
public override SkillName MainSkill
{
get
{
return SkillName.Cartography;
}
}
public override int GumpTitleNumber
{
get
{
return 1044008;
}// <CENTER>CARTOGRAPHY MENU</CENTER>
}
public override double GetChanceAtMin(CraftItem item)
{
return 0.0; // 0%
}
public override int CanCraft(Mobile from, ITool tool, Type itemType)
{
int num = 0;
if (tool == null || tool.Deleted || tool.UsesRemaining <= 0)
return 1044038; // You have worn out your tool!
else if (!tool.CheckAccessible(from, ref num))
return num; // The tool must be on your person to use.
return 0;
}
public override void PlayCraftEffect(Mobile from)
{
from.PlaySound(0x249);
}
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
else
return 1044157; // You failed to create the item, but no materials were lost.
}
else
{
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
else if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
else if (quality == 2)
return 1044155; // You create an exceptional quality item.
else if (item.ItemType == typeof(StarChart))
return 1158494; // Which telescope do you wish to create the star chart from?
else
return 1044154; // You create the item.
}
}
public override void InitCraftList()
{
this.AddCraft(typeof(LocalMap), 1044448, 1015230, 10.0, 70.0, typeof(BlankMap), 1044449, 1, 1044450);
this.AddCraft(typeof(CityMap), 1044448, 1015231, 25.0, 85.0, typeof(BlankMap), 1044449, 1, 1044450);
this.AddCraft(typeof(SeaChart), 1044448, 1015232, 35.0, 95.0, typeof(BlankMap), 1044449, 1, 1044450);
this.AddCraft(typeof(WorldMap), 1044448, 1015233, 39.5, 99.5, typeof(BlankMap), 1044449, 1, 1044450);
int index = AddCraft(typeof(TatteredWallMapSouth), 1044448, 1072891, 90.0, 150.0, typeof(TreasureMap), 1073494, 10, 1073495);
AddRes(index, typeof(TreasureMap), 1073498, 5, 1073499);
AddRes(index, typeof(TreasureMap), 1073500, 3, 1073501);
AddRes(index, typeof(TreasureMap), 1073502, 1, 1073503);
AddResCallback(index, ConsumeTatteredWallMapRes);
index = AddCraft(typeof(TatteredWallMapEast), 1044448, 1072892, 90.0, 150.0, typeof(TreasureMap), 1073494, 10, 1073495);
AddRes(index, typeof(TreasureMap), 1073498, 5, 1073499);
AddRes(index, typeof(TreasureMap), 1073500, 3, 1073501);
AddRes(index, typeof(TreasureMap), 1073502, 1, 1073503);
AddResCallback(index, ConsumeTatteredWallMapRes);
index = AddCraft(typeof(EodonianWallMap), 1044448, 1156690, 65.0, 125.0, typeof(BlankMap), 1044449, 50, 1044450);
AddRes(index, typeof(UnabridgedAtlasOfEodon), 1156721, 1, 1156722);
AddRecipe(index, (int)CartographyRecipes.EodonianWallMap);
index = AddCraft(typeof(StarChart), 1044448, 1158493, 0.0, 60.0, typeof(BlankMap), 1044449, 1, 1044450);
SetForceSuccess(index, 75);
}
public int ConsumeTatteredWallMapRes(Mobile from, ConsumeType type)
{
Item[] maps = from.Backpack.FindItemsByType(typeof(TreasureMap));
List<Item> toConsume = new List<Item>();
int one = 10;
int three = 5;
int four = 3;
int five = 1;
foreach (Item item in maps)
{
TreasureMap map = item as TreasureMap;
if (map != null)
{
switch (map.Level)
{
case 1:
if (map.CompletedBy == from)
{
one--;
toConsume.Add(map);
}
break;
case 3:
if (map.CompletedBy == from)
{
three--;
toConsume.Add(map);
}
break;
case 4:
if (map.CompletedBy == from)
{
four--;
toConsume.Add(map);
}
break;
case 5:
if (map.CompletedBy == from)
{
five--;
toConsume.Add(map);
}
break;
}
}
}
int message = 0;
if (one > 0)
message = 1073495;
else if (three > 0)
message = 1073499;
else if (four > 0)
message = 1073501;
else if (five > 0)
message = 1073503;
if (message == 0 && type == ConsumeType.All)
{
foreach (Item item in toConsume)
item.Consume();
}
toConsume.Clear();
return message;
}
}
}

View File

@@ -0,0 +1,591 @@
using System;
using Server.Items;
namespace Server.Engines.Craft
{
#region Recipes
public enum CookRecipes
{
// magical
RotWormStew = 500,
GingerbreadCookie = 599,
DarkChocolateNutcracker = 600,
MilkChocolateNutcracker = 601,
WhiteChocolateNutcracker = 602,
ThreeTieredCake = 603,
BlackrockStew = 604,
Hamburger = 605,
HotDog = 606,
Sausage = 607
}
#endregion
public class DefCooking : CraftSystem
{
public override SkillName MainSkill
{
get
{
return SkillName.Cooking;
}
}
public override int GumpTitleNumber
{
get
{
return 1044003;
}// <CENTER>COOKING MENU</CENTER>
}
private static CraftSystem m_CraftSystem;
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefCooking();
return m_CraftSystem;
}
}
public override CraftECA ECA
{
get
{
return CraftECA.ChanceMinusSixtyToFourtyFive;
}
}
public override double GetChanceAtMin(CraftItem item)
{
if (item.ItemType == typeof(GrapesOfWrath) ||
item.ItemType == typeof(EnchantedApple))
{
return .5;
}
return 0.0; // 0%
}
private DefCooking()
: base(1, 1, 1.25)// base( 1, 1, 1.5 )
{
}
public override int CanCraft(Mobile from, ITool tool, Type itemType)
{
int num = 0;
if (tool == null || tool.Deleted || tool.UsesRemaining <= 0)
return 1044038; // You have worn out your tool!
else if (!tool.CheckAccessible(from, ref num))
return num; // The tool must be on your person to use.
return 0;
}
public override void PlayCraftEffect(Mobile from)
{
}
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
else
return 1044157; // You failed to create the item, but no materials were lost.
}
else
{
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
else if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
else if (quality == 2)
return 1044155; // You create an exceptional quality item.
else
return 1044154; // You create the item.
}
}
public override void InitCraftList()
{
int index = -1;
#region 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(SackFlourOpen), 1044468, 1, 1151092);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
index = AddCraft(typeof(SweetDough), 1044495, 1041340, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(JarHoney), 1044472, 1, 1044253);
index = AddCraft(typeof(CakeMix), 1044495, 1041002, 0.0, 100.0, typeof(SackFlourOpen), 1044468, 1, 1151092);
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);
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);
SetNeedOven(index, true);
}
index = AddCraft(typeof(WheatWort), 1044495, 1150275, 30.0, 100.0, typeof(Bottle), 1023854, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
AddRes(index, typeof(SackFlourOpen), 1044468, 1, 1151092);
SetItemHue(index, 1281);
#endregion
#region Preparations
index = AddCraft(typeof(UnbakedQuiche), 1044496, 1041339, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Eggs), 1044477, 1, 1044253);
// TODO: This must also support chicken and lamb legs
index = AddCraft(typeof(UnbakedMeatPie), 1044496, 1041338, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(RawRibs), 1044482, 1, 1044253);
index = AddCraft(typeof(UncookedSausagePizza), 1044496, 1041337, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Sausage), 1044483, 1, 1044253);
index = AddCraft(typeof(UncookedCheesePizza), 1044496, 1041341, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(CheeseWheel), 1044486, 1, 1044253);
index = AddCraft(typeof(UnbakedFruitPie), 1044496, 1041334, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Pear), 1044481, 1, 1044253);
index = AddCraft(typeof(UnbakedPeachCobbler), 1044496, 1041335, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Peach), 1044480, 1, 1044253);
index = AddCraft(typeof(UnbakedApplePie), 1044496, 1041336, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Apple), 1044479, 1, 1044253);
index = AddCraft(typeof(UnbakedPumpkinPie), 1044496, 1041342, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Pumpkin), 1044484, 1, 1044253);
if (Core.SE)
{
index = AddCraft(typeof(GreenTea), 1044496, 1030316, 80.0, 130.0, typeof(GreenTeaBasket), 1030316, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
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);
index = AddCraft(typeof(SushiRolls), 1044496, 1030303, 90.0, 120.0, typeof(BaseBeverage), 1046458, 1, 1044253);
AddRes(index, typeof(RawFishSteak), 1044476, 10, 1044253);
index = AddCraft(typeof(SushiPlatter), 1044496, 1030305, 90.0, 120.0, typeof(BaseBeverage), 1046458, 1, 1044253);
AddRes(index, typeof(RawFishSteak), 1044476, 10, 1044253);
}
index = AddCraft(typeof(TribalPaint), 1044496, 1040000, Core.ML ? 55.0 : 80.0, Core.ML ? 105.0 : 80.0, typeof(SackFlourOpen), 1044468, 1, 1151092);
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(SackFlourOpen), 1044468, 3, 1151092);
}
#region Mondain's Legacy
if (Core.ML)
{
index = AddCraft(typeof(ParrotWafer), 1044496, 1032246, 37.5, 87.5, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(JarHoney), 1044472, 1, 1044253);
AddRes(index, typeof(RawFishSteak), 1044476, 10, 1044253);
}
#endregion
#region SA
if (Core.SA)
{
index = AddCraft(typeof(PlantPigment), 1044496, 1112132, 75.0, 100.0, typeof(PlantClippings), 1112131, 1, 1044253);
AddRes(index, typeof(Bottle), 1023854, 1, 1044253);
SetRequireResTarget(index);
index = AddCraft(typeof(NaturalDye), 1044496, 1112136, 65.0, 115.0, typeof(PlantPigment), 1112132, 1, 1044253);
AddRes(index, typeof(ColorFixative), 1112135, 1, 1044253);
SetRequireResTarget(index);
index = AddCraft(typeof(ColorFixative), 1044496, 1112135, 75.0, 100.0, typeof(BaseBeverage), 1022503, 1, 1044253);
AddRes(index, typeof(SilverSerpentVenom), 1112173, 1, 1044253);
SetBeverageType(index, BeverageType.Wine);
index = AddCraft(typeof(WoodPulp), 1044496, 1113136, 60.0, 100.0, typeof(BarkFragment), 1032687, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
}
#endregion
#region High Seas
if (Core.HS)
{
index = AddCraft(typeof(Charcoal), 1044496, 1116303, 0.0, 50.0, typeof(Board), 1044041, 1, 1044351);
SetUseAllRes(index, true);
SetNeedHeat(index, true);
}
#endregion
#endregion
#region Baking
index = AddCraft(typeof(BreadLoaf), 1044497, 1024156, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(Cookies), 1044497, 1025643, 0.0, 100.0, typeof(CookieMix), 1044474, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(Cake), 1044497, 1022537, 0.0, 100.0, typeof(CakeMix), 1044471, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(Muffins), 1044497, 1022539, 0.0, 100.0, typeof(SweetDough), 1044475, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(Quiche), 1044497, 1041345, 0.0, 100.0, typeof(UnbakedQuiche), 1044518, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(MeatPie), 1044497, 1041347, 0.0, 100.0, typeof(UnbakedMeatPie), 1044519, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(SausagePizza), 1044497, 1044517, 0.0, 100.0, typeof(UncookedSausagePizza), 1044520, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(CheesePizza), 1044497, 1044516, 0.0, 100.0, typeof(UncookedCheesePizza), 1044521, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(FruitPie), 1044497, 1041346, 0.0, 100.0, typeof(UnbakedFruitPie), 1044522, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(PeachCobbler), 1044497, 1041344, 0.0, 100.0, typeof(UnbakedPeachCobbler), 1044523, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(ApplePie), 1044497, 1041343, 0.0, 100.0, typeof(UnbakedApplePie), 1044524, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(PumpkinPie), 1044497, 1041348, 0.0, 100.0, typeof(UnbakedPumpkinPie), 1046461, 1, 1044253);
SetNeedOven(index, true);
if (Core.SE)
{
index = AddCraft(typeof(MisoSoup), 1044497, 1030317, 60.0, 110.0, typeof(RawFishSteak), 1044476, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
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);
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);
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);
SetNeedOven(index, true);
}
index = AddCraft(typeof(GingerBreadCookie), 1044497, 1031233, 35.0, 85.0, typeof(CookieMix), 1044474, 1, 1044253);
AddRes(index, typeof(FreshGinger), 1031235, 1, 1044253);
AddRecipe(index, (int)CookRecipes.GingerbreadCookie);
SetNeedOven(index, true);
index = AddCraft(typeof(ThreeTieredCake), 1044497, 1154465, 60.0, 110.0, typeof(CakeMix), 1044471, 3, 1044253);
AddRecipe(index, (int)CookRecipes.ThreeTieredCake);
SetNeedOven(index, true);
#endregion
#region Barbecue
index = AddCraft(typeof(CookedBird), 1044498, 1022487, 0.0, 100.0, typeof(RawBird), 1044470, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
ForceNonExceptional(index);
index = AddCraft(typeof(ChickenLeg), 1044498, 1025640, 0.0, 100.0, typeof(RawChickenLeg), 1044473, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
ForceNonExceptional(index);
index = AddCraft(typeof(FishSteak), 1044498, 1022427, 0.0, 100.0, typeof(RawFishSteak), 1044476, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
ForceNonExceptional(index);
index = AddCraft(typeof(FriedEggs), 1044498, 1022486, 0.0, 100.0, typeof(Eggs), 1044477, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
ForceNonExceptional(index);
index = AddCraft(typeof(LambLeg), 1044498, 1025642, 0.0, 100.0, typeof(RawLambLeg), 1044478, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
ForceNonExceptional(index);
index = AddCraft(typeof(Ribs), 1044498, 1022546, 0.0, 100.0, typeof(RawRibs), 1044485, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
ForceNonExceptional(index);
if (Core.SA)
{
index = AddCraft(typeof(BowlOfRotwormStew), 1044498, 1031706, 0.0, 100.0, typeof(RawRotwormMeat), 1031705, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
AddRecipe(index, (int)CookRecipes.RotWormStew);
ForceNonExceptional(index);
index = AddCraft(typeof(BowlOfBlackrockStew), 1044498, 1115752, 30.0, 70.0, typeof(BowlOfRotwormStew), 1031706, 1, 1044253);
AddRes(index, typeof(SmallPieceofBlackrock), 1153836, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
SetItemHue(index, 1954);
AddRecipe(index, (int)CookRecipes.BlackrockStew);
ForceNonExceptional(index);
}
if (Core.EJ)
{
index = AddCraft(typeof(KhaldunTastyTreat), 1044498, 1158680, 60.0, 100.0, typeof(RawFishSteak), 1044476, 40, 1044253);
SetUseAllRes(index, true);
SetNeedHeat(index, true);
}
if (Core.TOL)
{
index = AddCraft(typeof(Hamburger), 1044498, 1125202, 40.0, 80.0, typeof(BreadLoaf), 1024155, 1, 1044253);
AddRes(index, typeof(RawRibs), 1044485, 1, 1044253);
AddRes(index, typeof(Lettuce), 1023184, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
AddRecipe(index, (int)CookRecipes.Hamburger);
index = AddCraft(typeof(HotDog), 1044498, 1125200, 40.0, 80.0, typeof(BreadLoaf), 1024155, 1, 1044253);
AddRes(index, typeof(Sausage), 1125198, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
AddRecipe(index, (int)CookRecipes.HotDog);
index = AddCraft(typeof(CookableSausage), 1044498, 1125198, 30.0, 70.0, typeof(Ham), 1022515, 1, 1044253);
AddRes(index, typeof(DriedHerbs), 1023137, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
AddRecipe(index, (int)CookRecipes.Sausage);
}
#endregion
#region Enchanted
if (Core.ML)
{
index = AddCraft(typeof(FoodEngraver), 1073108, 1072951, 75.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(JarHoney), 1044472, 1, 1044253);
index = AddCraft(typeof(EnchantedApple), 1073108, 1072952, 60.0, 85.0, typeof(Apple), 1044479, 1, 1044253);
AddRes(index, typeof(GreaterHealPotion), 1073467, 1, 1044253);
ForceNonExceptional(index);
index = AddCraft(typeof(GrapesOfWrath), 1073108, 1072953, 95.0, 120.0, typeof(Grapes), 1073468, 1, 1044253);
AddRes(index, typeof(GreaterStrengthPotion), 1073466, 1, 1044253);
ForceNonExceptional(index);
index = AddCraft(typeof(FruitBowl), 1073108, 1072950, 55.0, 105.0, typeof(EmptyWoodenBowl), 1073472, 1, 1044253);
AddRes(index, typeof(Pear), 1044481, 3, 1044253);
AddRes(index, typeof(Apple), 1044479, 3, 1044253);
AddRes(index, typeof(Banana), 1073470, 3, 1044253);
}
#endregion
#region Chocolatiering
if (Core.ML)
{
if (Core.TOL)
{
index = AddCraft(typeof(SweetCocoaButter), 1080001, 1156401, 15.0, 100.0, typeof(SackOfSugar), 1079997, 1, 1044253);
AddRes(index, typeof(CocoaButter), 1079998, 1, 1044253);
SetItemHue(index, 0x457);
SetNeedOven(index, true);
}
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);
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);
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);
#region TOL
if (Core.TOL)
{
index = AddCraft(typeof(ChocolateNutcracker), 1080001, 1156390, 15.0, 100.0, typeof(SweetCocoaButter), 1156401, 1, 1044253);
AddRes(index, typeof(SweetCocoaButter), 1124032, 1, 1156402);
AddRes(index, typeof(CocoaLiquor), 1079999, 1, 1044253);
AddRecipe(index, (int)CookRecipes.DarkChocolateNutcracker);
SetData(index, ChocolateNutcracker.ChocolateType.Dark);
index = AddCraft(typeof(ChocolateNutcracker), 1080001, 1156391, 32.5, 107.5, typeof(SweetCocoaButter), 1156401, 1, 1044253);
AddRes(index, typeof(SweetCocoaButter), 1124032, 1, 1156402);
AddRes(index, typeof(CocoaLiquor), 1079999, 1, 1044253);
AddRecipe(index, (int)CookRecipes.MilkChocolateNutcracker);
SetData(index, ChocolateNutcracker.ChocolateType.Milk);
index = AddCraft(typeof(ChocolateNutcracker), 1080001, 1156392, 52.5, 127.5, typeof(SweetCocoaButter), 1156401, 1, 1044253);
AddRes(index, typeof(SweetCocoaButter), 1124032, 1, 1156402);
AddRes(index, typeof(CocoaLiquor), 1079999, 1, 1044253);
AddRecipe(index, (int)CookRecipes.WhiteChocolateNutcracker);
SetData(index, ChocolateNutcracker.ChocolateType.White);
}
#endregion
}
#endregion
#region Fish Pies
if (Core.SA)
{
index = AddCraft(typeof(GreatBarracudaPie), 1116340, 1116214, 61.0, 110.0, typeof(GreatBarracudaSteak), 1116298, 1, 1044253);
AddRes(index, typeof(MentoSeasoning), 1116299, 1, 1044253);
AddRes(index, typeof(ZoogiFungus), 1029911, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(GiantKoiPie), 1116340, 1116216, 61.0, 110.0, typeof(GiantKoiSteak), 1044253, 1, 1044253);
AddRes(index, typeof(MentoSeasoning), 1116299, 1, 1044253);
AddRes(index, typeof(WoodenBowlOfPeas), 1025628, 1, 1044253);
AddRes(index, typeof(Dough), 1024157, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(FireFishPie), 1116340, 1116217, 55.0, 105.0, typeof(FireFishSteak), 1116307, 1, 1044253);
AddRes(index, typeof(Dough), 1024157, 1, 1044253);
AddRes(index, typeof(Carrot), 1023191, 1, 1044253);
AddRes(index, typeof(SamuelsSecretSauce), 1116338, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(StoneCrabPie), 1116340, 1116227, 55.0, 105.0, typeof(StoneCrabMeat), 1116317, 1, 1044253);
AddRes(index, typeof(Dough), 1024157, 1, 1044253);
AddRes(index, typeof(Cabbage), 1023195, 1, 1044253);
AddRes(index, typeof(SamuelsSecretSauce), 1116338, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(BlueLobsterPie), 1116340, 1116228, 55.0, 105.0, typeof(BlueLobsterMeat), 1116318, 1, 1044253);
AddRes(index, typeof(Dough), 1024157, 1, 1044253);
AddRes(index, typeof(TribalBerry), 1040001, 1, 1044253);
AddRes(index, typeof(SamuelsSecretSauce), 1116338, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(ReaperFishPie), 1116340, 1116218, 55.0, 105.0, typeof(ReaperFishSteak), 1116308, 1, 1044253);
AddRes(index, typeof(Dough), 1024157, 1, 1044253);
AddRes(index, typeof(Pumpkin), 1023178, 1, 1044253);
AddRes(index, typeof(SamuelsSecretSauce), 1116338, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(CrystalFishPie), 1116340, 1116219, 55.0, 105.0, typeof(CrystalFishSteak), 1116309, 1, 1044253);
AddRes(index, typeof(Dough), 1024157, 1, 1044253);
AddRes(index, typeof(Apple), 1022512, 1, 1044253);
AddRes(index, typeof(SamuelsSecretSauce), 1116338, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(BullFishPie), 1116340, 1116220, 55.0, 105.0, typeof(BullFishSteak), 1116310, 1, 1044253);
AddRes(index, typeof(Dough), 1024157, 1, 1044253);
AddRes(index, typeof(Squash), 1023186, 1, 1044253);
AddRes(index, typeof(MentoSeasoning), 1116299, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(SummerDragonfishPie), 1116340, 1116221, 55.0, 105.0, typeof(SummerDragonfishSteak), 1116311, 1, 1044253);
AddRes(index, typeof(Dough), 1024157, 1, 1044253);
AddRes(index, typeof(Onion), 1023182, 1, 1044253);
AddRes(index, typeof(MentoSeasoning), 1116299, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(FairySalmonPie), 1116340, 1116222, 55.0, 105.0, typeof(FairySalmonSteak), 1116312, 1, 1044253);
AddRes(index, typeof(Dough), 1024157, 1, 1044253);
AddRes(index, typeof(EarOfCorn), 1023199, 1, 1044253);
AddRes(index, typeof(DarkTruffle), 1116300, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(LavaFishPie), 1116340, 1116223, 55.0, 105.0, typeof(LavaFishSteak), 1116313, 1, 1044253);
AddRes(index, typeof(Dough), 1024157, 1, 1044253);
AddRes(index, typeof(CheeseWheel), 1044486, 1, 1044253);
AddRes(index, typeof(DarkTruffle), 1116300, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(AutumnDragonfishPie), 1116340, 1116224, 55.0, 105.0, typeof(AutumnDragonfishSteak), 1116314, 1, 1044253);
AddRes(index, typeof(Dough), 1024157, 1, 1044253);
AddRes(index, typeof(Pear), 1022452, 1, 1044253);
AddRes(index, typeof(MentoSeasoning), 1116299, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(SpiderCrabPie), 1116340, 1116229, 55.0, 105.0, typeof(SpiderCrabMeat), 1116320, 1, 1044253);
AddRes(index, typeof(Dough), 1024157, 1, 1044253);
AddRes(index, typeof(Lettuce), 1023184, 1, 1044253);
AddRes(index, typeof(MentoSeasoning), 1116299, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(YellowtailBarracudaPie), 1116340, 1116098, 55.0, 105.0, typeof(YellowtailBarracudaSteak), 1116301, 1, 1044253);
AddRes(index, typeof(Dough), 1024157, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1022503, 1, 1044253);
AddRes(index, typeof(MentoSeasoning), 1116299, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(HolyMackerelPie), 1116340, 1116225, 55.0, 105.0, typeof(HolyMackerelSteak), 1116315, 1, 1044253);
AddRes(index, typeof(Dough), 1024157, 1, 1044253);
AddRes(index, typeof(JarHoney), 1022540, 1, 1044253);
AddRes(index, typeof(MentoSeasoning), 1116299, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft(typeof(UnicornFishPie), 1116340, 1116226, 55.0, 105.0, typeof(UnicornFishSteak), 1116316, 1, 1044253);
AddRes(index, typeof(Dough), 1024157, 1, 1044253);
AddRes(index, typeof(FreshGinger), 1031235, 1, 1044253);
AddRes(index, typeof(MentoSeasoning), 1116299, 1, 1044253);
SetNeedOven(index, true);
}
#endregion
#region Bevereages
index = AddCraft(typeof(CoffeeMug), 1155736, 1155737, 0.0, 28.58, typeof(CoffeeGrounds), 1155735, 1, 1155734);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
SetBeverageType(index, BeverageType.Water);
SetNeedMaker(index, true);
ForceNonExceptional(index);
index = AddCraft(typeof(BasketOfGreenTeaMug), 1155736, 1030315, 0.0, 28.58, typeof(GreenTeaBasket), 1155735, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
SetBeverageType(index, BeverageType.Water);
SetNeedMaker(index, true);
ForceNonExceptional(index);
index = AddCraft(typeof(HotCocoaMug), 1155736, 1155738, 0.0, 28.58, typeof(CocoaLiquor), 1080007, 1, 1080006);
AddRes(index, typeof(SackOfSugar), 1080003, 1, 1080002);
AddRes(index, typeof(BaseBeverage), 1080011, 1, 1080010);
SetBeverageType(index, BeverageType.Milk);
SetNeedMaker(index, true);
ForceNonExceptional(index);
#endregion
}
}
}

View File

@@ -0,0 +1,178 @@
using System;
using Server.Items;
using Server.Mobiles;
namespace Server.Engines.Craft
{
public class DefGlassblowing : CraftSystem
{
private static CraftSystem m_CraftSystem;
private DefGlassblowing()
: base(1, 1, 1.25)// base( 1, 2, 1.7 )
{
}
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefGlassblowing();
return m_CraftSystem;
}
}
public override SkillName MainSkill
{
get
{
return SkillName.Alchemy;
}
}
public override int GumpTitleNumber
{
get
{
return 1044622;
}// <CENTER>Glassblowing MENU</CENTER>
}
public override double GetChanceAtMin(CraftItem item)
{
if (item.ItemType == typeof(HollowPrism))
return 0.5; // 50%
if (item.ItemType == typeof(EtherealSoulbinder))
return 0.1; // 10%
return 0.0; // 0%
}
public override int CanCraft(Mobile from, ITool tool, Type itemType)
{
int num = 0;
if (tool == null || tool.Deleted || tool.UsesRemaining <= 0)
return 1044038; // You have worn out your tool!
else if (tool is Item && !BaseTool.CheckTool((Item)tool, from))
return 1048146; // If you have a tool equipped, you must use that tool.
else if (!(from is PlayerMobile && ((PlayerMobile)from).Glassblowing && from.Skills[SkillName.Alchemy].Base >= 100.0))
return 1044634; // You havent learned glassblowing.
else if (!tool.CheckAccessible(from, ref num))
return num; // The tool must be on your person to use.
bool anvil, forge;
DefBlacksmithy.CheckAnvilAndForge(from, 2, out anvil, out forge);
if (forge)
return 0;
return 1044628; // You must be near a forge to blow glass.
}
public override void PlayCraftEffect(Mobile from)
{
from.PlaySound(0x2B); // bellows
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
// from.Animate( 9, 5, 1, true, false, 0 );
//new InternalTimer( from ).Start();
}
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
else
return 1044157; // You failed to create the item, but no materials were lost.
}
else
{
from.PlaySound(0x41); // glass breaking
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
else if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
else if (quality == 2)
return 1044155; // You create an exceptional quality item.
else
return 1044154; // You create the item.
}
}
public override void InitCraftList()
{
int index = AddCraft(typeof(Bottle), 1044050, 1023854, 52.5, 102.5, typeof(Sand), 1044625, 1, 1044627);
SetUseAllRes(index, true);
AddCraft(typeof(SmallFlask), 1044050, 1044610, 52.5, 102.5, typeof(Sand), 1044625, 2, 1044627);
AddCraft(typeof(MediumFlask), 1044050, 1044611, 52.5, 102.5, typeof(Sand), 1044625, 3, 1044627);
AddCraft(typeof(CurvedFlask), 1044050, 1044612, 55.0, 105.0, typeof(Sand), 1044625, 2, 1044627);
AddCraft(typeof(LongFlask), 1044050, 1044613, 57.5, 107.5, typeof(Sand), 1044625, 4, 1044627);
AddCraft(typeof(LargeFlask), 1044050, 1044623, 60.0, 110.0, typeof(Sand), 1044625, 5, 1044627);
AddCraft(typeof(AniSmallBlueFlask), 1044050, 1044614, 60.0, 110.0, typeof(Sand), 1044625, 5, 1044627);
AddCraft(typeof(AniLargeVioletFlask), 1044050, 1044615, 60.0, 110.0, typeof(Sand), 1044625, 5, 1044627);
AddCraft(typeof(AniRedRibbedFlask), 1044050, 1044624, 60.0, 110.0, typeof(Sand), 1044625, 7, 1044627);
AddCraft(typeof(EmptyVialsWRack), 1044050, 1044616, 65.0, 115.0, typeof(Sand), 1044625, 8, 1044627);
AddCraft(typeof(FullVialsWRack), 1044050, 1044617, 65.0, 115.0, typeof(Sand), 1044625, 9, 1044627);
AddCraft(typeof(SpinningHourglass), 1044050, 1044618, 75.0, 125.0, typeof(Sand), 1044625, 10, 1044627);
if (Core.ML)
{
index = AddCraft(typeof(HollowPrism), 1044050, 1072895, 100.0, 150.0, typeof(Sand), 1044625, 8, 1044627);
}
if (Core.SA)
{
index = AddCraft(typeof(GargoyleFloorMirror), 1044050, 1095314, 75.0, 125.0, typeof(Sand), 1044625, 20, 1044627);
index = AddCraft(typeof(GargoyleWallMirror), 1044050, 1095324, 70.0, 120.0, typeof(Sand), 1044625, 10, 1044627);
index = AddCraft(typeof(SoulstoneFragment), 1044050, 1071000, 70.0, 120.0, typeof(CrystalGranules), 1112329, 2, 1044253);
AddRes(index, typeof(VoidEssence), 1112327, 2, 1044253);
SetItemHue(index, 1150);
index = AddCraft(typeof(EmptyVenomVial), 1044050, 1112215, 52.5, 102.5, typeof(Sand), 1044625, 1, 1044627);
index = AddCraft(typeof(EmptyOilFlask), 1044050, 1150866, 60.0, 110.0, typeof(Sand), 1044625, 5, 1044627);
index = AddCraft(typeof(WorkableGlass), 1044050, 1154170, 55.0, 105.0, typeof(Sand), 1044625, 10, 1044627);
if (Core.EJ)
{
index = AddCraft(typeof(EtherealSoulbinder), 1044050, 1159167, 100.0, 190.0, typeof(Sand), 1044625, 20, 1044627);
AddRes(index, typeof(EtherealSand), 1125984, 5, 1159169);
}
//Glass Weapons
index = AddCraft(typeof(GlassSword), 1111745, 1022316, 55.0, 105.0, typeof(Sand), 1044625, 14, 1044627);
index = AddCraft(typeof(GlassStaff), 1111745, 1095368, 53.6, 103.6, typeof(Sand), 1044625, 10, 1044627);
}
Repair = Core.SA;
MarkOption = Core.SA;
}
// Delay to synchronize the sound with the hit on the anvil
private class InternalTimer : Timer
{
private readonly Mobile m_From;
public InternalTimer(Mobile from)
: base(TimeSpan.FromSeconds(0.7))
{
m_From = from;
}
protected override void OnTick()
{
m_From.PlaySound(0x2A);
}
}
}
}

View File

@@ -0,0 +1,469 @@
using System;
using Server.Items;
using Server.Spells;
namespace Server.Engines.Craft
{
public enum InscriptionRecipes
{
RunicAtlas = 800
}
public class DefInscription : CraftSystem
{
public override SkillName MainSkill
{
get
{
return SkillName.Inscribe;
}
}
public override int GumpTitleNumber
{
get
{
return 1044009;
}// <CENTER>INSCRIPTION MENU</CENTER>
}
private static CraftSystem m_CraftSystem;
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefInscription();
return m_CraftSystem;
}
}
public override double GetChanceAtMin(CraftItem item)
{
return 0.0; // 0%
}
private DefInscription()
: base(1, 1, 1.25)// base( 1, 1, 3.0 )
{
}
public override int CanCraft(Mobile from, ITool tool, Type typeItem)
{
int num = 0;
if (tool == null || tool.Deleted || tool.UsesRemaining <= 0)
return 1044038; // You have worn out your tool!
else if (!tool.CheckAccessible(from, ref num))
return num; // The tool must be on your person to use.
if (typeItem != null && typeItem.IsSubclassOf(typeof(SpellScroll)))
{
if (!_Buffer.ContainsKey(typeItem))
{
object o = Activator.CreateInstance(typeItem);
if (o is SpellScroll)
{
SpellScroll scroll = (SpellScroll)o;
_Buffer[typeItem] = scroll.SpellID;
scroll.Delete();
}
else if (o is IEntity)
{
((IEntity)o).Delete();
return 1042404; // You don't have that spell!
}
}
int id = _Buffer[typeItem];
Spellbook book = Spellbook.Find(from, id);
if (book == null || !book.HasSpell(id))
return 1042404; // You don't have that spell!
}
return 0;
}
private System.Collections.Generic.Dictionary<Type, int> _Buffer = new System.Collections.Generic.Dictionary<Type, int>();
public override void PlayCraftEffect(Mobile from)
{
from.PlaySound(0x249);
}
private static readonly Type typeofSpellScroll = typeof(SpellScroll);
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if (!typeofSpellScroll.IsAssignableFrom(item.ItemType)) // not a scroll
{
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
else
return 1044157; // You failed to create the item, but no materials were lost.
}
else
{
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
else if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
else if (quality == 2)
return 1044155; // You create an exceptional quality item.
else
return 1044154; // You create the item.
}
}
else
{
if (failed)
return 501630; // You fail to inscribe the scroll, and the scroll is ruined.
else
return 501629; // You inscribe the spell and put the scroll in your backpack.
}
}
private int m_Circle, m_Mana;
private enum Reg { BlackPearl, Bloodmoss, Garlic, Ginseng, MandrakeRoot, Nightshade, SulfurousAsh, SpidersSilk, BatWing, GraveDust, DaemonBlood, NoxCrystal, PigIron, Bone, DragonBlood, FertileDirt, DaemonBone }
private readonly Type[] m_RegTypes = new Type[]
{
typeof( BlackPearl ),
typeof( Bloodmoss ),
typeof( Garlic ),
typeof( Ginseng ),
typeof( MandrakeRoot ),
typeof( Nightshade ),
typeof( SulfurousAsh ),
typeof( SpidersSilk ),
typeof( BatWing ),
typeof( GraveDust ),
typeof( DaemonBlood ),
typeof( NoxCrystal ),
typeof( PigIron ),
typeof( Bone ),
typeof( DragonBlood ),
typeof( FertileDirt ),
typeof( DaemonBone )
};
private int m_Index;
private void AddSpell(Type type, params Reg[] regs)
{
double minSkill, maxSkill;
int cliloc;
switch (m_Circle)
{
default:
case 0: minSkill = -25.0; maxSkill = 25.0; cliloc = 1111691; break;
case 1: minSkill = -10.8; maxSkill = 39.2; cliloc = 1111691; break;
case 2: minSkill = 03.5; maxSkill = 53.5; cliloc = 1111692; break;
case 3: minSkill = 17.8; maxSkill = 67.8; cliloc = 1111692; break;
case 4: minSkill = 32.1; maxSkill = 82.1; cliloc = 1111693; break;
case 5: minSkill = 46.4; maxSkill = 96.4; cliloc = 1111693; break;
case 6: minSkill = 60.7; maxSkill = 110.7; cliloc = 1111694; break;
case 7: minSkill = 75.0; maxSkill = 125.0; cliloc = 1111694; break;
}
int index = AddCraft(type, cliloc, 1044381 + m_Index++, minSkill, maxSkill, m_RegTypes[(int)regs[0]], 1044353 + (int)regs[0], 1, 1044361 + (int)regs[0]);
for (int i = 1; i < regs.Length; ++i)
AddRes(index, m_RegTypes[(int)regs[i]], 1044353 + (int)regs[i], 1, 1044361 + (int)regs[i]);
AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378);
SetManaReq(index, m_Mana);
}
private void AddNecroSpell(int spell, int mana, double minSkill, Type type, params Reg[] regs)
{
int id = GetRegLocalization(regs[0]);
int index = AddCraft(type, 1061677, 1060509 + spell, minSkill, minSkill + 1.0, m_RegTypes[(int)regs[0]], id, 1, 501627);
for (int i = 1; i < regs.Length; ++i)
{
id = GetRegLocalization(regs[i]);
AddRes(index, m_RegTypes[(int)regs[i]], id, 1, 501627);
}
AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378);
SetManaReq(index, mana);
}
private void AddMysticSpell(int id, int mana, double minSkill, Type type, params Reg[] regs)
{
int index = AddCraft(type, 1111671, id, minSkill, minSkill + 1.0, m_RegTypes[(int)regs[0]], GetRegLocalization(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, m_RegTypes[(int)regs[i]], GetRegLocalization(regs[i]), 1, 501627);
AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378);
SetManaReq(index, mana);
}
private int GetRegLocalization(Reg reg)
{
int loc = 0;
switch (reg)
{
case Reg.BatWing: loc = 1023960; break;
case Reg.GraveDust: loc = 1023983; break;
case Reg.DaemonBlood: loc = 1023965; break;
case Reg.NoxCrystal: loc = 1023982; break;
case Reg.PigIron: loc = 1023978; break;
case Reg.Bone: loc = 1023966; break;
case Reg.DragonBlood: loc = 1023970; break;
case Reg.FertileDirt: loc = 1023969; break;
case Reg.DaemonBone: loc = 1023968; break;
}
if (loc == 0)
loc = 1044353 + (int)reg;
return loc;
}
public override void InitCraftList()
{
m_Circle = 0;
m_Mana = 4;
AddSpell(typeof(ReactiveArmorScroll), Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(ClumsyScroll), Reg.Bloodmoss, Reg.Nightshade);
AddSpell(typeof(CreateFoodScroll), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot);
AddSpell(typeof(FeeblemindScroll), Reg.Nightshade, Reg.Ginseng);
AddSpell(typeof(HealScroll), Reg.Garlic, Reg.Ginseng, Reg.SpidersSilk);
AddSpell(typeof(MagicArrowScroll), Reg.SulfurousAsh);
AddSpell(typeof(NightSightScroll), Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(WeakenScroll), Reg.Garlic, Reg.Nightshade);
m_Circle = 1;
m_Mana = 6;
AddSpell(typeof(AgilityScroll), Reg.Bloodmoss, Reg.MandrakeRoot);
AddSpell(typeof(CunningScroll), Reg.Nightshade, Reg.MandrakeRoot);
AddSpell(typeof(CureScroll), Reg.Garlic, Reg.Ginseng);
AddSpell(typeof(HarmScroll), Reg.Nightshade, Reg.SpidersSilk);
AddSpell(typeof(MagicTrapScroll), Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(MagicUnTrapScroll), Reg.Bloodmoss, Reg.SulfurousAsh);
AddSpell(typeof(ProtectionScroll), Reg.Garlic, Reg.Ginseng, Reg.SulfurousAsh);
AddSpell(typeof(StrengthScroll), Reg.Nightshade, Reg.MandrakeRoot);
m_Circle = 2;
m_Mana = 9;
AddSpell(typeof(BlessScroll), Reg.Garlic, Reg.MandrakeRoot);
AddSpell(typeof(FireballScroll), Reg.BlackPearl);
AddSpell(typeof(MagicLockScroll), Reg.Bloodmoss, Reg.Garlic, Reg.SulfurousAsh);
AddSpell(typeof(PoisonScroll), Reg.Nightshade);
AddSpell(typeof(TelekinisisScroll), Reg.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;
AddSpell(typeof(ArchCureScroll), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot);
AddSpell(typeof(ArchProtectionScroll), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot, Reg.SulfurousAsh);
AddSpell(typeof(CurseScroll), Reg.Garlic, Reg.Nightshade, Reg.SulfurousAsh);
AddSpell(typeof(FireFieldScroll), Reg.BlackPearl, Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(GreaterHealScroll), Reg.Garlic, Reg.SpidersSilk, Reg.MandrakeRoot, Reg.Ginseng);
AddSpell(typeof(LightningScroll), Reg.MandrakeRoot, Reg.SulfurousAsh);
AddSpell(typeof(ManaDrainScroll), Reg.BlackPearl, Reg.SpidersSilk, Reg.MandrakeRoot);
AddSpell(typeof(RecallScroll), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot);
m_Circle = 4;
m_Mana = 14;
AddSpell(typeof(BladeSpiritsScroll), Reg.BlackPearl, Reg.Nightshade, Reg.MandrakeRoot);
AddSpell(typeof(DispelFieldScroll), Reg.BlackPearl, Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(IncognitoScroll), Reg.Bloodmoss, Reg.Garlic, Reg.Nightshade);
AddSpell(typeof(MagicReflectScroll), Reg.Garlic, Reg.MandrakeRoot, Reg.SpidersSilk);
AddSpell(typeof(MindBlastScroll), Reg.BlackPearl, Reg.MandrakeRoot, Reg.Nightshade, Reg.SulfurousAsh);
AddSpell(typeof(ParalyzeScroll), Reg.Garlic, Reg.MandrakeRoot, Reg.SpidersSilk);
AddSpell(typeof(PoisonFieldScroll), Reg.BlackPearl, Reg.Nightshade, Reg.SpidersSilk);
AddSpell(typeof(SummonCreatureScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk);
m_Circle = 5;
m_Mana = 20;
AddSpell(typeof(DispelScroll), Reg.Garlic, Reg.MandrakeRoot, Reg.SulfurousAsh);
AddSpell(typeof(EnergyBoltScroll), Reg.BlackPearl, Reg.Nightshade);
AddSpell(typeof(ExplosionScroll), Reg.Bloodmoss, Reg.MandrakeRoot);
AddSpell(typeof(InvisibilityScroll), Reg.Bloodmoss, Reg.Nightshade);
AddSpell(typeof(MarkScroll), Reg.Bloodmoss, Reg.BlackPearl, Reg.MandrakeRoot);
AddSpell(typeof(MassCurseScroll), Reg.Garlic, Reg.MandrakeRoot, Reg.Nightshade, Reg.SulfurousAsh);
AddSpell(typeof(ParalyzeFieldScroll), Reg.BlackPearl, Reg.Ginseng, Reg.SpidersSilk);
AddSpell(typeof(RevealScroll), Reg.Bloodmoss, Reg.SulfurousAsh);
m_Circle = 6;
m_Mana = 40;
AddSpell(typeof(ChainLightningScroll), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SulfurousAsh);
AddSpell(typeof(EnergyFieldScroll), Reg.BlackPearl, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(FlamestrikeScroll), Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(GateTravelScroll), Reg.BlackPearl, Reg.MandrakeRoot, Reg.SulfurousAsh);
AddSpell(typeof(ManaVampireScroll), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk);
AddSpell(typeof(MassDispelScroll), Reg.BlackPearl, Reg.Garlic, Reg.MandrakeRoot, Reg.SulfurousAsh);
AddSpell(typeof(MeteorSwarmScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SulfurousAsh, Reg.SpidersSilk);
AddSpell(typeof(PolymorphScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk);
m_Circle = 7;
m_Mana = 50;
AddSpell(typeof(EarthquakeScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.Ginseng, Reg.SulfurousAsh);
AddSpell(typeof(EnergyVortexScroll), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.Nightshade);
AddSpell(typeof(ResurrectionScroll), Reg.Bloodmoss, Reg.Garlic, Reg.Ginseng);
AddSpell(typeof(SummonAirElementalScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk);
AddSpell(typeof(SummonDaemonScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(SummonEarthElementalScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk);
AddSpell(typeof(SummonFireElementalScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(SummonWaterElementalScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk);
if (Core.SE)
{
AddNecroSpell(0, 23, 39.6, typeof(AnimateDeadScroll), Reg.GraveDust, Reg.DaemonBlood);
AddNecroSpell(1, 13, 19.6, typeof(BloodOathScroll), Reg.DaemonBlood);
AddNecroSpell(2, 11, 19.6, typeof(CorpseSkinScroll), Reg.BatWing, Reg.GraveDust);
AddNecroSpell(3, 7, 19.6, typeof(CurseWeaponScroll), Reg.PigIron);
AddNecroSpell(4, 11, 19.6, typeof(EvilOmenScroll), Reg.BatWing, Reg.NoxCrystal);
AddNecroSpell(5, 11, 39.6, typeof(HorrificBeastScroll), Reg.BatWing, Reg.DaemonBlood);
AddNecroSpell(6, 23, 69.6, typeof(LichFormScroll), Reg.GraveDust, Reg.DaemonBlood, Reg.NoxCrystal);
AddNecroSpell(7, 17, 29.6, typeof(MindRotScroll), Reg.BatWing, Reg.DaemonBlood, Reg.PigIron);
AddNecroSpell(8, 5, 19.6, typeof(PainSpikeScroll), Reg.GraveDust, Reg.PigIron);
AddNecroSpell(9, 17, 49.6, typeof(PoisonStrikeScroll), Reg.NoxCrystal);
AddNecroSpell(10, 29, 64.6, typeof(StrangleScroll), Reg.DaemonBlood, Reg.NoxCrystal);
AddNecroSpell(11, 17, 29.6, typeof(SummonFamiliarScroll), Reg.BatWing, Reg.GraveDust, Reg.DaemonBlood);
AddNecroSpell(12, 23, 98.6, typeof(VampiricEmbraceScroll), Reg.BatWing, Reg.NoxCrystal, Reg.PigIron);
AddNecroSpell(13, 41, 79.6, typeof(VengefulSpiritScroll), Reg.BatWing, Reg.GraveDust, Reg.PigIron);
AddNecroSpell(14, 23, 59.6, typeof(WitherScroll), Reg.GraveDust, Reg.NoxCrystal, Reg.PigIron);
AddNecroSpell(15, 17, 19.6, typeof(WraithFormScroll), Reg.NoxCrystal, Reg.PigIron);
AddNecroSpell(16, 40, 79.6, typeof(ExorcismScroll), Reg.NoxCrystal, Reg.GraveDust);
}
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);
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);
}
// 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);
#region TOL
if (Core.TOL)
{
index = AddCraft(typeof(RunicAtlas), 1044294, 1156443, 45.0, 95.0, typeof(BlankScroll), 1044377, 24, 1044378);
AddRes(index, typeof(RecallRune), 1044447, 3, 1044253);
AddRes(index, typeof(RecallScroll), 1044445, 3, 1044253);
AddRes(index, typeof(GateTravelScroll), 1044446, 3, 1044253);
AddRecipe(index, (int)InscriptionRecipes.RunicAtlas);
}
#endregion
if (Core.AOS)
{
AddCraft(typeof(Engines.BulkOrders.BulkOrderBook), 1044294, 1028793, 65.0, 115.0, typeof(BlankScroll), 1044377, 10, 1044378);
}
if (Core.SE)
{
AddCraft(typeof(Spellbook), 1044294, 1023834, 50.0, 126, typeof(BlankScroll), 1044377, 10, 1044378);
}
#region Mondain's Legacy
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);
AddRecipe(index, (int)TinkerRecipes.ScrappersCompendium);
ForceNonExceptional(index);
index = AddCraft(typeof(SpellbookEngraver), 1044294, 1072151, 75.0, 100.0, typeof(Feather), 1044562, 1, 1044563);
AddRes(index, typeof(BlackPearl), 1015001, 7, 1044253);
AddCraft(typeof(NecromancerSpellbook), 1044294, 1074909, 50.0, 100.0, typeof(BlankScroll), 1044377, 10, 1044378);
AddCraft(typeof(MysticBook), 1044294, 1031677, 50.0, 100.0, typeof(BlankScroll), 1044377, 10, 1044378);
}
#endregion
#region Stygian Abyss
if (Core.SA)
{
index = AddCraft(typeof(ExodusSummoningRite), 1044294, 1153498, 95.0, 120.0, typeof(DaemonBlood), 1023965, 5, 1044253);
AddRes(index, typeof(Taint), 1032679, 1, 1044253);
AddRes(index, typeof(DaemonBone), 1017412, 5, 1044253);
AddRes(index, typeof(SummonDaemonScroll), 1016017, 1, 1044253);
index = AddCraft(typeof(PropheticManuscript), 1044294, 1155631, 90.0, 115.0, typeof(AncientParchment), 1155627, 10, 1044253);
AddRes(index, typeof(AntiqueDocumentsKit), 1155630, 1, 1044253);
AddRes(index, typeof(WoodPulp), 1113136, 10, 1113289);
AddRes(index, typeof(Beeswax), 1025154, 5, 1044253);
AddCraft(typeof(BlankScroll), 1044294, 1023636, 50.0, 100.0, typeof(WoodPulp), 1113136, 1, 1044378);
index = AddCraft(typeof(ScrollBinderDeed), 1044294, 1113135, 75.0, 125.0, typeof(WoodPulp), 1113136, 1, 1044253);
SetItemHue(index, 1641);
index = AddCraft(typeof(GargoyleBook100), 1044294, 1113290, 60.0, 100.0, typeof(BlankScroll), 1044377, 40, 1044378);
AddRes(index, typeof(Beeswax), 1025154, 2, "You do not have enough beeswax.");
index = AddCraft(typeof(GargoyleBook200), 1044294, 1113291, 72.0, 100.0, typeof(BlankScroll), 1044377, 40, 1044378);
AddRes(index, typeof(Beeswax), 1025154, 4, "You do not have enough beeswax.");
AddMysticSpell(1031678, 4, 0.0, typeof(NetherBoltScroll), Reg.SulfurousAsh, Reg.BlackPearl);
AddMysticSpell(1031679, 4, 0.0, typeof(HealingStoneScroll), Reg.Bone, Reg.Garlic, Reg.Ginseng, Reg.SpidersSilk);
AddMysticSpell(1031680, 6, 0.0, typeof(PurgeMagicScroll), Reg.FertileDirt, Reg.Garlic, Reg.MandrakeRoot, Reg.SulfurousAsh);
AddMysticSpell(1031681, 6, 0.0, typeof(EnchantScroll), Reg.SpidersSilk, Reg.MandrakeRoot, Reg.SulfurousAsh);
AddMysticSpell(1031682, 9, 3.5, typeof(SleepScroll), Reg.SpidersSilk, Reg.BlackPearl, Reg.Nightshade);
AddMysticSpell(1031683, 9, 3.5, typeof(EagleStrikeScroll), Reg.SpidersSilk, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.Bone);
AddMysticSpell(1031684, 11, 17.8, typeof(AnimatedWeaponScroll), Reg.Bone, Reg.BlackPearl, Reg.MandrakeRoot, Reg.Nightshade);
AddMysticSpell(1031685, 11, 17.8, typeof(StoneFormScroll), Reg.Bloodmoss, Reg.FertileDirt, Reg.Garlic);
AddMysticSpell(1031686, 14, 32.1, typeof(SpellTriggerScroll), Reg.SpidersSilk, Reg.MandrakeRoot, Reg.Garlic, Reg.DragonBlood);
AddMysticSpell(1031687, 14, 32.1, typeof(MassSleepScroll), Reg.SpidersSilk, Reg.Nightshade, Reg.Ginseng);
AddMysticSpell(1031688, 20, 46.4, typeof(CleansingWindsScroll), Reg.Ginseng, Reg.Garlic, Reg.DragonBlood, Reg.MandrakeRoot);
AddMysticSpell(1031689, 20, 46.4, typeof(BombardScroll), Reg.Garlic, Reg.DragonBlood, Reg.SulfurousAsh, Reg.Bloodmoss);
AddMysticSpell(1031690, 40, 60.7, typeof(SpellPlagueScroll), Reg.DaemonBone, Reg.DragonBlood, Reg.MandrakeRoot, Reg.Nightshade, Reg.SulfurousAsh, Reg.DaemonBone);
AddMysticSpell(1031691, 40, 60.7, typeof(HailStormScroll), Reg.DragonBlood, Reg.BlackPearl, Reg.MandrakeRoot, Reg.Bloodmoss);
AddMysticSpell(1031692, 50, 75.0, typeof(NetherCycloneScroll), Reg.Bloodmoss, Reg.Nightshade, Reg.SulfurousAsh, Reg.MandrakeRoot);
AddMysticSpell(1031693, 50, 75.0, typeof(RisingColossusScroll), Reg.DaemonBone, Reg.FertileDirt, Reg.DragonBlood, Reg.Nightshade, Reg.MandrakeRoot);
}
#endregion
MarkOption = true;
}
}
}

View File

@@ -0,0 +1,344 @@
using System;
using Server.Items;
using Server.Mobiles;
namespace Server.Engines.Craft
{
public enum MasonryRecipes
{
AnniversaryVaseShort = 701,
AnniversaryVaseTall = 702
}
public class DefMasonry : CraftSystem
{
public override SkillName MainSkill
{
get
{
return SkillName.Carpentry;
}
}
public override int GumpTitleNumber
{
get
{
return 1044500;
}// <CENTER>MASONRY MENU</CENTER>
}
private static CraftSystem m_CraftSystem;
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefMasonry();
return m_CraftSystem;
}
}
public override double GetChanceAtMin(CraftItem item)
{
return 0.0; // 0%
}
private DefMasonry()
: base(1, 1, 1.25)// base( 1, 2, 1.7 )
{
}
public override bool RetainsColorFrom(CraftItem item, Type type)
{
return true;
}
public override int CanCraft(Mobile from, ITool tool, Type itemType)
{
int num = 0;
if (tool == null || tool.Deleted || tool.UsesRemaining <= 0)
return 1044038; // You have worn out your tool!
else if (tool is Item && !BaseTool.CheckTool((Item)tool, from))
return 1048146; // If you have a tool equipped, you must use that tool.
else if (!(from is PlayerMobile && ((PlayerMobile)from).Masonry && from.Skills[SkillName.Carpentry].Base >= 100.0))
return 1044633; // You havent learned stonecraft.
else if (!tool.CheckAccessible(from, ref num))
return num; // The tool must be on your person to use.
return 0;
}
public override void PlayCraftEffect(Mobile from)
{
}
// Delay to synchronize the sound with the hit on the anvil
private class InternalTimer : Timer
{
private readonly Mobile m_From;
public InternalTimer(Mobile from)
: base(TimeSpan.FromSeconds(0.7))
{
m_From = from;
}
protected override void OnTick()
{
m_From.PlaySound(0x23D);
}
}
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
else
return 1044157; // You failed to create the item, but no materials were lost.
}
else
{
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
else if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
else if (quality == 2)
return 1044155; // You create an exceptional quality item.
else
return 1044154; // You create the item.
}
}
public override void InitCraftList()
{
// Decorations
AddCraft(typeof(Vase), 1044501, 1022888, 52.5, 102.5, typeof(Granite), 1044514, 1, 1044513);
AddCraft(typeof(LargeVase), 1044501, 1022887, 52.5, 102.5, typeof(Granite), 1044514, 3, 1044513);
if (Core.SE)
{
int index = AddCraft(typeof(SmallUrn), 1044501, 1029244, 82.0, 132.0, typeof(Granite), 1044514, 3, 1044513);
index = AddCraft(typeof(SmallTowerSculpture), 1044501, 1029242, 82.0, 132.0, typeof(Granite), 1044514, 3, 1044513);
}
if (Core.SA)
{
int index = AddCraft(typeof(GargoylePainting), 1044501, 1095317, 83.0, 133.0, typeof(Granite), 1044514, 3, 1044513);
index = AddCraft(typeof(GargishSculpture), 1044501, 1095319, 82.0, 132.0, typeof(Granite), 1044514, 3, 1044513);
index = AddCraft(typeof(GargoyleVase), 1044501, 1095322, 80.0, 126.0, typeof(Granite), 1044514, 3, 1044513);
}
if (Core.TOL)
{
int index = AddCraft(typeof(AnniversaryVaseTall), 1044501, 1156147, 60.0, 110.0, typeof(Granite), 1044514, 6, 1044513);
AddRecipe(index, (int)MasonryRecipes.AnniversaryVaseTall);
index = AddCraft(typeof(AnniversaryVaseShort), 1044501, 1156148, 60.0, 110.0, typeof(Granite), 1044514, 6, 1044513);
AddRecipe(index, (int)MasonryRecipes.AnniversaryVaseShort);
}
// 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);
AddCraft(typeof(RitualTableDeed), 1044502, 1097690, 94.7, 103.5, typeof(Granite), 1044514, 8, 1044513);
// Statues
AddCraft(typeof(StatueSouth), 1044503, 1044505, 60.0, 110.0, typeof(Granite), 1044514, 3, 1044513);
AddCraft(typeof(StatueNorth), 1044503, 1044506, 60.0, 110.0, typeof(Granite), 1044514, 3, 1044513);
AddCraft(typeof(StatueEast), 1044503, 1044507, 60.0, 110.0, typeof(Granite), 1044514, 3, 1044513);
AddCraft(typeof(StatuePegasusSouth), 1044503, 1044510, 70.0, 120.0, typeof(Granite), 1044514, 4, 1044513);
AddCraft(typeof(StatueGargoyleEast), 1044503, 1097637, 54.5, 104.5, typeof(Granite), 1044514, 20, 1044513);
AddCraft(typeof(StatueGryphonEast), 1044503, 1097619, 54.5, 104.5, typeof(Granite), 1044514, 15, 1044513);
// Misc Addons
if (Core.ML)
{
int index = AddCraft(typeof(StoneAnvilSouthDeed), 1044290, 1072876, 78.0, 128.0, typeof(Granite), 1044514, 20, 1044513);
AddRecipe(index, (int)CarpRecipes.StoneAnvilSouth);
index = AddCraft(typeof(StoneAnvilEastDeed), 1044290, 1073392, 78.0, 128.0, typeof(Granite), 1044514, 20, 1044513);
AddRecipe(index, (int)CarpRecipes.StoneAnvilEast);
}
if (Core.SA)
{
int index = AddCraft(typeof(LargeGargoyleBedSouthDeed), 1044290, 1111761, 76.0, 126.0, typeof(Granite), 1044514, 3, 1044513);
AddSkill(index, SkillName.Tailoring, 70.0, 75.0);
AddRes(index, typeof(Cloth), 1044286, 100, 1044287);
index = AddCraft(typeof(LargeGargoyleBedEastDeed), 1044290, 1111762, 76.0, 126.0, typeof(Granite), 1044514, 3, 1044513);
AddSkill(index, SkillName.Tailoring, 70.0, 75.0);
AddRes(index, typeof(Cloth), 1044286, 100, 1044287);
index = AddCraft(typeof(GargishCotEastDeed), 1044290, 1111921, 76.0, 126.0, typeof(Granite), 1044514, 3, 1044513);
AddSkill(index, SkillName.Tailoring, 70.0, 75.0);
AddRes(index, typeof(Cloth), 1044286, 100, 1044287);
index = AddCraft(typeof(GargishCotSouthDeed), 1044290, 1111920, 76.0, 126.0, typeof(Granite), 1044514, 3, 1044513);
AddSkill(index, SkillName.Tailoring, 70.0, 75.0);
AddRes(index, typeof(Cloth), 1044286, 100, 1044287);
}
// Stone Armor
if (Core.SA)
{
int index = AddCraft(typeof(FemaleGargishStoneArms), 1111705, 1020643, 56.3, 106.3, typeof(Granite), 1044514, 8, 1044513);
index = AddCraft(typeof(FemaleGargishStoneChest), 1111705, 1020645, 55.0, 105.0, typeof(Granite), 1044514, 12, 1044513);
index = AddCraft(typeof(FemaleGargishStoneLegs), 1111705, 1020649, 58.8, 108.8, typeof(Granite), 1044514, 10, 1044513);
index = AddCraft(typeof(FemaleGargishStoneKilt), 1111705, 1020647, 48.9, 98.9, typeof(Granite), 1044514, 6, 1044513);
index = AddCraft(typeof(GargishStoneArms), 1111705, 1020643, 56.3, 106.3, typeof(Granite), 1044514, 8, 1044513);
index = AddCraft(typeof(GargishStoneChest), 1111705, 1020645, 65.0, 115.0, typeof(Granite), 1044514, 12, 1044513);
index = AddCraft(typeof(GargishStoneLegs), 1111705, 1020649, 58.8, 108.8, typeof(Granite), 1044514, 10, 1044513);
index = AddCraft(typeof(GargishStoneKilt), 1111705, 1020647, 48.9, 98.9, typeof(Granite), 1044514, 6, 1044513);
index = AddCraft(typeof(LargeStoneShield), 1111705, 1095773, 55.0, 105.0, typeof(Granite), 1044514, 16, 1044513);
index = AddCraft(typeof(GargishStoneAmulet), 1111705, 1098594, 60.0, 110.0, typeof(Granite), 1044514, 3, 1044513);
}
// Stone Weapons
if (Core.SA)
{
int index = AddCraft(typeof(StoneWarSword), 1111719, 1022304, 55.0, 105.0, typeof(Granite), 1044514, 18, 1044513);
}
// Stone Walls
if (Core.TOL)
{
int index = AddCraft(typeof(CraftableHouseItem), 1155792, 1155794, 60.0, 110.0, typeof(Granite), 1044514, 10, 1044513);
SetData(index, CraftableItemType.RoughWindowless);
SetDisplayID(index, 464);
index = AddCraft(typeof(CraftableHouseItem), 1155792, 1155797, 60.0, 110.0, typeof(Granite), 1044514, 10, 1044513);
SetData(index, CraftableItemType.RoughWindow);
SetDisplayID(index, 467);
index = AddCraft(typeof(CraftableHouseItem), 1155792, 1155799, 60.0, 110.0, typeof(Granite), 1044514, 10, 1044513);
SetData(index, CraftableItemType.RoughArch);
SetDisplayID(index, 469);
index = AddCraft(typeof(CraftableHouseItem), 1155792, 1155804, 60.0, 110.0, typeof(Granite), 1044514, 10, 1044513);
SetData(index, CraftableItemType.RoughPillar);
SetDisplayID(index, 474);
index = AddCraft(typeof(CraftableHouseItem), 1155792, 1155805, 60.0, 110.0, typeof(Granite), 1044514, 10, 1044513);
SetData(index, CraftableItemType.RoughRoundedArch);
SetDisplayID(index, 475);
index = AddCraft(typeof(CraftableHouseItem), 1155792, 1155810, 60.0, 110.0, typeof(Granite), 1044514, 10, 1044513);
SetData(index, CraftableItemType.RoughSmallArch);
SetDisplayID(index, 480);
index = AddCraft(typeof(CraftableHouseItem), 1155792, 1155814, 60.0, 110.0, typeof(Granite), 1044514, 10, 1044513);
SetData(index, CraftableItemType.RoughAngledPillar);
SetDisplayID(index, 486);
index = AddCraft(typeof(CraftableHouseItem), 1155792, 1155816, 60.0, 110.0, typeof(Granite), 1044514, 10, 1044513);
SetData(index, CraftableItemType.ShortRough);
SetDisplayID(index, 488);
index = AddCraft(typeof(CraftableStoneHouseDoor), 1155792, 1156078, 60.0, 110.0, typeof(Granite), 1044514, 10, 1044513);
SetData(index, DoorType.StoneDoor_S_In);
SetDisplayID(index, 804);
AddCreateItem(index, CraftableStoneHouseDoor.Create);
index = AddCraft(typeof(CraftableStoneHouseDoor), 1155792, 1156079, 60.0, 110.0, typeof(Granite), 1044514, 10, 1044513);
SetData(index, DoorType.StoneDoor_E_Out);
SetDisplayID(index, 805);
AddCreateItem(index, CraftableStoneHouseDoor.Create);
index = AddCraft(typeof(CraftableStoneHouseDoor), 1155792, 1156348, 60.0, 110.0, typeof(Granite), 1044514, 10, 1044513);
SetData(index, DoorType.StoneDoor_S_Out);
SetDisplayID(index, 804);
AddCreateItem(index, CraftableStoneHouseDoor.Create);
index = AddCraft(typeof(CraftableStoneHouseDoor), 1155792, 1156349, 60.0, 110.0, typeof(Granite), 1044514, 10, 1044513);
SetData(index, DoorType.StoneDoor_E_In);
SetDisplayID(index, 805);
AddCreateItem(index, CraftableStoneHouseDoor.Create);
}
// Stone Stairs
if (Core.TOL)
{
int index = AddCraft(typeof(CraftableHouseItem), 1155820, 1155821, 60.0, 110.0, typeof(Granite), 1044514, 5, 1044513);
SetData(index, CraftableItemType.RoughBlock);
SetDisplayID(index, 1928);
index = AddCraft(typeof(CraftableHouseItem), 1155820, 1155822, 60.0, 110.0, typeof(Granite), 1044514, 5, 1044513);
SetData(index, CraftableItemType.RoughSteps);
SetDisplayID(index, 1929);
index = AddCraft(typeof(CraftableHouseItem), 1155820, 1155826, 60.0, 110.0, typeof(Granite), 1044514, 5, 1044513);
SetData(index, CraftableItemType.RoughCornerSteps);
SetDisplayID(index, 1934);
index = AddCraft(typeof(CraftableHouseItem), 1155820, 1155830, 60.0, 110.0, typeof(Granite), 1044514, 5, 1044513);
SetData(index, CraftableItemType.RoughRoundedCornerSteps);
SetDisplayID(index, 1938);
index = AddCraft(typeof(CraftableHouseItem), 1155820, 1155834, 60.0, 110.0, typeof(Granite), 1044514, 5, 1044513);
SetData(index, CraftableItemType.RoughInsetSteps);
SetDisplayID(index, 1941);
index = AddCraft(typeof(CraftableHouseItem), 1155820, 1155838, 60.0, 110.0, typeof(Granite), 1044514, 5, 1044513);
SetData(index, CraftableItemType.RoughRoundedInsetSteps);
SetDisplayID(index, 1945);
}
// Stone Floors
if (Core.TOL)
{
int index = AddCraft(typeof(CraftableHouseItem), 1155877, "Light Paver", 60.0, 110.0, typeof(Granite), 1044514, 5, 1044513);
SetData(index, CraftableItemType.LightPaver);
SetDisplayID(index, 1305);
index = AddCraft(typeof(CraftableHouseItem), 1155877, "Medium Paver", 60.0, 110.0, typeof(Granite), 1044514, 5, 1044513);
SetData(index, CraftableItemType.MediumPaver);
SetDisplayID(index, 1309);
index = AddCraft(typeof(CraftableHouseItem), 1155877, "Dark Paver", 60.0, 110.0, typeof(Granite), 1044514, 5, 1044513);
SetData(index, CraftableItemType.DarkPaver);
SetDisplayID(index, 1313);
}
MarkOption = true;
Repair = Core.SA;
CanEnhance = Core.SA;
SetSubRes(typeof(Granite), 1044525);
AddSubRes(typeof(Granite), 1044525, 00.0, 1044514, 1044526);
AddSubRes(typeof(DullCopperGranite), 1044023, 65.0, 1044514, 1044527);
AddSubRes(typeof(ShadowIronGranite), 1044024, 70.0, 1044514, 1044527);
AddSubRes(typeof(CopperGranite), 1044025, 75.0, 1044514, 1044527);
AddSubRes(typeof(BronzeGranite), 1044026, 80.0, 1044514, 1044527);
AddSubRes(typeof(GoldGranite), 1044027, 85.0, 1044514, 1044527);
AddSubRes(typeof(AgapiteGranite), 1044028, 90.0, 1044514, 1044527);
AddSubRes(typeof(VeriteGranite), 1044029, 95.0, 1044514, 1044527);
AddSubRes(typeof(ValoriteGranite), 1044030, 99.0, 1044514, 1044527);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,979 @@
using System;
using Server.Factions;
using Server.Items;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Engines.Craft
{
public enum TinkerRecipes
{
InvisibilityPotion = 400,
DarkglowPotion = 401,
ParasiticPotion = 402,
EssenceOfBattle = 450,
PendantOfTheMagi = 451,
ResilientBracer = 452,
ScrappersCompendium = 453,
HoveringWisp = 454, // Removed at OSI Publish 103
KotlPowerCore = 455,
// doom
BraceletOfPrimalConsumption = 456,
DrSpectorLenses = 457,
KotlAutomatonHead = 458,
WeatheredBronzeArcherSculpture = 459,
WeatheredBronzeFairySculpture = 460,
WeatheredBronzeGlobeSculpture = 461,
WeatheredBronzeManOnABench = 462,
KrampusMinionEarrings = 463,
EnchantedPicnicBasket = 464,
Telescope = 465
}
public class DefTinkering : CraftSystem
{
#region Mondain's Legacy
public override CraftECA ECA
{
get
{
return CraftECA.ChanceMinusSixtyToFourtyFive;
}
}
#endregion
public override SkillName MainSkill
{
get
{
return SkillName.Tinkering;
}
}
public override int GumpTitleNumber
{
get
{
return 1044007;
}// <CENTER>TINKERING MENU</CENTER>
}
private static CraftSystem m_CraftSystem;
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefTinkering();
return m_CraftSystem;
}
}
private DefTinkering()
: base(1, 1, 1.25)// base( 1, 1, 3.0 )
{
}
public override double GetChanceAtMin(CraftItem item)
{
if (item.NameNumber == 1044258 || item.NameNumber == 1046445) // potion keg and faction trap removal kit
return 0.5; // 50%
return 0.0; // 0%
}
public override int CanCraft(Mobile from, ITool tool, Type itemType)
{
int num = 0;
if (tool == null || tool.Deleted || tool.UsesRemaining <= 0)
return 1044038; // You have worn out your tool!
else if (!tool.CheckAccessible(from, ref num))
return num; // The tool must be on your person to use.
else if (itemType != null && (itemType.IsSubclassOf(typeof(BaseFactionTrapDeed)) || itemType == typeof(FactionTrapRemovalKit)) && Faction.Find(from) == null)
return 1044573; // You have to be in a faction to do that.
else if (itemType == typeof(ModifiedClockworkAssembly) && !(from is PlayerMobile && ((PlayerMobile)from).MechanicalLife))
return 1113034; // You haven't read the Mechanical Life Manual. Talking to Sutek might help!
return 0;
}
private static readonly Type[] m_TinkerColorables = new Type[]
{
typeof(ForkLeft), typeof(ForkRight),
typeof(SpoonLeft), typeof(SpoonRight),
typeof(KnifeLeft), typeof(KnifeRight),
typeof(Plate),
typeof(Goblet), typeof(PewterMug),
typeof(KeyRing),
typeof(Candelabra), typeof(Scales),
typeof(Key), typeof(Globe),
typeof(Spyglass), typeof(Lantern),
typeof(HeatingStand), typeof(BroadcastCrystal), typeof(TerMurStyleCandelabra),
typeof(GorgonLense), typeof(MedusaLightScales), typeof(MedusaDarkScales), typeof(RedScales),
typeof(BlueScales), typeof(BlackScales), typeof(GreenScales), typeof(YellowScales), typeof(WhiteScales),
typeof(PlantPigment), typeof(SoftenedReeds), typeof(DryReeds), typeof(PlantClippings),
typeof(KotlAutomatonHead)
};
public override bool RetainsColorFrom(CraftItem item, Type type)
{
if (type == typeof(CrystalDust))
return false;
bool contains = false;
type = item.ItemType;
for (int i = 0; !contains && i < m_TinkerColorables.Length; ++i)
contains = (m_TinkerColorables[i] == type);
if (!contains && !type.IsSubclassOf(typeof(BaseIngot)))
return false;
return contains;
}
public override void PlayCraftEffect(Mobile from)
{
from.PlaySound( 0x23B );
}
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
else
return 1044157; // You failed to create the item, but no materials were lost.
}
else
{
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
else if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
else if (quality == 2)
return 1044155; // You create an exceptional quality item.
else
return 1044154; // You create the item.
}
}
public void AddJewelrySet(GemType gemType, Type itemType)
{
int offset = (int)gemType - 1;
int index = AddCraft(typeof(GoldRing), 1044049, 1044176 + offset, 40.0, 90.0, typeof(IronIngot), 1044036, 2, 1044037);
AddRes(index, itemType, 1044231 + offset, 1, 1044240);
index = AddCraft(typeof(SilverBeadNecklace), 1044049, 1044185 + offset, 40.0, 90.0, typeof(IronIngot), 1044036, 2, 1044037);
AddRes(index, itemType, 1044231 + offset, 1, 1044240);
index = AddCraft(typeof(GoldNecklace), 1044049, 1044194 + offset, 40.0, 90.0, typeof(IronIngot), 1044036, 2, 1044037);
AddRes(index, itemType, 1044231 + offset, 1, 1044240);
index = AddCraft(typeof(GoldEarrings), 1044049, 1044203 + offset, 40.0, 90.0, typeof(IronIngot), 1044036, 2, 1044037);
AddRes(index, itemType, 1044231 + offset, 1, 1044240);
index = AddCraft(typeof(GoldBeadNecklace), 1044049, 1044212 + offset, 40.0, 90.0, typeof(IronIngot), 1044036, 2, 1044037);
AddRes(index, itemType, 1044231 + offset, 1, 1044240);
index = AddCraft(typeof(GoldBracelet), 1044049, 1044221 + offset, 40.0, 90.0, typeof(IronIngot), 1044036, 2, 1044037);
AddRes(index, itemType, 1044231 + offset, 1, 1044240);
}
public override void InitCraftList()
{
int index = -1;
#region Jewelry
AddCraft(typeof(GoldRing), 1044049, 1024234, 65.0, 115.0, typeof(IronIngot), 1044036, 3, 1044037);
AddCraft(typeof(GoldBracelet), 1044049, 1024230, 55.0, 105.0, typeof(IronIngot), 1044036, 3, 1044037);
if (Core.SA)
{
index = AddCraft(typeof(GargishNecklace), 1044049, 1095784, 60.0, 110.0, typeof(IronIngot), 1044036, 3, 1044037);
index = AddCraft(typeof(GargishBracelet), 1044049, 1095785, 55.0, 105.0, typeof(IronIngot), 1044036, 3, 1044037);
index = AddCraft(typeof(GargishRing), 1044049, 1095786, 65.0, 115.0, typeof(IronIngot), 1044036, 3, 1044037);
index = AddCraft(typeof(GargishEarrings), 1044049, 1095787, 55.0, 105.0, typeof(IronIngot), 1044036, 3, 1044037);
}
AddJewelrySet(GemType.StarSapphire, typeof(StarSapphire));
AddJewelrySet(GemType.Emerald, typeof(Emerald));
AddJewelrySet(GemType.Sapphire, typeof(Sapphire));
AddJewelrySet(GemType.Ruby, typeof(Ruby));
AddJewelrySet(GemType.Citrine, typeof(Citrine));
AddJewelrySet(GemType.Amethyst, typeof(Amethyst));
AddJewelrySet(GemType.Tourmaline, typeof(Tourmaline));
AddJewelrySet(GemType.Amber, typeof(Amber));
AddJewelrySet(GemType.Diamond, typeof(Diamond));
index = AddCraft(typeof(KrampusMinionEarrings), 1044049, 1125645, 100.0, 500.0, typeof(IronIngot), 1044036, 3, 1044037);
AddRecipe(index, (int)TinkerRecipes.KrampusMinionEarrings);
#endregion
#region Wooden Items
if (Core.SE)
{
index = AddCraft(typeof(Nunchaku), 1044042, 1030158, 70.0, 120.0, typeof(IronIngot), 1044036, 3, 1044037);
AddRes(index, typeof(Board), 1044041, 8, 1044351);
}
AddCraft(typeof(JointingPlane), 1044042, 1024144, 0.0, 50.0, typeof(Board), 1044041, 4, 1044351);
AddCraft(typeof(MouldingPlane), 1044042, 1024140, 0.0, 50.0, typeof(Board), 1044041, 4, 1044351);
AddCraft(typeof(SmoothingPlane), 1044042, 1024146, 0.0, 50.0, typeof(Board), 1044041, 4, 1044351);
AddCraft(typeof(ClockFrame), 1044042, 1024173, 0.0, 50.0, typeof(Board), 1044041, 6, 1044351);
AddCraft(typeof(Axle), 1044042, 1024187, -25.0, 25.0, typeof(Board), 1044041, 2, 1044351);
AddCraft(typeof(RollingPin), 1044042, 1024163, 0.0, 50.0, typeof(Board), 1044041, 5, 1044351);
if (Core.HS)
{
AddCraft(typeof(Ramrod), 1044042, 1095839, 0.0, 50.0, typeof(Board), 1044041, 8, 1044253);
if (!Core.EJ)
{
index = AddCraft(typeof(Swab), 1044042, 1095840, 0.0, 50.0, typeof(Cloth), 1044286, 1, 1044253);
AddRes(index, typeof(Board), 1044041, 4, 1044253);
}
}
if (Core.SA)
{
index = AddCraft(typeof(SoftenedReeds), 1044042, 1112249, 75.0, 100.0, typeof(DryReeds), 1112248, 1, 1112250);
AddRes(index, typeof(ScouringToxin), 1112292, 2, 1112326);
SetRequiresBasketWeaving(index);
SetRequireResTarget(index);
index = AddCraft(typeof(RoundBasket), 1044042, 1112293, 75.0, 100.0, typeof(SoftenedReeds), 1112249, 2, 1112251);
AddRes(index, typeof(Shaft), 1027125, 3, 1044351);
SetRequireResTarget(index);
SetRequiresBasketWeaving(index);
index = AddCraft(typeof(RoundBasketHandles), 1044042, 1112357, 75.0, 100.0, typeof(SoftenedReeds), 1112249, 2, 1112251);
AddRes(index, typeof(Shaft), 1027125, 3, 1044351);
SetRequireResTarget(index);
SetRequiresBasketWeaving(index);
index = AddCraft(typeof(SmallBushel), 1044042, 1112337, 75.0, 100.0, typeof(SoftenedReeds), 1112249, 1, 1112251);
AddRes(index, typeof(Shaft), 1027125, 2, 1044351);
SetRequireResTarget(index);
SetRequiresBasketWeaving(index);
index = AddCraft(typeof(PicnicBasket2), 1044042, 1023706, 75.0, 100.0, typeof(SoftenedReeds), 1112249, 1, 1112251);
AddRes(index, typeof(Shaft), 1027125, 2, 1044351);
SetRequireResTarget(index);
SetRequiresBasketWeaving(index);
index = AddCraft(typeof(WinnowingBasket), 1044042, 1026274, 75.0, 100.0, typeof(SoftenedReeds), 1112249, 2, 1112251);
AddRes(index, typeof(Shaft), 1027125, 3, 1044351);
SetRequireResTarget(index);
SetRequiresBasketWeaving(index);
index = AddCraft(typeof(SquareBasket), 1044042, 1112295, 75.0, 100.0, typeof(SoftenedReeds), 1112249, 2, 1112251);
AddRes(index, typeof(Shaft), 1027125, 3, 1044351);
SetRequireResTarget(index);
SetRequiresBasketWeaving(index);
index = AddCraft(typeof(BasketCraftable), 1044042, 1022448, 75.0, 100.0, typeof(SoftenedReeds), 1112249, 2, 1112251);
AddRes(index, typeof(Shaft), 1027125, 3, 1044351);
SetRequireResTarget(index);
SetRequiresBasketWeaving(index);
index = AddCraft(typeof(TallRoundBasket), 1044042, 1112297, 75.0, 100.0, typeof(SoftenedReeds), 1112249, 3, 1112251);
AddRes(index, typeof(Shaft), 1027125, 4, 1044351);
SetRequireResTarget(index);
SetRequiresBasketWeaving(index);
index = AddCraft(typeof(SmallSquareBasket), 1044042, 1112296, 75.0, 100.0, typeof(SoftenedReeds), 1112249, 1, 1112251);
AddRes(index, typeof(Shaft), 1027125, 2, 1044351);
SetRequireResTarget(index);
SetRequiresBasketWeaving(index);
index = AddCraft(typeof(TallBasket), 1044042, 1112299, 75.0, 100.0, typeof(SoftenedReeds), 1112249, 3, 1112251);
AddRes(index, typeof(Shaft), 1027125, 4, 1044351);
SetRequireResTarget(index);
SetRequiresBasketWeaving(index);
index = AddCraft(typeof(SmallRoundBasket), 1044042, 1112298, 75.0, 100.0, typeof(SoftenedReeds), 1112249, 1, 1112251);
AddRes(index, typeof(Shaft), 1027125, 2, 1044351);
SetRequireResTarget(index);
SetRequiresBasketWeaving(index);
index = AddCraft(typeof(EnchantedPicnicBasket), 1044042, 1158333, 75.0, 100.0, typeof(SoftenedReeds), 1112249, 2, 1112251);
AddRes(index, typeof(Shaft), 1027125, 3, 1044351);
AddRecipe(index, (int)TinkerRecipes.EnchantedPicnicBasket);
SetRequireResTarget(index);
SetRequiresBasketWeaving(index);
}
#endregion
#region Tools
AddCraft(typeof(Scissors), 1044046, 1023998, 5.0, 55.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(MortarPestle), 1044046, 1023739, 20.0, 70.0, typeof(IronIngot), 1044036, 3, 1044037);
AddCraft(typeof(Scorp), 1044046, 1024327, 30.0, 80.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(TinkerTools), 1044046, 1044164, 10.0, 60.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(Hatchet), 1044046, 1023907, 30.0, 80.0, typeof(IronIngot), 1044036, 4, 1044037);
AddCraft(typeof(DrawKnife), 1044046, 1024324, 30.0, 80.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(SewingKit), 1044046, 1023997, 10.0, 70.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(Saw), 1044046, 1024148, 30.0, 80.0, typeof(IronIngot), 1044036, 4, 1044037);
AddCraft(typeof(DovetailSaw), 1044046, 1024136, 30.0, 80.0, typeof(IronIngot), 1044036, 4, 1044037);
AddCraft(typeof(Froe), 1044046, 1024325, 30.0, 80.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(Shovel), 1044046, 1023898, 40.0, 90.0, typeof(IronIngot), 1044036, 4, 1044037);
AddCraft(typeof(Hammer), 1044046, 1024138, 30.0, 80.0, typeof(IronIngot), 1044036, 1, 1044037);
AddCraft(typeof(Tongs), 1044046, 1024028, 35.0, 85.0, typeof(IronIngot), 1044036, 1, 1044037);
AddCraft(Core.AOS ? typeof(SmithyHammer) : typeof(SmithHammer), 1044046, 1025091, 40.0, 90.0, typeof(IronIngot), 1044036, 4, 1044037);
AddCraft(Core.AOS ? typeof(SledgeHammerWeapon) : typeof(SledgeHammer), 1044046, 1024021, 40.0, 90.0, typeof(IronIngot), 1044036, 4, 1044037);
AddCraft(typeof(Inshave), 1044046, 1024326, 30.0, 80.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(Pickaxe), 1044046, 1023718, 40.0, 90.0, typeof(IronIngot), 1044036, 4, 1044037);
AddCraft(typeof(Lockpick), 1044046, 1025371, 45.0, 95.0, typeof(IronIngot), 1044036, 1, 1044037);
AddCraft(typeof(Skillet), 1044046, 1044567, 30.0, 80.0, typeof(IronIngot), 1044036, 4, 1044037);
AddCraft(typeof(FlourSifter), 1044046, 1024158, 50.0, 100.0, typeof(IronIngot), 1044036, 3, 1044037);
AddCraft(typeof(FletcherTools), 1044046, 1044166, 35.0, 85.0, typeof(IronIngot), 1044036, 3, 1044037);
AddCraft(typeof(MapmakersPen), 1044046, 1044167, 25.0, 75.0, typeof(IronIngot), 1044036, 1, 1044037);
AddCraft(typeof(ScribesPen), 1044046, 1044168, 25.0, 75.0, typeof(IronIngot), 1044036, 1, 1044037);
AddCraft(typeof(Clippers), 1044046, 1112117, 50.0, 50.0, typeof(IronIngot), 1044036, 4, 1044037);
if (Core.ML)
{
index = AddCraft(typeof(MetalContainerEngraver), 1044046, 1072154, 75.0, 100.0, typeof(IronIngot), 1044036, 4, 1044037);
AddRes(index, typeof(Springs), 1044171, 1, 1044253);
AddRes(index, typeof(Gears), 1044254, 2, 1044253);
AddRes(index, typeof(Diamond), 1062608, 1, 1044240);
}
AddCraft(typeof(Pitchfork), 1044046, 1023719, 40.0, 90.0, typeof(IronIngot), 1044036, 4, 1044037);
//TODO: focus of theurgy - 20th Anniversary Event
#endregion
#region Parts
AddCraft(typeof(Gears), 1044047, 1024179, 5.0, 55.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(ClockParts), 1044047, 1024175, 25.0, 75.0, typeof(IronIngot), 1044036, 1, 1044037);
AddCraft(typeof(BarrelTap), 1044047, 1024100, 35.0, 85.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(Springs), 1044047, 1024189, 5.0, 55.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(SextantParts), 1044047, 1024185, 30.0, 80.0, typeof(IronIngot), 1044036, 4, 1044037);
AddCraft(typeof(BarrelHoops), 1044047, 1024321, -15.0, 35.0, typeof(IronIngot), 1044036, 5, 1044037);
AddCraft(typeof(Hinge), 1044047, 1024181, 5.0, 55.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(BolaBall), 1044047, 1023699, 45.0, 95.0, typeof(IronIngot), 1044036, 10, 1044037);
if (Core.ML)
{
index = AddCraft(typeof(JeweledFiligree), 1044047, 1072894, 70.0, 110.0, typeof(IronIngot), 1044036, 2, 1044037);
AddRes(index, typeof(StarSapphire), 1044231, 1, 1044253);
AddRes(index, typeof(Ruby), 1044234, 1, 1044253);
}
#endregion
#region Utensils
AddCraft(typeof(ButcherKnife), 1044048, 1025110, 25.0, 75.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(SpoonLeft), 1044048, 1044158, 0.0, 50.0, typeof(IronIngot), 1044036, 1, 1044037);
AddCraft(typeof(SpoonRight), 1044048, 1044159, 0.0, 50.0, typeof(IronIngot), 1044036, 1, 1044037);
AddCraft(typeof(Plate), 1044048, 1022519, 0.0, 50.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(ForkLeft), 1044048, 1044160, 0.0, 50.0, typeof(IronIngot), 1044036, 1, 1044037);
AddCraft(typeof(ForkRight), 1044048, 1044161, 0.0, 50.0, typeof(IronIngot), 1044036, 1, 1044037);
AddCraft(typeof(Cleaver), 1044048, 1023778, 20.0, 70.0, typeof(IronIngot), 1044036, 3, 1044037);
AddCraft(typeof(KnifeLeft), 1044048, 1044162, 0.0, 50.0, typeof(IronIngot), 1044036, 1, 1044037);
AddCraft(typeof(KnifeRight), 1044048, 1044163, 0.0, 50.0, typeof(IronIngot), 1044036, 1, 1044037);
AddCraft(typeof(Goblet), 1044048, 1022458, 10.0, 60.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(PewterMug), 1044048, 1024097, 10.0, 60.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(SkinningKnife), 1044048, 1023781, 25.0, 75.0, typeof(IronIngot), 1044036, 2, 1044037);
if (Core.SA)
{
index = AddCraft(typeof(GargishCleaver), 1044048, 1097478, 20.0, 70.0, typeof(IronIngot), 1044036, 3, 1044037);
index = AddCraft(typeof(GargishButcherKnife), 1044048, 1097486, 25.0, 75.0, typeof(IronIngot), 1044036, 2, 1044037);
}
#endregion
#region Misc
AddCraft(typeof(KeyRing), 1044050, 1024113, 10.0, 60.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(Candelabra), 1044050, 1022599, 55.0, 105.0, typeof(IronIngot), 1044036, 4, 1044037);
AddCraft(typeof(Scales), 1044050, 1026225, 60.0, 110.0, typeof(IronIngot), 1044036, 4, 1044037);
AddCraft(typeof(Key), 1044050, 1024112, 20.0, 70.0, typeof(IronIngot), 1044036, 3, 1044037);
AddCraft(typeof(Globe), 1044050, 1024167, 55.0, 105.0, typeof(IronIngot), 1044036, 4, 1044037);
AddCraft(typeof(Spyglass), 1044050, 1025365, 60.0, 110.0, typeof(IronIngot), 1044036, 4, 1044037);
AddCraft(typeof(Lantern), 1044050, 1022597, 30.0, 80.0, typeof(IronIngot), 1044036, 2, 1044037);
AddCraft(typeof(HeatingStand), 1044050, 1026217, 60.0, 110.0, typeof(IronIngot), 1044036, 4, 1044037);
if (Core.SE)
{
index = AddCraft(typeof(ShojiLantern), 1044050, 1029404, 65.0, 115.0, typeof(IronIngot), 1044036, 10, 1044037);
AddRes(index, typeof(Board), 1044041, 5, 1044351);
index = AddCraft(typeof(PaperLantern), 1044050, 1029406, 65.0, 115.0, typeof(IronIngot), 1044036, 10, 1044037);
AddRes(index, typeof(Board), 1044041, 5, 1044351);
index = AddCraft(typeof(RoundPaperLantern), 1044050, 1029418, 65.0, 115.0, typeof(IronIngot), 1044036, 10, 1044037);
AddRes(index, typeof(Board), 1044041, 5, 1044351);
index = AddCraft(typeof(WindChimes), 1044050, 1030290, 80.0, 130.0, typeof(IronIngot), 1044036, 15, 1044037);
index = AddCraft(typeof(FancyWindChimes), 1044050, 1030291, 80.0, 130.0, typeof(IronIngot), 1044036, 15, 1044037);
}
if (Core.SA)
{
index = AddCraft(typeof(TerMurStyleCandelabra), 1044050, 1095313, 55.0, 105.0, typeof(IronIngot), 1044036, 4, 1044037);
}
// Removed for Dark Tides Cannon Changes
if (Core.HS && !Core.EJ)
{
index = AddCraft(typeof(Matches), 1044050, 1096648, 15.0, 70.0, typeof(Matchcord), 1095184, 10, 1044367);
AddRes(index, typeof(Board), 1044041, 4, 1044351);
}
index = AddCraft(typeof(BroadcastCrystal), 1044050, 1153097, 80.0, 130.0, typeof(IronIngot), 1044036, 20, 1044037);
AddRes(index, typeof(Emerald), 1062601, 10, 1044240);
AddRes(index, typeof(Ruby), 1062603, 10, 1044240);
AddRes(index, typeof(CopperWire), 1026265, 1, 1150700);
if (Core.SA)
{
index = AddCraft(typeof(GorgonLense), 1044050, 1112625, 90.0, 120.0, typeof(MedusaDarkScales), 1112626, 2, 1053097);
AddRes(index, typeof(CrystalDust), 1112328, 3, 1044253);
ForceNonExceptional(index);
SetItemHue(index, 1266);
index = AddCraft(typeof(ScaleCollar), 1044050, 1112480, 50.0, 100.0, typeof(RedScales), 1112626, 4, 1053097);
AddRes(index, typeof(Scourge), 1032677, 1, 1044253);
}
index = AddCraft(typeof(DragonLamp), 1044050, 1098404, 75.0, 125.0, typeof(IronIngot), 1044036, 8, 1044253);
AddRes(index, typeof(Candelabra), 1011213, 1, 1154172);
AddRes(index, typeof(WorkableGlass), 1154170, 1, 1154171);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(StainedGlassLamp), 1044050, 1098408, 75.0, 125.0, typeof(IronIngot), 1044036, 8, 1044253);
AddRes(index, typeof(Candelabra), 1011213, 1, 1154172);
AddRes(index, typeof(WorkableGlass), 1154170, 1, 1154171);
SetNeededThemePack(index, ThemePack.Kings);
index = AddCraft(typeof(TallDoubleLamp), 1044050, 1098414, 75.0, 125.0, typeof(IronIngot), 1044036, 8, 1044253);
AddRes(index, typeof(Candelabra), 1011213, 1, 1154172);
AddRes(index, typeof(WorkableGlass), 1154170, 1, 1154171);
SetNeededThemePack(index, ThemePack.Kings);
if (Core.TOL)
{
index = AddCraft(typeof(CraftableHouseItem), 1044050, 1155851, 40.0, 90.0, typeof(IronIngot), 1044036, 8, 1044253);
SetData(index, CraftableItemType.CurledMetalSignHanger);
SetDisplayID(index, 2971);
index = AddCraft(typeof(CraftableHouseItem), 1044050, 1155852, 40.0, 90.0, typeof(IronIngot), 1044036, 8, 1044253);
SetData(index, CraftableItemType.FlourishedMetalSignHanger);
SetDisplayID(index, 2973);
index = AddCraft(typeof(CraftableHouseItem), 1044050, 1155853, 40.0, 90.0, typeof(IronIngot), 1044036, 8, 1044253);
SetData(index, CraftableItemType.InwardCurledMetalSignHanger);
SetDisplayID(index, 2975);
index = AddCraft(typeof(CraftableHouseItem), 1044050, 1155854, 40.0, 90.0, typeof(IronIngot), 1044036, 8, 1044253);
SetData(index, CraftableItemType.EndCurledMetalSignHanger);
SetDisplayID(index, 2977);
index = AddCraft(typeof(CraftableMetalHouseDoor), 1044050, 1156080, 85.0, 135.0, typeof(IronIngot), 1044036, 50, 1044253);
SetData(index, DoorType.LeftMetalDoor_S_In);
SetDisplayID(index, 1653);
AddCreateItem(index, CraftableMetalHouseDoor.Create);
index = AddCraft(typeof(CraftableMetalHouseDoor), 1044050, 1156081, 85.0, 135.0, typeof(IronIngot), 1044036, 50, 1044253);
SetData(index, DoorType.RightMetalDoor_S_In);
SetDisplayID(index, 1659);
AddCreateItem(index, CraftableMetalHouseDoor.Create);
index = AddCraft(typeof(CraftableMetalHouseDoor), 1044050, 1156082, 85.0, 135.0, typeof(IronIngot), 1044036, 50, 1044253);
SetData(index, DoorType.LeftMetalDoor_E_Out);
SetDisplayID(index, 1660);
AddCreateItem(index, CraftableMetalHouseDoor.Create);
index = AddCraft(typeof(CraftableMetalHouseDoor), 1044050, 1156083, 85.0, 135.0, typeof(IronIngot), 1044036, 50, 1044253);
SetData(index, DoorType.RightMetalDoor_E_Out);
SetDisplayID(index, 1663);
AddCreateItem(index, CraftableMetalHouseDoor.Create);
index = AddCraft(typeof(WallSafeDeed), 1044050, 1155860, 0.0, 0.0, typeof(IronIngot), 1044036, 20, 1044253);
ForceNonExceptional(index);
index = AddCraft(typeof(CraftableMetalHouseDoor), 1044050, 1156352, 85.0, 135.0, typeof(IronIngot), 1044036, 50, 1044253);
SetData(index, DoorType.LeftMetalDoor_E_In);
SetDisplayID(index, 1660);
AddCreateItem(index, CraftableMetalHouseDoor.Create);
index = AddCraft(typeof(CraftableMetalHouseDoor), 1044050, 1156353, 85.0, 135.0, typeof(IronIngot), 1044036, 50, 1044253);
SetData(index, DoorType.RightMetalDoor_E_In);
SetDisplayID(index, 1663);
AddCreateItem(index, CraftableMetalHouseDoor.Create);
index = AddCraft(typeof(CraftableMetalHouseDoor), 1044050, 1156350, 85.0, 135.0, typeof(IronIngot), 1044036, 50, 1044253);
SetData(index, DoorType.LeftMetalDoor_S_Out);
SetDisplayID(index, 1653);
AddCreateItem(index, CraftableMetalHouseDoor.Create);
index = AddCraft(typeof(CraftableMetalHouseDoor), 1044050, 1156351, 85.0, 135.0, typeof(IronIngot), 1044036, 50, 1044253);
SetData(index, DoorType.RightMetalDoor_S_Out);
SetDisplayID(index, 1659);
AddCreateItem(index, CraftableMetalHouseDoor.Create);
index = AddCraft(typeof(KotlPowerCore), 1044050, 1124179, 85.0, 135.0, typeof(WorkableGlass), 1154170, 5, 1154171);
AddRes(index, typeof(CopperWire), 1026265, 5, 1150700);
AddRes(index, typeof(IronIngot), 1044036, 100, 1044253);
AddRes(index, typeof(MoonstoneCrystalShard), 1124142, 5, 1156701);
AddRecipe(index, (int)TinkerRecipes.KotlPowerCore);
}
index = AddCraft(typeof(WeatheredBronzeGlobeSculptureDeed), 1044050, 1156881, 85.0, 135.0, typeof(BronzeIngot), 1038039, 200, 1044253);
AddRecipe(index, (int)TinkerRecipes.WeatheredBronzeGlobeSculpture);
index = AddCraft(typeof(WeatheredBronzeManOnABenchDeed), 1044050, 1156882, 85.0, 135.0, typeof(IronIngot), 1038039, 200, 1044253);
AddRecipe(index, (int)TinkerRecipes.WeatheredBronzeManOnABench);
index = AddCraft(typeof(WeatheredBronzeFairySculptureDeed), 1044050, 1156883, 85.0, 135.0, typeof(IronIngot), 1038039, 200, 1044253);
AddRecipe(index, (int)TinkerRecipes.WeatheredBronzeFairySculpture);
index = AddCraft(typeof(WeatheredBronzeArcherDeed), 1044050, 1156884, 85.0, 135.0, typeof(IronIngot), 1038039, 200, 1044253);
AddRecipe(index, (int)TinkerRecipes.WeatheredBronzeArcherSculpture);
#endregion
#region Assemblies
index = AddCraft(typeof(AxleGears), 1044051, 1024177, 0.0, 0.0, typeof(Axle), 1044169, 1, 1044253);
AddRes(index, typeof(Gears), 1044254, 1, 1044253);
index = AddCraft(typeof(ClockParts), 1044051, 1024175, 0.0, 0.0, typeof(AxleGears), 1044170, 1, 1044253);
AddRes(index, typeof(Springs), 1044171, 1, 1044253);
index = AddCraft(typeof(SextantParts), 1044051, 1024185, 0.0, 0.0, typeof(AxleGears), 1044170, 1, 1044253);
AddRes(index, typeof(Hinge), 1044172, 1, 1044253);
index = AddCraft(typeof(ClockRight), 1044051, 1044257, 0.0, 0.0, typeof(ClockFrame), 1044174, 1, 1044253);
AddRes(index, typeof(ClockParts), 1044173, 1, 1044253);
index = AddCraft(typeof(ClockLeft), 1044051, 1044256, 0.0, 0.0, typeof(ClockFrame), 1044174, 1, 1044253);
AddRes(index, typeof(ClockParts), 1044173, 1, 1044253);
AddCraft(typeof(Sextant), 1044051, 1024183, 0.0, 0.0, typeof(SextantParts), 1044175, 1, 1044253);
index = AddCraft(typeof(Bola), 1044051, 1046441, 60.0, 80.0, typeof(BolaBall), 1046440, 4, 1042613);
AddRes(index, typeof(Leather), 1044462, 3, 1044463);
index = AddCraft(typeof(PotionKeg), 1044051, 1044258, 75.0, 100.0, typeof(Keg), 1044255, 1, 1044253);
AddRes(index, typeof(Bottle), 1044250, 10, 1044253);
AddRes(index, typeof(BarrelLid), 1044251, 1, 1044253);
AddRes(index, typeof(BarrelTap), 1044252, 1, 1044253);
if (Core.SA)
{
index = AddCraft(typeof(ModifiedClockworkAssembly), 1044051, 1113031, 65.0, 115.0, typeof(ClockworkAssembly), 1073426, 1, 502910);
AddRes(index, typeof(PowerCrystal), 1112811, 1, 502910);
AddRes(index, typeof(VoidEssence), 1112327, 1, 502910);
ForceNonExceptional(index);
index = AddCraft(typeof(ModifiedClockworkAssembly), 1044051, 1113032, 65.0, 115.0, typeof(ClockworkAssembly), 1073426, 1, 502910);
AddRes(index, typeof(PowerCrystal), 1112811, 1, 502910);
AddRes(index, typeof(VoidEssence), 1112327, 2, 502910);
ForceNonExceptional(index);
index = AddCraft(typeof(ModifiedClockworkAssembly), 1044051, 1113033, 65.0, 115.0, typeof(ClockworkAssembly), 1073426, 1, 502910);
AddRes(index, typeof(PowerCrystal), 1112811, 1, 502910);
AddRes(index, typeof(VoidEssence), 1112327, 3, 502910);
ForceNonExceptional(index);
}
if (Core.ML)
{
index = AddCraft(typeof(HitchingRope), 1044051, 1071124, 60.0, 120.0, typeof(Rope), 1020934, 1, 1044253);
AddSkill(index, SkillName.AnimalLore, 15.0, 100.0);
AddRes(index, typeof(ResolvesBridle), 1074761, 1, 1044253);
index = AddCraft(typeof(HitchingPost), 1044051, 1071127, 90.0, 160.0, typeof(IronIngot), 1044036, 50, 1044253);
AddRes(index, typeof(AnimalPheromone), 1071200, 1, 1044253);
AddRes(index, typeof(HitchingRope), 1071124, 2, 1044253);
AddRes(index, typeof(PhillipsWoodenSteed), 1063488, 1, 1044253);
}
if (Core.SA)
{
index = AddCraft(typeof(ArcanicRuneStone), 1044051, 1113352, 90.0, 140.0, typeof(CrystalShards), 1073161, 1, 1044253);
AddRes(index, typeof(PowerCrystal), 1112811, 5, 502910);
AddSkill(index, SkillName.Magery, 80.0, 85.0);
ForceNonExceptional(index);
index = AddCraft(typeof(VoidOrb), 1044051, 1113354, 90.0, 104.3, typeof(DarkSapphire), 1032690, 1, 1044253);
AddSkill(index, SkillName.Magery, 80.0, 100.0);
AddRes(index, typeof(BlackPearl), 1015001, 50, 1044253);
ForceNonExceptional(index);
}
index = AddCraft(typeof(AdvancedTrainingDummySouthDeed), 1044051, 1150595, 90.0, 120.0, typeof(TrainingDummySouthDeed), 1044336, 1, 1044253);
AddRes(index, typeof(PlateChest), 1025141, 1, 1044253);
AddRes(index, typeof(CloseHelm), 1025128, 1, 1044253);
AddRes(index, typeof(Broadsword), 1015055, 1, 1044253);
ForceNonExceptional(index);
SetNeededThemePack(index, ThemePack.Gothic);
index = AddCraft(typeof(AdvancedTrainingDummyEastDeed), 1044051, 1150596, 90.0, 120.0, typeof(TrainingDummyEastDeed), 1044335, 1, 1044253);
AddRes(index, typeof(PlateChest), 1025141, 1, 1044253);
AddRes(index, typeof(CloseHelm), 1025128, 1, 1044253);
AddRes(index, typeof(Broadsword), 1015055, 1, 1044253);
ForceNonExceptional(index);
SetNeededThemePack(index, ThemePack.Gothic);
index = AddCraft(typeof(DistillerySouthAddonDeed), 1044051, 1150663, 90.0, 110.0, typeof(MetalKeg), 1150675, 2, 1044253);
AddRes(index, typeof(HeatingStand), 1011224, 4, 1044253);
AddRes(index, typeof(CopperWire), 1026265, 1, 1044253);
ForceNonExceptional(index);
index = AddCraft(typeof(DistilleryEastAddonDeed), 1044051, 1150664, 90.0, 110.0, typeof(MetalKeg), 1150675, 2, 1044253);
AddRes(index, typeof(HeatingStand), 1011224, 4, 1044253);
AddRes(index, typeof(CopperWire), 1026265, 1, 1044253);
ForceNonExceptional(index);
if (Core.TOL)
{
index = AddCraft(typeof(KotlAutomatonHead), 1044051, 1156998, 100.0, 580.0, typeof(IronIngot), 1044036, 300, 1044037);
SetMinSkillOffset(index, 25.0);
AddRes(index, typeof(AutomatonActuator), 1156997, 1, 1156999);
AddRes(index, typeof(StasisChamberPowerCore), 1156623, 1, 1157000);
AddRes(index, typeof(InoperativeAutomatonHead), 1157002, 1, 1157001);
AddRecipe(index, (int)TinkerRecipes.KotlAutomatonHead);
index = AddCraft(typeof(PersonalTelescope), 1044051, 1125284, 95.0, 196.0, typeof(IronIngot), 1044036, 25, 1044037);
AddRes(index, typeof(WorkableGlass), 1154170, 1, 1154171);
AddRes(index, typeof(SextantParts), 1044175, 1, 1044253);
AddRecipe(index, (int)TinkerRecipes.Telescope);
}
#endregion
#region Traps
// Dart Trap
index = AddCraft(typeof(DartTrapCraft), 1044052, 1024396, 30.0, 80.0, typeof(IronIngot), 1044036, 1, 1044037);
AddRes(index, typeof(Bolt), 1044570, 1, 1044253);
// Poison Trap
index = AddCraft(typeof(PoisonTrapCraft), 1044052, 1044593, 30.0, 80.0, typeof(IronIngot), 1044036, 1, 1044037);
AddRes(index, typeof(BasePoisonPotion), 1044571, 1, 1044253);
// Explosion Trap
index = AddCraft(typeof(ExplosionTrapCraft), 1044052, 1044597, 55.0, 105.0, typeof(IronIngot), 1044036, 1, 1044037);
AddRes(index, typeof(BaseExplosionPotion), 1044569, 1, 1044253);
// Faction Gas Trap
index = AddCraft(typeof(FactionGasTrapDeed), 1044052, 1044598, 65.0, 115.0, typeof(Silver), 1044572, Core.AOS ? 250 : 1000, 1044253);
AddRes(index, typeof(IronIngot), 1044036, 10, 1044037);
AddRes(index, typeof(BasePoisonPotion), 1044571, 1, 1044253);
// Faction explosion Trap
index = AddCraft(typeof(FactionExplosionTrapDeed), 1044052, 1044599, 65.0, 115.0, typeof(Silver), 1044572, Core.AOS ? 250 : 1000, 1044253);
AddRes(index, typeof(IronIngot), 1044036, 10, 1044037);
AddRes(index, typeof(BaseExplosionPotion), 1044569, 1, 1044253);
// Faction Saw Trap
index = AddCraft(typeof(FactionSawTrapDeed), 1044052, 1044600, 65.0, 115.0, typeof(Silver), 1044572, Core.AOS ? 250 : 1000, 1044253);
AddRes(index, typeof(IronIngot), 1044036, 10, 1044037);
AddRes(index, typeof(Gears), 1044254, 1, 1044253);
// Faction Spike Trap
index = AddCraft(typeof(FactionSpikeTrapDeed), 1044052, 1044601, 65.0, 115.0, typeof(Silver), 1044572, Core.AOS ? 250 : 1000, 1044253);
AddRes(index, typeof(IronIngot), 1044036, 10, 1044037);
AddRes(index, typeof(Springs), 1044171, 1, 1044253);
// Faction trap removal kit
index = AddCraft(typeof(FactionTrapRemovalKit), 1044052, 1046445, 90.0, 115.0, typeof(Silver), 1044572, 500, 1044253);
AddRes(index, typeof(IronIngot), 1044036, 10, 1044037);
#endregion
#region Magic Jewlery
if (Core.ML)
{
index = AddCraft(typeof(BrilliantAmberBracelet), 1073107, 1073453, 75.0, 125.0, typeof(IronIngot), 1044036, 5, 1044037);
AddRes(index, typeof(Amber), 1062607, 20, 1044240);
AddRes(index, typeof(BrilliantAmber), 1032697, 10, 1044240);
index = AddCraft(typeof(FireRubyBracelet), 1073107, 1073454, 75.0, 125.0, typeof(IronIngot), 1044036, 5, 1044037);
AddRes(index, typeof(Ruby), 1062603, 20, 1044240);
AddRes(index, typeof(FireRuby), 1032695, 10, 1044240);
index = AddCraft(typeof(DarkSapphireBracelet), 1073107, 1073455, 75.0, 125.0, typeof(IronIngot), 1044036, 5, 1044037);
AddRes(index, typeof(Sapphire), 1062602, 20, 1044240);
AddRes(index, typeof(DarkSapphire), 1032690, 10, 1044240);
index = AddCraft(typeof(WhitePearlBracelet), 1073107, 1073456, 75.0, 125.0, typeof(IronIngot), 1044036, 5, 1044037);
AddRes(index, typeof(Tourmaline), 1062606, 20, 1044240);
AddRes(index, typeof(WhitePearl), 1032694, 10, 1044240);
index = AddCraft(typeof(EcruCitrineRing), 1073107, 1073457, 75.0, 125.0, typeof(IronIngot), 1044036, 5, 1044037);
AddRes(index, typeof(Citrine), 1062604, 20, 1044240);
AddRes(index, typeof(EcruCitrine), 1032693, 10, 1044240);
index = AddCraft(typeof(BlueDiamondRing), 1073107, 1073458, 75.0, 125.0, typeof(IronIngot), 1044036, 5, 1044037);
AddRes(index, typeof(Diamond), 1062608, 20, 1044240);
AddRes(index, typeof(BlueDiamond), 1032696, 10, 1044240);
index = AddCraft(typeof(PerfectEmeraldRing), 1073107, 1073459, 75.0, 125.0, typeof(IronIngot), 1044036, 5, 1044037);
AddRes(index, typeof(Emerald), 1062601, 20, 1044240);
AddRes(index, typeof(PerfectEmerald), 1032692, 10, 1044240);
index = AddCraft(typeof(TurqouiseRing), 1073107, 1073460, 75.0, 125.0, typeof(IronIngot), 1044036, 5, 1044037);
AddRes(index, typeof(Amethyst), 1062605, 20, 1044240);
AddRes(index, typeof(Turquoise), 1032691, 10, 1044240);
index = AddCraft(typeof(ResilientBracer), 1073107, 1072933, 100.0, 125.0, typeof(IronIngot), 1044036, 2, 1044037);
SetMinSkillOffset(index, 25.0);
AddRes(index, typeof(CapturedEssence), 1032686, 1, 1044253);
AddRes(index, typeof(BlueDiamond), 1032696, 10, 1044253);
AddRes(index, typeof(Diamond), 1062608, 50, 1044253);
AddRecipe(index, (int)TinkerRecipes.ResilientBracer);
ForceNonExceptional(index);
index = AddCraft(typeof(EssenceOfBattle), 1073107, 1072935, 100.0, 125.0, typeof(IronIngot), 1044036, 2, 1044037);
SetMinSkillOffset(index, 25.0);
AddRes(index, typeof(CapturedEssence), 1032686, 1, 1044253);
AddRes(index, typeof(FireRuby), 1032695, 10, 1044253);
AddRes(index, typeof(Ruby), 1062603, 50, 1044253);
AddRecipe(index, (int)TinkerRecipes.EssenceOfBattle);
ForceNonExceptional(index);
index = AddCraft(typeof(PendantOfTheMagi), 1073107, 1072937, 100.0, 125.0, typeof(IronIngot), 1044036, 2, 1044037);
SetMinSkillOffset(index, 25.0);
AddRes(index, typeof(EyeOfTheTravesty), 1032685, 1, 1044253);
AddRes(index, typeof(WhitePearl), 1032694, 5, 1044253);
AddRes(index, typeof(StarSapphire), 1062600, 50, 1044253);
AddRecipe(index, (int)TinkerRecipes.PendantOfTheMagi);
ForceNonExceptional(index);
}
if (Core.TOL)
{
index = AddCraft(typeof(DrSpectorsLenses), 1073107, 1156991, 100.0, 580.0, typeof(IronIngot), 1044036, 20, 1044037);
SetMinSkillOffset(index, 25.0);
AddRes(index, typeof(BlackrockMoonstone), 1156993, 1, 1156992);
AddRes(index, typeof(HatOfTheMagi), 1061597, 1, 1044253);
AddRecipe(index, (int)TinkerRecipes.DrSpectorLenses);
ForceNonExceptional(index);
index = AddCraft(typeof(BraceletOfPrimalConsumption), 1073107, 1157350, 100.0, 580.0, typeof(IronIngot), 1044036, 3, 1044037);
SetMinSkillOffset(index, 25.0);
AddRes(index, typeof(RingOfTheElements), 1061104, 1, 1044253);
AddRes(index, typeof(BloodOfTheDarkFather), 1157343, 5, 1044253);
AddRes(index, typeof(WhitePearl), 1032694, 4, 1044240);
AddRecipe(index, (int)TinkerRecipes.BraceletOfPrimalConsumption);
ForceNonExceptional(index);
}
#endregion
// Set the overridable material
SetSubRes(typeof(IronIngot), 1044022);
// Add every material you want the player to be able to choose from
// This will override the overridable material
AddSubRes(typeof(IronIngot), 1044022, 00.0, 1044036, 1044267);
AddSubRes(typeof(DullCopperIngot), 1044023, 65.0, 1044036, 1044268);
AddSubRes(typeof(ShadowIronIngot), 1044024, 70.0, 1044036, 1044268);
AddSubRes(typeof(CopperIngot), 1044025, 75.0, 1044036, 1044268);
AddSubRes(typeof(BronzeIngot), 1044026, 80.0, 1044036, 1044268);
AddSubRes(typeof(GoldIngot), 1044027, 85.0, 1044036, 1044268);
AddSubRes(typeof(AgapiteIngot), 1044028, 90.0, 1044036, 1044268);
AddSubRes(typeof(VeriteIngot), 1044029, 95.0, 1044036, 1044268);
AddSubRes(typeof(ValoriteIngot), 1044030, 99.0, 1044036, 1044268);
MarkOption = true;
Repair = true;
CanEnhance = Core.AOS;
CanAlter = Core.SA;
}
}
public abstract class TrapCraft : CustomCraft
{
private LockableContainer m_Container;
public LockableContainer Container
{
get
{
return m_Container;
}
}
public abstract TrapType TrapType { get; }
public TrapCraft(Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, ITool tool, int quality)
: base(from, craftItem, craftSystem, typeRes, tool, quality)
{
}
private int Verify(LockableContainer container)
{
if (container == null || container.KeyValue == 0)
return 1005638; // You can only trap lockable chests.
if (From.Map != container.Map || !From.InRange(container.GetWorldLocation(), 2))
return 500446; // That is too far away.
if (!container.Movable)
return 502944; // You cannot trap this item because it is locked down.
if (!container.IsAccessibleTo(From))
return 502946; // That belongs to someone else.
if (container.Locked)
return 502943; // You can only trap an unlocked object.
if (container.TrapType != TrapType.None)
return 502945; // You can only place one trap on an object at a time.
return 0;
}
private bool Acquire(object target, out int message)
{
LockableContainer container = target as LockableContainer;
message = Verify(container);
if (message > 0)
{
return false;
}
else
{
m_Container = container;
return true;
}
}
public override void EndCraftAction()
{
From.SendLocalizedMessage(502921); // What would you like to set a trap on?
From.Target = new ContainerTarget(this);
}
private class ContainerTarget : Target
{
private readonly TrapCraft m_TrapCraft;
public ContainerTarget(TrapCraft trapCraft)
: base(-1, false, TargetFlags.None)
{
m_TrapCraft = trapCraft;
}
protected override void OnTarget(Mobile from, object targeted)
{
int message;
if (m_TrapCraft.Acquire(targeted, out message))
m_TrapCraft.CraftItem.CompleteCraft(m_TrapCraft.Quality, false, m_TrapCraft.From, m_TrapCraft.CraftSystem, m_TrapCraft.TypeRes, m_TrapCraft.Tool, m_TrapCraft);
else
Failure(message);
}
protected override void OnTargetCancel(Mobile from, TargetCancelType cancelType)
{
if (cancelType == TargetCancelType.Canceled)
Failure(0);
}
private void Failure(int message)
{
Mobile from = m_TrapCraft.From;
ITool tool = m_TrapCraft.Tool;
if (Siege.SiegeShard)
{
AOS.Damage(from, Utility.RandomMinMax(80, 120), 50, 50, 0, 0, 0);
message = 502902; // You fail to set the trap, and inadvertantly hurt yourself in the process.
}
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, m_TrapCraft.CraftSystem, tool, message));
else if (message > 0)
from.SendLocalizedMessage(message);
}
}
public override Item CompleteCraft(out int message)
{
message = Verify(Container);
if (message == 0)
{
int trapLevel = (int)(From.Skills.Tinkering.Value / 10);
Container.TrapType = TrapType;
Container.TrapPower = trapLevel * 9;
Container.TrapLevel = trapLevel;
Container.TrapOnLockpick = true;
message = 1005639; // Trap is disabled until you lock the chest.
}
return null;
}
}
[CraftItemID(0x1BFC)]
public class DartTrapCraft : TrapCraft
{
public override TrapType TrapType
{
get
{
return TrapType.DartTrap;
}
}
public DartTrapCraft(Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, ITool tool, int quality)
: base(from, craftItem, craftSystem, typeRes, tool, quality)
{
}
}
[CraftItemID(0x113E)]
public class PoisonTrapCraft : TrapCraft
{
public override TrapType TrapType
{
get
{
return TrapType.PoisonTrap;
}
}
public PoisonTrapCraft(Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, ITool tool, int quality)
: base(from, craftItem, craftSystem, typeRes, tool, quality)
{
}
}
[CraftItemID(0x370C)]
public class ExplosionTrapCraft : TrapCraft
{
public override TrapType TrapType
{
get
{
return TrapType.ExplosionTrap;
}
}
public ExplosionTrapCraft(Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, ITool tool, int quality)
: base(from, craftItem, craftSystem, typeRes, tool, quality)
{
}
}
}