context: 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>
          }
  
          private static CraftSystem m_CraftSystem;
  
          public static CraftSystem CraftSystem
          {
              get
              {
                  if (m_CraftSystem == null)
                      m_CraftSystem = new DefCarpentry();
  
                  return m_CraftSystem;
              }
          }
  
          public override double GetChanceAtMin(CraftItem item)
          {
              return 0.5; // 50%
          }
  
          private DefCarpentry()
              : base(1, 1, 1.25)// base( 1, 1, 3.0 )
          {
          }
  
          public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
          {
              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 bool ConsumeOnFailure(Mobile from, Type resourceType, CraftItem craftItem)
          {
              if (resourceType == typeof(StaffOfTheMagi))
                  return false;
  
              return base.ConsumeOnFailure(from, resourceType, craftItem);
          }
  
          public override void InitCraftList()
          {
              int index = -1;
  
              // Other Items
              if (Core.Expansion >= Expansion.AOS)
              {
                  index = this.AddCraft(typeof(Board), 1044294, 1027127, 0.0, 0.0, typeof(Log), 1044466, 1, 1044465);
                  this.SetUseAllRes(index, true);
  				this.SetForceTypeRes(index, true);
              }
  
              this.AddCraft(typeof(BarrelStaves), 1044294, 1027857, 00.0, 25.0, typeof(Board), 1044041, 5, 1044351);
              this.AddCraft(typeof(BarrelLid), 1044294, 1027608, 11.0, 36.0, typeof(Board), 1044041, 4, 1044351);
              this.AddCraft(typeof(ShortMusicStand), 1044294, 1044313, 78.9, 103.9, typeof(Board), 1044041, 15, 1044351);
              this.AddCraft(typeof(TallMusicStand), 1044294, 1044315, 81.5, 106.5, typeof(Board), 1044041, 20, 1044351);
              this.AddCraft(typeof(Easle), 1044294, 1044317, 86.8, 111.8, typeof(Board), 1044041, 20, 1044351);
              if (Core.SE)
              {
                  index = this.AddCraft(typeof(RedHangingLantern), 1044294, 1029412, 65.0, 90.0, typeof(Board), 1044041, 5, 1044351);
                  this.AddRes(index, typeof(BlankScroll), 1044377, 10, 1044378);
                  this.SetNeededExpansion(index, Expansion.SE);
  
                  index = this.AddCraft(typeof(WhiteHangingLantern), 1044294, 1029416, 65.0, 90.0, typeof(Board), 1044041, 5, 1044351);
                  this.AddRes(index, typeof(BlankScroll), 1044377, 10, 1044378);
                  this.SetNeededExpansion(index, Expansion.SE);
  
                  index = this.AddCraft(typeof(ShojiScreen), 1044294, 1029423, 80.0, 105.0, typeof(Board), 1044041, 75, 1044351);
                  this.AddSkill(index, SkillName.Tailoring, 50.0, 55.0);
                  this.AddRes(index, typeof(Cloth), 1044286, 60, 1044287);
                  this.SetNeededExpansion(index, Expansion.SE);
  
                  index = this.AddCraft(typeof(BambooScreen), 1044294, 1029428, 80.0, 105.0, typeof(Board), 1044041, 75, 1044351);
                  this.AddSkill(index, SkillName.Tailoring, 50.0, 55.0);
                  this.AddRes(index, typeof(Cloth), 1044286, 60, 1044287);
                  this.SetNeededExpansion(index, Expansion.SE);
              }
  
              if (Core.AOS)	//Duplicate Entries to preserve ordering depending on era
              {
                  index = this.AddCraft(typeof(FishingPole), 1044294, 1023519, 68.4, 93.4, typeof(Board), 1044041, 5, 1044351); //This is in the categor of Other during AoS
                  this.AddSkill(index, SkillName.Tailoring, 40.0, 45.0);
                  this.AddRes(index, typeof(Cloth), 1044286, 5, 1044287);
              }
  
              #region Mondain's Legacy
              if (Core.ML)
              {
                  index = this.AddCraft(typeof(WoodenContainerEngraver), 1044294, 1072153, 75.0, 100.0, typeof(Board), 1044041, 4, 1044351);
                  this.AddRes(index, typeof(IronIngot), 1044036, 2, 1044037);
                  this.SetNeededExpansion(index, Expansion.ML);
  
                  index = this.AddCraft(typeof(RunedSwitch), 1044294, 1072896, 70.0, 120.0, typeof(Board), 1044041, 2, 1044351);
                  this.AddRes(index, typeof(EnchantedSwitch), 1072893, 1, 1053098);
                  this.AddRes(index, typeof(RunedPrism), 1073465, 1, 1053098);
                  this.AddRes(index, typeof(JeweledFiligree), 1072894, 1, 1053098);
                  this.SetNeededExpansion(index, Expansion.ML);
  
                  index = this.AddCraft(typeof(ArcanistStatueSouthDeed), 1044294, 1072885, 0.0, 35.0, typeof(Board), 1044041, 250, 1044351);
                  this.ForceNonExceptional(index);
                  this.SetNeededExpansion(index, Expansion.ML);
  
                  index = this.AddCraft(typeof(ArcanistStatueEastDeed), 1044294, 1072886, 0.0, 35.0, typeof(Board), 1044041, 250, 1044351);
                  this.ForceNonExceptional(index);
                  this.SetNeededExpansion(index, Expansion.ML);
  
                  index = this.AddCraft(typeof(WarriorStatueSouthDeed), 1044294, 1072887, 0.0, 35.0, typeof(Board), 1044041, 250, 1044351);
                  this.AddRecipe(index, (int)CarpRecipes.WarriorStatueSouth);
                  this.ForceNonExceptional(index);
                  this.SetNeededExpansion(index, Expansion.ML);
  
                  index = this.AddCraft(typeof(WarriorStatueEastDeed), 1044294, 1072888, 0.0, 35.0, typeof(Board), 1044041, 250, 1044351);
                  this.AddRecipe(index, (int)CarpRecipes.WarriorStatueEast);
                  this.ForceNonExceptional(index);
                  this.SetNeededExpansion(index, Expansion.ML);
  
                  index = this.AddCraft(typeof(SquirrelStatueSouthDeed), 1044294, 1072884, 0.0, 35.0, typeof(Board), 1044041, 250, 1044351);
                  this.AddRecipe(index, (int)CarpRecipes.SquirrelStatueSouth);
                  this.ForceNonExceptional(index);
                  this.SetNeededExpansion(index, Expansion.ML);
  
                  index = this.AddCraft(typeof(SquirrelStatueEastDeed), 1044294, 1073398, 0.0, 35.0, typeof(Board), 1044041, 250, 1044351);
                  this.AddRecipe(index, (int)CarpRecipes.SquirrelStatueEast);
                  this.ForceNonExceptional(index);
                  this.SetNeededExpansion(index, Expansion.ML);
  
                  index = this.AddCraft(typeof(GiantReplicaAcorn), 1044294, 1072889, 80.0, 105.0, typeof(Board), 1044041, 35, 1044351);
                  this.SetNeededExpansion(index, Expansion.ML);
  
                  index = this.AddCraft(typeof(MountedDreadHorn), 1044294, 1032632, 90.0, 115.0, typeof(Board), 1044041, 50, 1044351);
                  this.AddRes(index, typeof(PristineDreadHorn), 1032634, 1, 1053098);
                  this.ForceNonExceptional(index);
                  this.SetNeededExpansion(index, Expansion.ML);
  
                  index = this.AddCraft(typeof(AcidProofRope), 1044294, 1074886, 80, 130.0, typeof(GreaterStrengthPotion), 1073466, 2, 1044253);
                  this.AddRes(index, typeof(ProtectionScroll), 1044395, 1, 1053098);
                  this.AddRes(index, typeof(SwitchItem), 1032127, 1, 1053098);
                  this.AddRecipe(index, (int)CarpRecipes.AcidProofRope);
                  this.ForceNonExceptional(index);
                  this.SetNeededExpansion(index, Expansion.ML);
              }
              #endregion
  
              #region SA
              if (Core.SA)
              {
                  index = this.AddCraft(typeof(GargishBanner), 1044294, 1095312, 94.7, 115.0, typeof(Board), 1044041, 50, 1044351);
                  this.AddSkill(index, SkillName.Tailoring, 75.0, 105.0);
                  this.AddRes(index, typeof(Cloth), 1044286, 50, 1044287);
                  this.SetNeededExpansion(index, Expansion.SA);
  
                  index = this.AddCraft(typeof(ExodusSummoningAlter), 1044294, 1153502, 95.0, 120.0, typeof(Log), 1044041, 100, 1044351);
                  this.AddSkill(index, SkillName.Magery, 75.0, 120.0);
  
gt:                 this.AddRes(index, typeof(Granite), 1044607, 10, 1044253);