Fixes casting checks

This commit is contained in:
Kamron Batman 2018-08-19 01:38:55 +08:00
parent 7ea00fbf4f
commit 03dd5f1926
431 changed files with 5616 additions and 6250 deletions

View file

@ -104,8 +104,8 @@ namespace Server.Engines.Craft
}
// ****************************************
if ( notice is int && (int)notice > 0 )
AddHtmlLocalized( 170, 295, 350, 40, (int)notice, LabelColor, false, false );
if ( notice is int noticeInt && noticeInt > 0 )
AddHtmlLocalized( 170, 295, 350, 40, noticeInt, 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 );
@ -115,7 +115,7 @@ namespace Server.Engines.Craft
string nameString = craftSystem.CraftSubRes.NameString;
int nameNumber = craftSystem.CraftSubRes.NameNumber;
int resIndex = ( context == null ? -1 : context.LastResourceIndex );
int resIndex = context?.LastResourceIndex ?? -1;
Type resourceType = craftSystem.CraftSubRes.ResType;
@ -616,4 +616,4 @@ namespace Server.Engines.Craft
}
}
}
}
}

View file

@ -62,9 +62,9 @@ namespace Server.Engines.Craft
AddButton( 15, 387, 4014, 4016, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 50, 390, 150, 18, 1044150, LabelColor, false, false ); // BACK
bool needsRecipe = ( craftItem.Recipe != null && from is PlayerMobile && !((PlayerMobile)from).HasRecipe( craftItem.Recipe ) );
bool needsRecipe = ( craftItem.Recipe != null && from is PlayerMobile mobile && !mobile.HasRecipe( craftItem.Recipe ) );
if( needsRecipe )
if ( needsRecipe )
{
AddButton( 270, 387, 4005, 4007, 0, GumpButtonType.Page, 0 );
AddHtmlLocalized( 305, 390, 150, 18, 1044151, GreyLabelColor, false, false ); // MAKE NOW
@ -88,17 +88,17 @@ namespace Server.Engines.Craft
DrawResource();
/*
if( craftItem.RequiresSE )
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 )
if ( craftItem.RequiredExpansion != Expansion.None )
{
bool supportsEx = (from.NetState != null && from.NetState.SupportsExpansion( craftItem.RequiredExpansion ));
TextDefinition.AddHtmlText( this, 170, 302 + (m_OtherCount++ * 20), 310, 18, RequiredExpansionMessage( craftItem.RequiredExpansion ), false, false, supportsEx ? LabelColor : RedLabelColor, supportsEx ? LabelHue : RedLabelHue );
}
if( needsRecipe )
if ( needsRecipe )
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1073620, RedLabelColor, false, false ); // You have not learned this recipe.
}
@ -167,9 +167,9 @@ namespace Server.Engines.Craft
if ( m_ShowExceptionalChance )
{
if( excepChance < 0.0 )
if ( excepChance < 0.0 )
excepChance = 0.0;
else if( excepChance > 1.0 )
else if ( excepChance > 1.0 )
excepChance = 1.0;
AddHtmlLocalized( 170, 100, 250, 18, 1044058, 32767, false, false ); // Exceptional Chance:
@ -207,7 +207,7 @@ namespace Server.Engines.Craft
type = craftResource.ItemType;
nameString = craftResource.NameString;
nameNumber = craftResource.NameNumber;
// Resource Mutation
if ( type == res.ResType && resIndex > -1 )
{
@ -284,4 +284,4 @@ namespace Server.Engines.Craft
}
}
}
}
}

View file

@ -72,7 +72,7 @@ namespace Server.Engines.Craft
public void AddRecipe( int id, CraftSystem system )
{
if( m_Recipe != null )
if ( m_Recipe != null )
{
Console.WriteLine( "Warning: Attempted add of recipe #{0} to the crafting of {1} in CraftSystem {2}.", id, this.m_Type.Name, system );
return;
@ -395,7 +395,7 @@ namespace Server.Engines.Craft
public bool IsMarkable( Type type )
{
if( m_ForceNonExceptional ) //Don't even display the stuff for marking if it can't ever be exceptional.
if ( m_ForceNonExceptional ) //Don't even display the stuff for marking if it can't ever be exceptional.
return false;
for ( int i = 0; i < m_MarkableTable.Length; ++i )
@ -526,15 +526,13 @@ namespace Server.Engines.Craft
for ( int j = 0; j < items[i].Length; ++j )
{
IHasQuantity hq = items[i][j] as IHasQuantity;
if ( hq == null )
if ( !(items[i][j] is IHasQuantity hq) )
{
totals[i] += items[i][j].Amount;
}
else
{
if ( hq is BaseBeverage && ((BaseBeverage)hq).Content != m_RequiredBeverage )
if ( hq is BaseBeverage beverage && beverage.Content != m_RequiredBeverage )
continue;
totals[i] += hq.Quantity;
@ -552,9 +550,8 @@ namespace Server.Engines.Craft
for ( int j = 0; j < items[i].Length; ++j )
{
Item item = items[i][j];
IHasQuantity hq = item as IHasQuantity;
if ( hq == null )
if ( !(item is IHasQuantity hq) )
{
int theirAmount = item.Amount;
@ -571,7 +568,7 @@ namespace Server.Engines.Craft
}
else
{
if ( hq is BaseBeverage && ((BaseBeverage)hq).Content != m_RequiredBeverage )
if ( hq is BaseBeverage beverage && beverage.Content != m_RequiredBeverage )
continue;
int theirAmount = hq.Quantity;
@ -601,15 +598,13 @@ namespace Server.Engines.Craft
for ( int i = 0; i < items.Length; ++i )
{
IHasQuantity hq = items[i] as IHasQuantity;
if ( hq == null )
if ( !(items[i] is IHasQuantity hq) )
{
amount += items[i].Amount;
}
else
{
if ( hq is BaseBeverage && ((BaseBeverage)hq).Content != m_RequiredBeverage )
if ( hq is BaseBeverage beverage && beverage.Content != m_RequiredBeverage )
continue;
amount += hq.Quantity;
@ -862,26 +857,20 @@ namespace Server.Engines.Craft
public double GetExceptionalChance( CraftSystem system, double chance, Mobile from )
{
if( m_ForceNonExceptional )
if ( m_ForceNonExceptional )
return 0.0;
double bonus = 0.0;
if ( from.Talisman is BaseTalisman )
if ( from.Talisman is BaseTalisman talisman && talisman.Skill == system.MainSkill )
{
BaseTalisman talisman = (BaseTalisman) from.Talisman;
if ( talisman.Skill == system.MainSkill )
{
chance -= talisman.SuccessBonus / 100.0;
bonus = talisman.ExceptionalBonus / 100.0;
}
chance -= talisman.SuccessBonus / 100.0;
bonus = talisman.ExceptionalBonus / 100.0;
}
switch ( system.ECA )
{
default:
case CraftECA.ChanceMinusSixty: chance -= 0.6; break;
default: chance -= 0.6; break;
case CraftECA.FiftyPercentChanceMinusTenPercent: chance = chance * 0.5 - 0.1; break;
case CraftECA.ChanceMinusSixtyToFourtyFive:
{
@ -955,13 +944,8 @@ namespace Server.Engines.Craft
else
chance = 0.0;
if ( allRequiredSkills && from.Talisman is BaseTalisman )
{
BaseTalisman talisman = (BaseTalisman) from.Talisman;
if ( talisman.Skill == craftSystem.MainSkill )
chance += talisman.SuccessBonus / 100.0;
}
if ( allRequiredSkills && from.Talisman is BaseTalisman talisman && talisman.Skill == craftSystem.MainSkill )
chance += talisman.SuccessBonus / 100.0;
if ( allRequiredSkills && valMainSkill == maxMainSkill )
chance = 1.0;
@ -973,32 +957,32 @@ namespace Server.Engines.Craft
{
if ( from.BeginAction( typeof( CraftSystem ) ) )
{
if( RequiredExpansion == Expansion.None || ( from.NetState != null && from.NetState.SupportsExpansion( RequiredExpansion ) ) )
if ( RequiredExpansion == Expansion.None || ( from.NetState != null && from.NetState.SupportsExpansion( RequiredExpansion ) ) )
{
bool allRequiredSkills = true;
double chance = GetSuccessChance( from, typeRes, craftSystem, false, ref allRequiredSkills );
if ( allRequiredSkills && chance >= 0.0 )
{
if( this.Recipe == null || !(from is PlayerMobile) || ((PlayerMobile)from).HasRecipe( this.Recipe ) )
if ( this.Recipe == null || !(from is PlayerMobile) || ((PlayerMobile)from).HasRecipe( this.Recipe ) )
{
int badCraft = craftSystem.CanCraft( from, tool, m_Type );
if( badCraft <= 0 )
if ( badCraft <= 0 )
{
int resHue = 0;
int maxAmount = 0;
object message = null;
if( ConsumeRes( from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.None, ref message ) )
if ( ConsumeRes( from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.None, ref message ) )
{
message = null;
if( ConsumeAttributes( from, ref message, false ) )
if ( ConsumeAttributes( from, ref message, false ) )
{
CraftContext context = craftSystem.GetContext( from );
if( context != null )
if ( context != null )
context.OnMade( this );
int iMin = craftSystem.MinCraftEffect;
@ -1080,25 +1064,15 @@ namespace Server.Engines.Craft
object checkMessage = null;
// Not enough resource to craft it
if ( !ConsumeRes( from, typeRes, craftSystem, ref checkResHue, ref checkMaxAmount, ConsumeType.None, ref checkMessage ) )
if ( !(ConsumeRes( from, typeRes, craftSystem, ref checkResHue, ref checkMaxAmount, ConsumeType.None, ref checkMessage )
&& ConsumeAttributes( from, ref checkMessage, false )))
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, checkMessage ) );
else if ( checkMessage is int && (int)checkMessage > 0 )
from.SendLocalizedMessage( (int)checkMessage );
else if ( checkMessage is string )
from.SendMessage( (string)checkMessage );
return;
}
else if ( !ConsumeAttributes( from, ref checkMessage, false ) )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, checkMessage ) );
else if ( checkMessage is int && (int)checkMessage > 0 )
from.SendLocalizedMessage( (int)checkMessage );
else if ( checkMessage is string )
from.SendMessage( (string)checkMessage );
else if ( checkMessage is int messageInt && messageInt > 0 )
from.SendLocalizedMessage( messageInt );
else
from.SendMessage( checkMessage.ToString() );
return;
}
@ -1119,25 +1093,15 @@ namespace Server.Engines.Craft
object message = null;
// Not enough resource to craft it
if ( !ConsumeRes( from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.All, ref message ) )
if ( !(ConsumeRes( from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.All, ref message )
&& ConsumeAttributes( from, ref message, true )))
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, message ) );
else if ( message is int && (int)message > 0 )
from.SendLocalizedMessage( (int)message );
else if ( message is string )
from.SendMessage( (string)message );
return;
}
else if ( !ConsumeAttributes( from, ref message, true ) )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, message ) );
else if ( message is int && (int)message > 0 )
from.SendLocalizedMessage( (int)message );
else if ( message is string )
from.SendMessage( (string)message );
else if ( message is int messageIn && messageIn > 0 )
from.SendLocalizedMessage( messageIn );
else
from.SendMessage( message.ToString() );
return;
}
@ -1146,8 +1110,7 @@ namespace Server.Engines.Craft
if ( craftSystem is DefBlacksmithy )
{
AncientSmithyHammer hammer = from.FindItemOnLayer( Layer.OneHanded ) as AncientSmithyHammer;
if ( hammer != null && hammer != tool )
if ( from.FindItemOnLayer( Layer.OneHanded ) is AncientSmithyHammer hammer && hammer != tool )
{
hammer.UsesRemaining--;
if ( hammer.UsesRemaining < 1 )
@ -1180,22 +1143,22 @@ namespace Server.Engines.Craft
if ( item != null )
{
if( item is ICraftable )
endquality = ((ICraftable)item).OnCraft( quality, makersMark, from, craftSystem, typeRes, tool, this, resHue );
if ( item is ICraftable craftable )
endquality = craftable.OnCraft( quality, makersMark, from, craftSystem, typeRes, tool, this, resHue );
else if ( item.Hue == 0 )
item.Hue = resHue;
if ( maxAmount > 0 )
{
if ( !item.Stackable && item is IUsesRemaining )
((IUsesRemaining)item).UsesRemaining *= maxAmount;
if ( !item.Stackable && item is IUsesRemaining remaining )
remaining.UsesRemaining *= maxAmount;
else
item.Amount = maxAmount;
}
from.AddToBackpack( item );
if( from.AccessLevel > AccessLevel.Player )
if ( from.AccessLevel > AccessLevel.Player )
CommandLogging.WriteLine( from, "Crafting {0} with craft system {1}", CommandLogging.Format( item ), craftSystem.GetType().Name );
//from.PlaySound( 0x57 );
@ -1266,10 +1229,10 @@ namespace Server.Engines.Craft
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, message ) );
else if ( message is int && (int)message > 0 )
from.SendLocalizedMessage( (int)message );
else if ( message is string )
from.SendMessage( (string)message );
else if ( message is int messageInt && messageInt > 0 )
from.SendLocalizedMessage( messageInt );
else
from.SendMessage( message.ToString() );
return;
}

View file

@ -32,18 +32,14 @@ namespace Server.Engines.Craft
if ( !(item is BaseArmor) && !(item is BaseWeapon) )
return EnhanceResult.BadItem;
if ( item is IArcaneEquip )
{
IArcaneEquip eq = (IArcaneEquip)item;
if ( eq.IsArcane )
return EnhanceResult.BadItem;
}
if ( item is IArcaneEquip eq && eq.IsArcane )
return EnhanceResult.BadItem;
if ( CraftResources.IsStandard( resource ) )
return EnhanceResult.BadResource;
int num = craftSystem.CanCraft( from, tool, item.GetType() );
if ( num > 0 )
{
resMessage = num;
@ -56,7 +52,7 @@ namespace Server.Engines.Craft
return EnhanceResult.BadItem;
bool allRequiredSkills = false;
if( craftItem.GetSuccessChance( from, resType, craftSystem, false, ref allRequiredSkills ) <= 0.0 )
if ( craftItem.GetSuccessChance( from, resType, craftSystem, false, ref allRequiredSkills ) <= 0.0 )
return EnhanceResult.NoSkill;
CraftResourceInfo info = CraftResources.GetInfo( resource );
@ -76,8 +72,7 @@ namespace Server.Engines.Craft
if ( craftSystem is DefBlacksmithy )
{
AncientSmithyHammer hammer = from.FindItemOnLayer( Layer.OneHanded ) as AncientSmithyHammer;
if ( hammer != null )
if ( from.FindItemOnLayer( Layer.OneHanded ) is AncientSmithyHammer hammer )
{
hammer.UsesRemaining--;
if ( hammer.UsesRemaining < 1 )
@ -99,10 +94,8 @@ namespace Server.Engines.Craft
bool lreqBonus = false;
bool dincBonus = false;
if ( item is BaseWeapon )
if ( item is BaseWeapon weapon )
{
BaseWeapon weapon = (BaseWeapon)item;
if ( !CraftResources.IsStandard( weapon.Resource ) )
return EnhanceResult.AlreadyEnhanced;
@ -203,17 +196,15 @@ namespace Server.Engines.Craft
if ( !craftItem.ConsumeRes( from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.All, ref resMessage ) )
return EnhanceResult.NoResources;
if( item is BaseWeapon )
if ( item is BaseWeapon w )
{
BaseWeapon w = (BaseWeapon)item;
w.Resource = resource;
int hue = w.GetElementalDamageHue();
if( hue > 0 )
if ( hue > 0 )
w.Hue = hue;
}
else if( item is BaseArmor ) //Sanity
else
{
((BaseArmor)item).Resource = resource;
}
@ -302,10 +293,10 @@ namespace Server.Engines.Craft
protected override void OnTarget( Mobile from, object targeted )
{
if ( targeted is Item )
if ( targeted is Item item )
{
object message = null;
EnhanceResult res = Enhance.Invoke( from, m_CraftSystem, m_Tool, (Item)targeted, m_Resource, m_ResourceType, ref message );
EnhanceResult res = Enhance.Invoke( from, m_CraftSystem, m_Tool, item, m_Resource, m_ResourceType, ref message );
switch ( res )
{
@ -324,4 +315,4 @@ namespace Server.Engines.Craft
}
}
}
}
}

View file

@ -24,10 +24,10 @@ namespace Server.Engines.Craft
m.BeginTarget( -1, false, Server.Targeting.TargetFlags.None, new TargetCallback(
delegate( Mobile from, object targeted )
{
if( targeted is PlayerMobile )
if ( targeted is PlayerMobile mobile )
{
foreach( KeyValuePair<int, Recipe> kvp in m_Recipes )
((PlayerMobile)targeted).AcquireRecipe( kvp.Key );
mobile.AcquireRecipe( kvp.Key );
m.SendMessage( "You teach them all of the recipies." );
}
@ -49,9 +49,9 @@ namespace Server.Engines.Craft
m.BeginTarget( -1, false, Server.Targeting.TargetFlags.None, new TargetCallback(
delegate( Mobile from, object targeted )
{
if( targeted is PlayerMobile )
if ( targeted is PlayerMobile mobile )
{
((PlayerMobile)targeted).ResetRecipes();
mobile.ResetRecipes();
m.SendMessage( "They forget all their recipies." );
}
@ -99,7 +99,7 @@ namespace Server.Engines.Craft
{
get
{
if( m_TD == null )
if ( m_TD == null )
m_TD = new TextDefinition( m_CraftItem.NameNumber, m_CraftItem.NameString );
return m_TD;
@ -112,7 +112,7 @@ namespace Server.Engines.Craft
m_System = system;
m_CraftItem = item;
if( m_Recipes.ContainsKey( id ) )
if ( m_Recipes.ContainsKey( id ) )
throw new Exception( "Attempting to create recipe with preexisting ID." );
m_Recipes.Add( id, this );

View file

@ -68,15 +68,15 @@ namespace Server.Engines.Craft
double difficulty = GetRepairDifficulty( curHits, maxHits ) * 0.1;
if( m_Deed != null )
if ( m_Deed != null )
{
double value = m_Deed.SkillLevel;
double minSkill = difficulty - 25.0;
double maxSkill = difficulty + 25;
if( value < minSkill )
if ( value < minSkill )
return false; // Too difficult
else if( value >= maxSkill )
else if ( value >= maxSkill )
return true; // No challenge
double chance = (value - minSkill) / (maxSkill - minSkill);
@ -91,7 +91,7 @@ namespace Server.Engines.Craft
private bool CheckDeed( Mobile from )
{
if( m_Deed != null )
if ( m_Deed != null )
{
return m_Deed.Check( from );
}
@ -211,7 +211,7 @@ namespace Server.Engines.Craft
{
int number;
if( !CheckDeed( from ) )
if ( !CheckDeed( from ) )
return;
bool usingDeed = (m_Deed != null);
@ -223,9 +223,8 @@ namespace Server.Engines.Craft
{
number = 1044282; // You must be near a forge and and anvil to repair items. * Yes, there are two and's *
}
else if ( m_CraftSystem is DefTinkering && targeted is Golem )
else if ( m_CraftSystem is DefTinkering && targeted is Golem g )
{
Golem g = (Golem)targeted;
int damage = g.HitsMax - g.Hits;
if ( g.IsDeadBondedPet )
@ -286,9 +285,8 @@ namespace Server.Engines.Craft
}
}
}
else if ( targeted is BaseWeapon )
else if ( targeted is BaseWeapon weapon )
{
BaseWeapon weapon = (BaseWeapon)targeted;
SkillName skill = m_CraftSystem.MainSkill;
int toWeaken = 0;
@ -351,9 +349,8 @@ namespace Server.Engines.Craft
toDelete = true;
}
}
else if ( targeted is BaseArmor )
else if ( targeted is BaseArmor armor )
{
BaseArmor armor = (BaseArmor)targeted;
SkillName skill = m_CraftSystem.MainSkill;
int toWeaken = 0;
@ -412,9 +409,8 @@ namespace Server.Engines.Craft
toDelete = true;
}
}
else if ( targeted is BaseClothing )
else if ( targeted is BaseClothing clothing )
{
BaseClothing clothing = (BaseClothing)targeted;
SkillName skill = m_CraftSystem.MainSkill;
int toWeaken = 0;
@ -434,7 +430,7 @@ namespace Server.Engines.Craft
toWeaken = 3;
}
if (m_CraftSystem.CraftItems.SearchForSubclass(clothing.GetType()) == null && !IsSpecialClothing(clothing) && !((targeted is TribalMask) || (targeted is HornedTribalMask)) )
if (m_CraftSystem.CraftItems.SearchForSubclass(clothing.GetType()) == null && !IsSpecialClothing(clothing) && !((clothing is TribalMask) || (clothing is HornedTribalMask)) )
{
number = (usingDeed) ? 1061136 : 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
}
@ -473,13 +469,13 @@ namespace Server.Engines.Craft
toDelete = true;
}
}
else if( !usingDeed && targeted is BlankScroll )
else if ( !usingDeed && targeted is BlankScroll scroll )
{
SkillName skill = m_CraftSystem.MainSkill;
if( from.Skills[skill].Value >= 50.0 )
if ( from.Skills[skill].Value >= 50.0 )
{
((BlankScroll)targeted).Consume( 1 );
scroll.Consume( 1 );
RepairDeed deed = new RepairDeed( RepairDeed.GetTypeFor( m_CraftSystem ), from.Skills[skill].Value, from );
from.AddToBackpack( deed );
@ -497,7 +493,7 @@ namespace Server.Engines.Craft
number = 500426; // You can't repair that.
}
if( !usingDeed )
if ( !usingDeed )
{
CraftContext context = m_CraftSystem.GetContext( from );
from.SendGump( new CraftGump( from, m_CraftSystem, m_Tool, number ) );
@ -506,10 +502,10 @@ namespace Server.Engines.Craft
{
from.SendLocalizedMessage( number );
if( toDelete )
if ( toDelete )
m_Deed.Delete();
}
}
}
}
}
}

View file

@ -90,7 +90,7 @@ namespace Server.Engines.Craft
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) )
if ( item is DragonBardingDeed || (item is BaseArmor armor && armor.PlayerConstructed) || (item is BaseWeapon weapon && weapon.PlayerConstructed) || (item is BaseClothing clothing && clothing.PlayerConstructed) )
ingot.Amount = craftResource.Amount / 2;
else
ingot.Amount = 1;
@ -118,7 +118,7 @@ namespace Server.Engines.Craft
if ( num == 1044267 )
{
bool anvil, forge;
DefBlacksmithy.CheckAnvilAndForge( from, 2, out anvil, out forge );
if ( !anvil )
@ -135,19 +135,19 @@ namespace Server.Engines.Craft
bool isStoreBought = false;
int message;
if ( targeted is BaseArmor )
if ( targeted is BaseArmor armor )
{
result = Resmelt( from, (BaseArmor)targeted, ((BaseArmor)targeted).Resource );
isStoreBought = !((BaseArmor)targeted).PlayerConstructed;
result = Resmelt( from, armor, armor.Resource );
isStoreBought = !armor.PlayerConstructed;
}
else if ( targeted is BaseWeapon )
else if ( targeted is BaseWeapon weapon )
{
result = Resmelt( from, (BaseWeapon)targeted, ((BaseWeapon)targeted).Resource );
isStoreBought = !((BaseWeapon)targeted).PlayerConstructed;
result = Resmelt( from, weapon, weapon.Resource );
isStoreBought = !weapon.PlayerConstructed;
}
else if ( targeted is DragonBardingDeed )
else if ( targeted is DragonBardingDeed deed )
{
result = Resmelt( from, (DragonBardingDeed)targeted, ((DragonBardingDeed)targeted).Resource );
result = Resmelt( from, deed, deed.Resource );
isStoreBought = false;
}
@ -164,4 +164,4 @@ namespace Server.Engines.Craft
}
}
}
}
}

View file

@ -39,7 +39,7 @@ namespace Server.Engines.Craft
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
else if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
@ -154,7 +154,7 @@ namespace Server.Engines.Craft
index = AddCraft( typeof( GreaterExplosionPotion ), 1044537, 1044557, 65.0, 115.0, typeof( SulfurousAsh ), 1044359, 10, 1044367 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( SmokeBomb ), 1044537, 1030248, 90.0, 120.0, typeof( Eggs ), 1044477, 1, 1044253 );
AddRes( index, typeof ( Ginseng ), 1044356, 3, 1044364 );
@ -177,4 +177,4 @@ namespace Server.Engines.Craft
}
}
}
}
}

View file

@ -229,7 +229,7 @@ namespace Server.Engines.Craft
if ( Core.AOS ) // exact pre-aos functionality unknown
AddCraft( typeof( DragonBardingDeed ), 1011078, 1053012, 72.5, 122.5, typeof( IronIngot ), 1044036, 750, 1044037 );
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( PlateMempo ), 1011078, 1030180, 80.0, 130.0, typeof( IronIngot ), 1044036, 18, 1044037 );
SetNeededExpansion( index, Expansion.SE );
@ -256,7 +256,7 @@ namespace Server.Engines.Craft
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 )
if ( Core.SE )
{
index = AddCraft( typeof( ChainHatsuburi ), 1011079, 1030175, 30.0, 80.0, typeof( IronIngot ), 1044036, 20, 1044037 );
SetNeededExpansion( index, Expansion.SE );
@ -282,7 +282,7 @@ namespace Server.Engines.Craft
index = AddCraft( typeof( StandardPlateKabuto ), 1011079, 1030196, 90.0, 140.0, typeof( IronIngot ), 1044036, 25, 1044037 );
SetNeededExpansion( index, Expansion.SE );
if( Core.ML )
if ( Core.ML )
{
index = AddCraft( typeof( Circlet ), 1011079, 1032645, 62.1, 112.1, typeof( IronIngot ), 1044036, 6, 1044037 );
SetNeededExpansion( index, Expansion.ML );
@ -332,7 +332,7 @@ namespace Server.Engines.Craft
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 )
if ( Core.SE )
{
index = AddCraft( typeof( NoDachi ), 1011081, 1030221, 75.0, 125.0, typeof( IronIngot ), 1044036, 18, 1044037 );
SetNeededExpansion( index, Expansion.SE );
@ -351,7 +351,7 @@ namespace Server.Engines.Craft
index = AddCraft( typeof( Sai ), 1011081, 1030234, 50.0, 100.0, typeof( IronIngot ), 1044036, 12, 1044037 );
SetNeededExpansion( index, Expansion.SE );
if( Core.ML )
if ( Core.ML )
{
index = AddCraft( typeof( RadiantScimitar ), 1011081, 1031571, 75.0, 125.0, typeof( IronIngot ), 1044036, 15, 1044037 );
SetNeededExpansion( index, Expansion.ML );
@ -565,7 +565,7 @@ namespace Server.Engines.Craft
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 )
if ( Core.ML )
{
index = AddCraft( typeof( OrnateAxe ), 1011082, 1031572, 70.0, 120.0, typeof( IronIngot ), 1044036, 18, 1044037 );
SetNeededExpansion( index, Expansion.ML );
@ -634,7 +634,7 @@ namespace Server.Engines.Craft
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 )
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 );
@ -642,7 +642,7 @@ namespace Server.Engines.Craft
SetNeededExpansion( index, Expansion.SE );
}
if( Core.ML )
if ( Core.ML )
{
index = AddCraft( typeof( DiamondMace ), 1011084, 1031556, 70.0, 120.0, typeof( IronIngot ), 1044036, 20, 1044037 );
SetNeededExpansion( index, Expansion.ML );

View file

@ -39,7 +39,7 @@ namespace Server.Engines.Craft
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
else if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
@ -102,7 +102,7 @@ namespace Server.Engines.Craft
AddRes( index, typeof( Feather ), 1044562, 1, 1044563 );
SetUseAllRes( index, true );
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( FukiyaDarts ), 1044565, 1030246, 50.0, 90.0, typeof( Log ), 1044041, 1, 1044351 );
SetUseAllRes( index, true );
@ -120,7 +120,7 @@ namespace Server.Engines.Craft
AddCraft( typeof( RepeatingCrossbow ), 1044566, 1029923, 90.0, 130.0, typeof( Log ), 1044041, 10, 1044351 );
}
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( Yumi ), 1044566, 1030224, 90.0, 130.0, typeof( Log ), 1044041, 10, 1044351 );
SetNeededExpansion( index, Expansion.SE );

View file

@ -39,7 +39,7 @@ namespace Server.Engines.Craft
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
else if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
@ -98,7 +98,7 @@ namespace Server.Engines.Craft
AddCraft( typeof( TallMusicStand ), 1044294, 1044315, 81.5, 106.5, typeof( Log ), 1044041, 20, 1044351 );
AddCraft( typeof( Easle ), 1044294, 1044317, 86.8, 111.8, typeof( Log ), 1044041, 20, 1044351 );
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( RedHangingLantern ), 1044294, 1029412, 65.0, 90.0, typeof( Log ), 1044041, 5, 1044351 );
AddRes( index, typeof( BlankScroll ), 1044377, 10, 1044378 );
@ -119,7 +119,7 @@ namespace Server.Engines.Craft
SetNeededExpansion( index, Expansion.SE );
}
if( Core.AOS ) //Duplicate Entries to preserve ordering depending on era
if ( Core.AOS ) //Duplicate Entries to preserve ordering depending on era
{
index = AddCraft( typeof( FishingPole ), 1044294, 1023519, 68.4, 93.4, typeof( Log ), 1044041, 5, 1044351 ); //This is in the categor of Other during AoS
AddSkill( index, SkillName.Tailoring, 40.0, 45.0 );
@ -177,7 +177,7 @@ namespace Server.Engines.Craft
AddCraft( typeof( YewWoodTable ), 1044291, 1044307, 63.1, 88.1, typeof( Log ), 1044041, 23, 1044351 );
AddCraft( typeof( LargeTable ), 1044291, 1044308, 84.2, 109.2, typeof( Log ), 1044041, 27, 1044351 );
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( ElegantLowTable ), 1044291, 1030265, 80.0, 105.0, typeof( Log ), 1044041, 35, 1044351 );
SetNeededExpansion( index, Expansion.SE );
@ -203,7 +203,7 @@ namespace Server.Engines.Craft
AddCraft( typeof( FancyArmoire ), 1044292, 1044312, 84.2, 109.2, typeof( Log ), 1044041, 35, 1044351 );
AddCraft( typeof( Armoire ), 1044292, 1022643, 84.2, 109.2, typeof( Log ), 1044041, 35, 1044351 );
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( PlainWoodenChest ), 1044292, 1030251, 90.0, 115.0, typeof( Log ), 1044041, 30, 1044351 );
SetNeededExpansion( index, Expansion.SE );
@ -291,14 +291,14 @@ namespace Server.Engines.Craft
AddCraft( typeof( GnarledStaff ), Core.ML ? 1044566 : 1044295, 1025112, 78.9, 103.9, typeof( Log ), 1044041, 7, 1044351 );
AddCraft( typeof( WoodenShield ), Core.ML ? 1062760 : 1044295, 1027034, 52.6, 77.6, typeof( Log ), 1044041, 9, 1044351 );
if( !Core.AOS ) //Duplicate Entries to preserve ordering depending on era
if ( !Core.AOS ) //Duplicate Entries to preserve ordering depending on era
{
index = AddCraft( typeof( FishingPole ), Core.ML ? 1044294 : 1044295, 1023519, 68.4, 93.4, typeof( Log ), 1044041, 5, 1044351 ); //This is in the categor of Other during AoS
AddSkill( index, SkillName.Tailoring, 40.0, 45.0 );
AddRes( index, typeof( Cloth ), 1044286, 5, 1044287 );
}
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( Bokuto ), Core.ML ? 1044566 : 1044295, 1030227, 70.0, 95.0, typeof( Log ), 1044041, 6, 1044351 );
SetNeededExpansion( index, Expansion.SE );
@ -386,7 +386,7 @@ namespace Server.Engines.Craft
AddSkill( index, SkillName.Musicianship, 45.0, 50.0 );
AddRes( index, typeof( Cloth ), 1044286, 15, 1044287 );
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( BambooFlute ), 1044293, 1030247, 80.0, 105.0, typeof( Log ), 1044041, 15, 1044351 );
AddSkill( index, SkillName.Musicianship, 45.0, 50.0 );
@ -519,4 +519,4 @@ namespace Server.Engines.Craft
AddSubRes( typeof( FrostwoodLog ), 1072649, 100.0, 1044041, 1072652 );
}
}
}
}

View file

@ -39,7 +39,7 @@ namespace Server.Engines.Craft
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
else if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
@ -72,7 +72,7 @@ namespace Server.Engines.Craft
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
else
return 1044154; // You create the item.
}
}
@ -85,4 +85,4 @@ namespace Server.Engines.Craft
AddCraft( typeof( WorldMap ), 1044448, 1015233, 39.5, 99.5, typeof( BlankMap ), 1044449, 1, 1044450 );
}
}
}
}

View file

@ -41,7 +41,7 @@ namespace Server.Engines.Craft
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
else if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.

View file

@ -31,7 +31,7 @@ namespace Server.Engines.Craft
public override double GetChanceAtMin( CraftItem item )
{
if( item.ItemType == typeof( HollowPrism ) )
if ( item.ItemType == typeof( HollowPrism ) )
return 0.5; // 50%
return 0.0; // 0%
@ -43,13 +43,13 @@ namespace Server.Engines.Craft
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
else if ( !BaseTool.CheckTool( tool, from ) )
if ( !BaseTool.CheckTool( 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) )
if ( !(from is PlayerMobile mobile && mobile.Glassblowing && mobile.Skills[SkillName.Alchemy].Base >= 100.0) )
return 1044634; // You havent learned glassblowing.
else if ( !BaseTool.CheckAccessible( tool, from ) )
if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
bool anvil, forge;
@ -139,4 +139,4 @@ namespace Server.Engines.Craft
}
}
}
}
}

View file

@ -43,16 +43,15 @@ namespace Server.Engines.Craft
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
if ( !BaseTool.CheckAccessible( tool, @from ) )
if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
if ( typeItem != null )
{
var o = Activator.CreateInstance( typeItem );
if ( o is SpellScroll )
if ( o is SpellScroll scroll )
{
var scroll = (SpellScroll) o;
var book = Spellbook.Find( from, scroll.SpellID );
var hasSpell = ( book != null && book.HasSpell( scroll.SpellID ) );
@ -61,9 +60,10 @@ namespace Server.Engines.Craft
return ( hasSpell ? 0 : 1042404 ); // null : You don't have that spell!
}
else if ( o is Item )
if ( o is Item item )
{
( (Item) o ).Delete();
item.Delete();
}
}
@ -404,4 +404,4 @@ namespace Server.Engines.Craft
MarkOption = true;
}
}
}
}

View file

@ -1,42 +1,42 @@
using System;
using Server.Items;
using Server.Mobiles;
using System;
using Server.Items;
using Server.Mobiles;
namespace Server.Engines.Craft
{
public class DefMasonry : CraftSystem
{
public override SkillName MainSkill
{
get{ return SkillName.Carpentry; }
}
namespace Server.Engines.Craft
{
public class DefMasonry : CraftSystem
{
public override SkillName MainSkill
{
get{ return SkillName.Carpentry; }
}
public override int GumpTitleNumber
{
get{ return 1044500; } // <CENTER>MASONRY MENU</CENTER>
}
public override int GumpTitleNumber
{
get{ return 1044500; } // <CENTER>MASONRY MENU</CENTER>
}
private static CraftSystem m_CraftSystem;
private static CraftSystem m_CraftSystem;
public static CraftSystem CraftSystem
{
get
{
if ( m_CraftSystem == null )
m_CraftSystem = new DefMasonry();
public static CraftSystem CraftSystem
{
get
{
if ( m_CraftSystem == null )
m_CraftSystem = new DefMasonry();
return m_CraftSystem;
}
}
return m_CraftSystem;
}
}
public override double GetChanceAtMin( CraftItem item )
{
return 0.0; // 0%
}
public override double GetChanceAtMin( CraftItem item )
{
return 0.0; // 0%
}
private DefMasonry() : base( 1, 1, 1.25 )// base( 1, 2, 1.7 )
{
}
private DefMasonry() : base( 1, 1, 1.25 )// base( 1, 2, 1.7 )
{
}
public override bool RetainsColorFrom( CraftItem item, Type type )
{
@ -45,74 +45,74 @@ namespace Server.Engines.Craft
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
else if ( !BaseTool.CheckTool( tool, from ) )
if ( !BaseTool.CheckTool( 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) )
if ( !(from is PlayerMobile mobile && mobile.Masonry && mobile.Skills[SkillName.Carpentry].Base >= 100.0) )
return 1044633; // You havent learned stonecraft.
else if ( !BaseTool.CheckAccessible( tool, from ) )
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 void PlayCraftEffect( Mobile from )
{
// no effects
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
// from.Animate( 9, 5, 1, true, false, 0 );
//new InternalTimer( from ).Start();
}
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
// from.Animate( 9, 5, 1, true, false, 0 );
//new InternalTimer( from ).Start();
}
// Delay to synchronize the sound with the hit on the anvil
private class InternalTimer : Timer
{
private Mobile m_From;
// Delay to synchronize the sound with the hit on the anvil
private class InternalTimer : Timer
{
private Mobile m_From;
public InternalTimer( Mobile from ) : base( TimeSpan.FromSeconds( 0.7 ) )
{
m_From = from;
}
public InternalTimer( Mobile from ) : base( TimeSpan.FromSeconds( 0.7 ) )
{
m_From = from;
}
protected override void OnTick()
{
m_From.PlaySound( 0x23D );
}
}
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
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.
}
}
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()
{
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 )
if ( Core.SE )
{
int index = AddCraft( typeof( SmallUrn ), 1044501, 1029244, 82.0, 132.0, typeof( Granite ), 1044514, 3, 1044513 );
SetNeededExpansion( index, Expansion.SE );
@ -147,4 +147,4 @@ namespace Server.Engines.Craft
AddSubRes( typeof( ValoriteGranite ), 1044030, 99.0, 1044514, 1044527 );
}
}
}
}

View file

@ -41,7 +41,7 @@ namespace Server.Engines.Craft
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
else if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
@ -123,7 +123,7 @@ namespace Server.Engines.Craft
if ( Core.AOS )
AddCraft( typeof( FlowerGarland ), 1011375, 1028965, 10.0, 35.0, typeof( Cloth ), 1044286, 5, 1044287 );
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( ClothNinjaHood ), 1011375, 1030202, 80.0, 105.0, typeof( Cloth ), 1044286, 13, 1044287 );
SetNeededExpansion( index, Expansion.SE );
@ -152,7 +152,7 @@ namespace Server.Engines.Craft
AddCraft( typeof( FormalShirt ), 1015269, 1028975, 26.0, 51.0, typeof( Cloth ), 1044286, 16, 1044287 );
}
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( ClothNinjaJacket ), 1015269, 1030207, 75.0, 100.0, typeof( Cloth ), 1044286, 12, 1044287 );
SetNeededExpansion( index, Expansion.SE );
@ -179,7 +179,7 @@ namespace Server.Engines.Craft
if ( Core.AOS )
AddCraft( typeof( FurSarong ), 1015279, 1028971, 35.0, 60.0, typeof( Cloth ), 1044286, 12, 1044287 );
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( Hakama ), 1015279, 1030213, 50.0, 75.0, typeof( Cloth ), 1044286, 16, 1044287 );
SetNeededExpansion( index, Expansion.SE );
@ -194,13 +194,13 @@ namespace Server.Engines.Craft
AddCraft( typeof( HalfApron ), 1015283, 1025435, 20.7, 45.7, typeof( Cloth ), 1044286, 6, 1044287 );
AddCraft( typeof( FullApron ), 1015283, 1025437, 29.0, 54.0, typeof( Cloth ), 1044286, 10, 1044287 );
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( Obi ), 1015283, 1030219, 20.0, 45.0, typeof( Cloth ), 1044286, 6, 1044287 );
SetNeededExpansion( index, Expansion.SE );
}
if( Core.ML )
if ( Core.ML )
{
index = AddCraft( typeof( ElvenQuiver ), 1015283, 1032657, 65.0, 115.0, typeof( Leather ), 1044462, 28, 1044463 );
AddRecipe( index, 501 );
@ -229,7 +229,7 @@ namespace Server.Engines.Craft
AddCraft( typeof( OilCloth ), 1015283, 1041498, 74.6, 99.6, typeof( Cloth ), 1044286, 1, 1044287 );
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( GozaMatEastDeed ), 1015283, 1030404, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
SetNeededExpansion( index, Expansion.SE );
@ -255,7 +255,7 @@ namespace Server.Engines.Craft
if ( Core.AOS )
AddCraft( typeof( FurBoots ), 1015288, 1028967, 50.0, 75.0, typeof( Cloth ), 1044286, 12, 1044287 );
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( NinjaTabi ), 1015288, 1030210, 70.0, 95.0, typeof( Cloth ), 1044286, 10, 1044287 );
SetNeededExpansion( index, Expansion.SE );
@ -305,7 +305,7 @@ namespace Server.Engines.Craft
AddCraft( typeof( LeatherLegs ), 1015293, 1025067, 66.3, 91.3, typeof( Leather ), 1044462, 10, 1044463 );
AddCraft( typeof( LeatherChest ), 1015293, 1025068, 70.5, 95.5, typeof( Leather ), 1044462, 12, 1044463 );
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( LeatherJingasa ), 1015293, 1030177, 45.0, 70.0, typeof( Leather ), 1044462, 4, 1044463 );
SetNeededExpansion( index, Expansion.SE );
@ -340,7 +340,7 @@ namespace Server.Engines.Craft
AddCraft( typeof( StuddedLegs ), 1015300, 1025082, 91.2, 116.2, typeof( Leather ), 1044462, 12, 1044463 );
AddCraft( typeof( StuddedChest ), 1015300, 1025083, 94.0, 119.0, typeof( Leather ), 1044462, 14, 1044463 );
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( StuddedMempo ), 1015300, 1030216, 80.0, 105.0, typeof( Leather ), 1044462, 8, 1044463 );
SetNeededExpansion( index, Expansion.SE );

View file

@ -45,7 +45,7 @@ namespace Server.Engines.Craft
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
else if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
@ -158,7 +158,7 @@ namespace Server.Engines.Craft
AddCraft( typeof( Axle ), 1044042, 1024187, -25.0, 25.0, typeof( Log ), 1044041, 2, 1044351 );
AddCraft( typeof( RollingPin ), 1044042, 1024163, 0.0, 50.0, typeof( Log ), 1044041, 5, 1044351 );
if( Core.SE )
if ( Core.SE )
{
index = AddCraft( typeof( Nunchaku ), 1044042, 1030158, 70.0, 120.0, typeof( IronIngot ), 1044036, 3, 1044037 );
AddRes( index, typeof( Log ), 1044041, 8, 1044351 );