Full Version : DefMarbleCrafting Question
xmlspawner >>Scripting Support >>DefMarbleCrafting Question
<< Prev | Next >>
Erica- 03-30-2007
Hi was wondering what needs to be added to make it where when you make item of marble would show Crafted By Tom .
Name Tom is a example so it would say who made it when you point on the item created.Heres The Script Thanks.

CODE
using System; using Server.Items; using Server.Mobiles; namespace Server.Engines.Craft {
public class DefMarbleCrafting : CraftSystem
{
public override SkillName MainSkill
{
get { return SkillName.Mining; }
}
private static CraftSystem m_CraftSystem;
public static CraftSystem CraftSystem
{
get
{
if ( m_CraftSystem == null )
m_CraftSystem = new DefMarbleCrafting();
return m_CraftSystem;
}
}
public override CraftECA ECA{ get{ return CraftECA.ChanceMinusSixtyToFourtyFive; } }
public override double GetChanceAtMin( CraftItem item )
{
return 0.0; // 0%
}
private DefMarbleCrafting() : base( 1, 1, 1.25 )// base( 1, 1, 1.5 )
{
}
public override bool RetainsColorFrom( CraftItem item, Type type )
{
return true;
}
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if ( tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
else if ( !(from is PlayerMobile && ((PlayerMobile)from).Masonry && from.Skills[SkillName.Mining].Base >= 50.0) )
return 1044633; // You havent learned stonecraft.
else if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // 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;
/* Begin Ressources */
AddCraft( typeof( RawMarbleBlock ), "Ressources", "Raw Marble Block", 80.0, 120.0, typeof( Granite ), "Granite", 1, "You need more Granite" );
AddCraft( typeof( RawMarbleBlockDullCopper ), "Ressources", "Raw Marble Block (DullCopper)", 80.0, 120.0, typeof( DullCopperGranite ), "Granite (Dull Copper)", 1, "You need more Dull Copper Granite" );
AddCraft( typeof( RawMarbleBlockShadowIron ), "Ressources", "Raw Marble Block (Shadow Iron)", 80.0, 120.0, typeof( ShadowIronGranite ), "Granite (Shadow Iron)", 1, "You need more Shadow Iron Granite" );
AddCraft( typeof( RawMarbleBlockCopper ), "Ressources", "Raw Marble Block (Copper)", 80.0, 120.0, typeof( CopperGranite ), "Granite (Copper)", 1, "You need more Copper Granite" );
AddCraft( typeof( RawMarbleBlockBronze ), "Ressources", "Raw Marble Block (Bronze)", 80.0, 120.0, typeof( BronzeGranite ), "Granite (Bronze)", 1, "You need more BronzeGranit" );
AddCraft( typeof( RawMarbleBlockGold ), "Ressources", "Raw Marble Block (Gold)", 80.0, 120.0, typeof( GoldGranite ), "Granite (Gold)", 1, "You need more Gold Granite" );
AddCraft( typeof( RawMarbleBlockAgapite ), "Ressources", "Raw Marble Block (Agapite)", 80.0, 120.0, typeof( AgapiteGranite ), "Granite (Agapite)", 1, "You need more Agapite Granite" );
AddCraft( typeof( RawMarbleBlockVerite ), "Ressources", "Raw Marble Block (Verite)", 80.0, 120.0, typeof( VeriteGranite ), "Granite (Verite)", 1, "You need more Verite Granite" );
AddCraft( typeof( RawMarbleBlockValorite ), "Ressources", "Raw Marble Block (Valorite)", 80.0, 120.0, typeof( ValoriteGranite ), "Granite (Valorite)", 1, "You need more Valorite Granite" );
/* End Ressources */
/* Begin Benches */
AddCraft( typeof( MarbleBenchSmallSouthAddonDeed ), "Benches", "Small Marble Bench (South)", 80.0, 100.0, typeof( RawMarbleBlock ), "Raw Marble Block", 1, "You need more marble!" );
AddCraft( typeof( MarbleBenchSmallEastAddonDeed ), "Benches", "Small Marble Bench(East)", 80.0, 100.0, typeof( RawMarbleBlock ), "Raw Marble Block", 1, "You need more marble!" );
AddCraft( typeof( MarbleBenchMediumSouthAddonDeed ), "Benches", "Medium Marble Bench (South)", 80.0, 105.0, typeof( RawMarbleBlock ), "Raw Marble Block", 2, "You need more marble!" );
AddCraft( typeof( MarbleBenchMediumEastAddonDeed ), "Benches", "Medium Marble Bench(East)", 80.0, 105.0, typeof( RawMarbleBlock ), "Raw Marble Block", 2, "You need more marble!" );
AddCraft( typeof( MarbleBenchLongSouthAddonDeed ), "Benches", "Long Marble Bench (South)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 3, "You need more marble!" );
AddCraft( typeof( MarbleBenchLongEastAddonDeed ), "Benches", "Long Marble Bench (East)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 3, "You need more marble!" );
/* End Benches */
/* Begin Statues */
AddCraft( typeof( LightMarbleDaemonStatueAddonDeed ), "Statues", "Daemon-Statue (Bright Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
AddCraft( typeof( DarkMarbleDaemonStatueAddonDeed ), "Statues", "Daemon-Statue (Dark Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
AddCraft( typeof( LightMarbleGargoyleStatueAddonDeed ), "Statues", "Gargoyle-Statue (Bright Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
AddCraft( typeof( DarkMarbleGargoyleStatueAddonDeed ), "Statues", "Gargoyle-Statue (Dark Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
AddCraft( typeof( LightMarbleNightmareStatueAddonDeed ), "Statues", "Nightmare-Statue (Bright Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
AddCraft( typeof( DarkMarbleNightmareStatueAddonDeed ), "Statues", "Nightmare-Statue (Dark Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
AddCraft( typeof( LightMarbleUnicornStatueAddonDeed ), "Statues", "Unicorn-Statue (Bright Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
AddCraft( typeof( DarkMarbleUnicornStatueAddonDeed ), "Statues", "Unicorn-Statue (Dark Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
AddCraft( typeof( LightMarbleRunebeetleStatueAddonDeed ), "Statues", "Runebeetle-Statue (Bright Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
AddCraft( typeof( DarkMarbleRunebeetleStatueAddonDeed ), "Statues", "Runebeetle-Statue (Dark Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
AddCraft( typeof( LightMarbleSkeletonwarriorStatueAddonDeed ), "Statues", "Skeletonwarrior-Statue (Bright Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
AddCraft( typeof( DarkMarbleSkeletonwarriorStatueAddonDeed ), "Statues", "Skeletonwarrior-Statue (Dark Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
AddCraft( typeof( LightMarbleSnowleopardStatueAddonDeed ), "Statues", "Snowleopard-Statue (Bright Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
AddCraft( typeof( DarkMarbleSnowleopardStatueAddonDeed ), "Statues", "Snowleopard-Statue (Dark Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
AddCraft( typeof( LightMarbleWolfStatueAddonDeed ), "Statues", "Wolf-Statue (Bright Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
AddCraft( typeof( DarkMarbleWolfStatueAddonDeed ), "Statues", "Wolf-Statue (Dark Pedestal)", 80.0, 110.0, typeof( RawMarbleBlock ), "Raw Marble Block", 5, "You need more marble!" );
/* End Statues */
SetSubRes( typeof( RawMarbleBlock ), 1044525 );
AddSubRes( typeof( RawMarbleBlock ), 1044525, 00.0, 1044514, 1044526 );
AddSubRes( typeof( RawMarbleBlockDullCopper ), 1044023, 00.0, 1044514, 1044527 );
AddSubRes( typeof( RawMarbleBlockShadowIron ), 1044024, 00.0, 1044514, 1044527 );
AddSubRes( typeof( RawMarbleBlockCopper ), 1044025, 00.0, 1044514, 1044527 );
AddSubRes( typeof( RawMarbleBlockBronze ), 1044026, 00.0, 1044514, 1044527 );
AddSubRes( typeof( RawMarbleBlockGold ), 1044027, 00.0, 1044514, 1044527 );
AddSubRes( typeof( RawMarbleBlockAgapite ), 1044028, 00.0, 1044514, 1044527 );
AddSubRes( typeof( RawMarbleBlockVerite ), 1044029, 00.0, 1044514, 1044527 );
AddSubRes( typeof( RawMarbleBlockValorite ), 1044030, 00.0, 1044514, 1044527 );
}
}
}

ArteGordon- 03-31-2007
if you set the MarkOption to true in your InitCraftList method, then you will have the option to mark in the craft gump

QUOTE
SetSubRes( typeof( RawMarbleBlock ), 1044525 ); AddSubRes( typeof( RawMarbleBlock ), 1044525, 00.0, 1044514, 1044526 ); AddSubRes( typeof( RawMarbleBlockDullCopper ), 1044023, 00.0, 1044514, 1044527 ); AddSubRes( typeof( RawMarbleBlockShadowIron ), 1044024, 00.0, 1044514, 1044527 );
AddSubRes( typeof( RawMarbleBlockCopper ), 1044025, 00.0, 1044514, 1044527 );
AddSubRes( typeof( RawMarbleBlockBronze ), 1044026, 00.0, 1044514, 1044527 );
AddSubRes( typeof( RawMarbleBlockGold ), 1044027, 00.0, 1044514, 1044527 );
AddSubRes( typeof( RawMarbleBlockAgapite ), 1044028, 00.0, 1044514, 1044527 );
AddSubRes( typeof( RawMarbleBlockVerite ), 1044029, 00.0, 1044514, 1044527 );
AddSubRes( typeof( RawMarbleBlockValorite ), 1044030, 00.0, 1044514, 1044527 );
MarkOption = true;
}