#W# Source and Scripts added. Added Scripts/Settings.cs to expose some basic tweak able settings.
This commit is contained in:
parent
b51c58f514
commit
3045c83799
3512 changed files with 627673 additions and 0 deletions
68
Scripts/Items/Resources/Tailor/BoltOfCloth.cs
Normal file
68
Scripts/Items/Resources/Tailor/BoltOfCloth.cs
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0xF95, 0xF96, 0xF97, 0xF98, 0xF99, 0xF9A, 0xF9B, 0xF9C )]
|
||||
public class BoltOfCloth : Item, IScissorable, IDyable, ICommodity
|
||||
{
|
||||
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public BoltOfCloth() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BoltOfCloth( int amount ) : base( 0xF95 )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 5.0;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public BoltOfCloth( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public bool Dye( Mobile from, DyeTub sender )
|
||||
{
|
||||
if ( Deleted ) return false;
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public bool Scissor( Mobile from, Scissors scissors )
|
||||
{
|
||||
if ( Deleted || !from.CanSee( this ) ) return false;
|
||||
|
||||
base.ScissorHelper( from, new Cloth(), 50 );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
int number = (Amount == 1) ? 1049122 : 1049121;
|
||||
|
||||
from.Send( new MessageLocalized( Serial, ItemID, MessageType.Label, 0x3B2, 3, number, "", (Amount * 50).ToString() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Scripts/Items/Resources/Tailor/Bone.cs
Normal file
44
Scripts/Items/Resources/Tailor/Bone.cs
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Bone : Item, ICommodity
|
||||
{
|
||||
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
[Constructable]
|
||||
public Bone() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Bone( int amount ) : base( 0xf7e )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public Bone( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
74
Scripts/Items/Resources/Tailor/Cloth.cs
Normal file
74
Scripts/Items/Resources/Tailor/Cloth.cs
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x1766, 0x1768 )]
|
||||
public class Cloth : Item, IScissorable, IDyable, ICommodity
|
||||
{
|
||||
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get { return 0.1; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Cloth() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Cloth( int amount ) : base( 0x1766 )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Cloth( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public bool Dye( Mobile from, DyeTub sender )
|
||||
{
|
||||
if ( Deleted )
|
||||
return false;
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
int number = (Amount == 1) ? 1049124 : 1049123;
|
||||
|
||||
from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, number, "", Amount.ToString() ) );
|
||||
}
|
||||
|
||||
public bool Scissor( Mobile from, Scissors scissors )
|
||||
{
|
||||
if ( Deleted || !from.CanSee( this ) ) return false;
|
||||
|
||||
base.ScissorHelper( from, new Bandage(), 1 );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
115
Scripts/Items/Resources/Tailor/Cotton.cs
Normal file
115
Scripts/Items/Resources/Tailor/Cotton.cs
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Cotton : Item, IDyable
|
||||
{
|
||||
[Constructable]
|
||||
public Cotton() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Cotton( int amount ) : base( 0xDF9 )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 4.0;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Cotton( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
public bool Dye( Mobile from, DyeTub sender )
|
||||
{
|
||||
if ( Deleted )
|
||||
return false;
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 502655 ); // What spinning wheel do you wish to spin this on?
|
||||
from.Target = new PickWheelTarget( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnSpun( ISpinningWheel wheel, Mobile from, int hue )
|
||||
{
|
||||
Item item = new SpoolOfThread( 6 );
|
||||
item.Hue = hue;
|
||||
|
||||
from.AddToBackpack( item );
|
||||
from.SendLocalizedMessage( 1010577 ); // You put the spools of thread in your backpack.
|
||||
}
|
||||
|
||||
private class PickWheelTarget : Target
|
||||
{
|
||||
private Cotton m_Cotton;
|
||||
|
||||
public PickWheelTarget( Cotton cotton ) : base( 3, false, TargetFlags.None )
|
||||
{
|
||||
m_Cotton = cotton;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Cotton.Deleted )
|
||||
return;
|
||||
|
||||
ISpinningWheel wheel = targeted as ISpinningWheel;
|
||||
|
||||
if ( wheel == null && targeted is AddonComponent )
|
||||
wheel = ((AddonComponent)targeted).Addon as ISpinningWheel;
|
||||
|
||||
if ( wheel is Item )
|
||||
{
|
||||
Item item = (Item)wheel;
|
||||
|
||||
if ( !m_Cotton.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
else if ( wheel.Spinning )
|
||||
{
|
||||
from.SendLocalizedMessage( 502656 ); // That spinning wheel is being used.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Cotton.Consume();
|
||||
wheel.BeginSpin( new SpinCallback( Cotton.OnSpun ), from, m_Cotton.Hue );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502658 ); // Use that on a spinning wheel.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
105
Scripts/Items/Resources/Tailor/Flax.cs
Normal file
105
Scripts/Items/Resources/Tailor/Flax.cs
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Flax : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Flax() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Flax( int amount ) : base( 0x1A9C )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Flax( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 502655 ); // What spinning wheel do you wish to spin this on?
|
||||
from.Target = new PickWheelTarget( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnSpun( ISpinningWheel wheel, Mobile from, int hue )
|
||||
{
|
||||
Item item = new SpoolOfThread( 6 );
|
||||
item.Hue = hue;
|
||||
|
||||
from.AddToBackpack( item );
|
||||
from.SendLocalizedMessage( 1010577 ); // You put the spools of thread in your backpack.
|
||||
}
|
||||
|
||||
private class PickWheelTarget : Target
|
||||
{
|
||||
private Flax m_Flax;
|
||||
|
||||
public PickWheelTarget( Flax flax ) : base( 3, false, TargetFlags.None )
|
||||
{
|
||||
m_Flax = flax;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Flax.Deleted )
|
||||
return;
|
||||
|
||||
ISpinningWheel wheel = targeted as ISpinningWheel;
|
||||
|
||||
if ( wheel == null && targeted is AddonComponent )
|
||||
wheel = ((AddonComponent)targeted).Addon as ISpinningWheel;
|
||||
|
||||
if ( wheel is Item )
|
||||
{
|
||||
Item item = (Item)wheel;
|
||||
|
||||
if ( !m_Flax.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
else if ( wheel.Spinning )
|
||||
{
|
||||
from.SendLocalizedMessage( 502656 ); // That spinning wheel is being used.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Flax.Consume();
|
||||
wheel.BeginSpin( new SpinCallback( Flax.OnSpun ), from, m_Flax.Hue );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502658 ); // Use that on a spinning wheel.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
292
Scripts/Items/Resources/Tailor/Hides.cs
Normal file
292
Scripts/Items/Resources/Tailor/Hides.cs
Normal file
|
|
@ -0,0 +1,292 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseHides : Item, ICommodity
|
||||
{
|
||||
private CraftResource m_Resource;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get{ return m_Resource; }
|
||||
set{ m_Resource = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (int) m_Resource );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Resource = (CraftResource)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
OreInfo info = new OreInfo( reader.ReadInt(), reader.ReadInt(), reader.ReadString() );
|
||||
|
||||
m_Resource = CraftResources.GetFromOreInfo( info );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BaseHides( CraftResource resource ) : this( resource, 1 )
|
||||
{
|
||||
}
|
||||
|
||||
public BaseHides( CraftResource resource, int amount ) : base( 0x1079 )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 5.0;
|
||||
Amount = amount;
|
||||
Hue = CraftResources.GetHue( resource );
|
||||
|
||||
m_Resource = resource;
|
||||
}
|
||||
|
||||
public BaseHides( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void AddNameProperty( ObjectPropertyList list )
|
||||
{
|
||||
if ( Amount > 1 )
|
||||
list.Add( 1050039, "{0}\t#{1}", Amount, 1024216 ); // ~1_NUMBER~ ~2_ITEMNAME~
|
||||
else
|
||||
list.Add( 1024216 ); // pile of hides
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( !CraftResources.IsStandard( m_Resource ) )
|
||||
{
|
||||
int num = CraftResources.GetLocalizationNumber( m_Resource );
|
||||
|
||||
if ( num > 0 )
|
||||
list.Add( num );
|
||||
else
|
||||
list.Add( CraftResources.GetName( m_Resource ) );
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_Resource >= CraftResource.SpinedLeather && m_Resource <= CraftResource.BarbedLeather )
|
||||
return 1049687 + (int)(m_Resource - CraftResource.SpinedLeather);
|
||||
|
||||
return 1047023;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1079, 0x1078 )]
|
||||
public class Hides : BaseHides, IScissorable
|
||||
{
|
||||
[Constructable]
|
||||
public Hides() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Hides( int amount ) : base( CraftResource.RegularLeather, amount )
|
||||
{
|
||||
}
|
||||
|
||||
public Hides( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public bool Scissor( Mobile from, Scissors scissors )
|
||||
{
|
||||
if ( Deleted || !from.CanSee( this ) ) return false;
|
||||
|
||||
if ( Core.AOS && !IsChildOf ( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage ( 502437 ); // Items you wish to cut must be in your backpack
|
||||
return false;
|
||||
}
|
||||
base.ScissorHelper( from, new Leather(), 1 );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1079, 0x1078 )]
|
||||
public class SpinedHides : BaseHides, IScissorable
|
||||
{
|
||||
[Constructable]
|
||||
public SpinedHides() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SpinedHides( int amount ) : base( CraftResource.SpinedLeather, amount )
|
||||
{
|
||||
}
|
||||
|
||||
public SpinedHides( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public bool Scissor( Mobile from, Scissors scissors )
|
||||
{
|
||||
if ( Deleted || !from.CanSee( this ) ) return false;
|
||||
|
||||
if ( Core.AOS && !IsChildOf ( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage ( 502437 ); // Items you wish to cut must be in your backpack
|
||||
return false;
|
||||
}
|
||||
|
||||
base.ScissorHelper( from, new SpinedLeather(), 1 );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1079, 0x1078 )]
|
||||
public class HornedHides : BaseHides, IScissorable
|
||||
{
|
||||
[Constructable]
|
||||
public HornedHides() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HornedHides( int amount ) : base( CraftResource.HornedLeather, amount )
|
||||
{
|
||||
}
|
||||
|
||||
public HornedHides( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public bool Scissor( Mobile from, Scissors scissors )
|
||||
{
|
||||
if ( Deleted || !from.CanSee( this ) ) return false;
|
||||
|
||||
if ( Core.AOS && !IsChildOf ( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage ( 502437 ); // Items you wish to cut must be in your backpack
|
||||
return false;
|
||||
}
|
||||
|
||||
base.ScissorHelper( from, new HornedLeather(), 1 );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1079, 0x1078 )]
|
||||
public class BarbedHides : BaseHides, IScissorable
|
||||
{
|
||||
[Constructable]
|
||||
public BarbedHides() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BarbedHides( int amount ) : base( CraftResource.BarbedLeather, amount )
|
||||
{
|
||||
}
|
||||
|
||||
public BarbedHides( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public bool Scissor( Mobile from, Scissors scissors )
|
||||
{
|
||||
if ( Deleted || !from.CanSee( this ) ) return false;
|
||||
|
||||
if ( Core.AOS && !IsChildOf ( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage ( 502437 ); // Items you wish to cut must be in your backpack
|
||||
return false;
|
||||
}
|
||||
|
||||
base.ScissorHelper( from, new BarbedLeather(), 1 );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
241
Scripts/Items/Resources/Tailor/Leathers.cs
Normal file
241
Scripts/Items/Resources/Tailor/Leathers.cs
Normal file
|
|
@ -0,0 +1,241 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseLeather : Item, ICommodity
|
||||
{
|
||||
private CraftResource m_Resource;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get{ return m_Resource; }
|
||||
set{ m_Resource = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( (int) m_Resource );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Resource = (CraftResource)reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
OreInfo info = new OreInfo( reader.ReadInt(), reader.ReadInt(), reader.ReadString() );
|
||||
|
||||
m_Resource = CraftResources.GetFromOreInfo( info );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BaseLeather( CraftResource resource ) : this( resource, 1 )
|
||||
{
|
||||
}
|
||||
|
||||
public BaseLeather( CraftResource resource, int amount ) : base( 0x1081 )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
Hue = CraftResources.GetHue( resource );
|
||||
|
||||
m_Resource = resource;
|
||||
}
|
||||
|
||||
public BaseLeather( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void AddNameProperty( ObjectPropertyList list )
|
||||
{
|
||||
if ( Amount > 1 )
|
||||
list.Add( 1050039, "{0}\t#{1}", Amount, 1024199 ); // ~1_NUMBER~ ~2_ITEMNAME~
|
||||
else
|
||||
list.Add( 1024199 ); // cut leather
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( !CraftResources.IsStandard( m_Resource ) )
|
||||
{
|
||||
int num = CraftResources.GetLocalizationNumber( m_Resource );
|
||||
|
||||
if ( num > 0 )
|
||||
list.Add( num );
|
||||
else
|
||||
list.Add( CraftResources.GetName( m_Resource ) );
|
||||
}
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_Resource >= CraftResource.SpinedLeather && m_Resource <= CraftResource.BarbedLeather )
|
||||
return 1049684 + (int)(m_Resource - CraftResource.SpinedLeather);
|
||||
|
||||
return 1047022;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1081, 0x1082 )]
|
||||
public class Leather : BaseLeather
|
||||
{
|
||||
[Constructable]
|
||||
public Leather() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Leather( int amount ) : base( CraftResource.RegularLeather, amount )
|
||||
{
|
||||
}
|
||||
|
||||
public Leather( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1081, 0x1082 )]
|
||||
public class SpinedLeather : BaseLeather
|
||||
{
|
||||
[Constructable]
|
||||
public SpinedLeather() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SpinedLeather( int amount ) : base( CraftResource.SpinedLeather, amount )
|
||||
{
|
||||
}
|
||||
|
||||
public SpinedLeather( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1081, 0x1082 )]
|
||||
public class HornedLeather : BaseLeather
|
||||
{
|
||||
[Constructable]
|
||||
public HornedLeather() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HornedLeather( int amount ) : base( CraftResource.HornedLeather, amount )
|
||||
{
|
||||
}
|
||||
|
||||
public HornedLeather( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1081, 0x1082 )]
|
||||
public class BarbedLeather : BaseLeather
|
||||
{
|
||||
[Constructable]
|
||||
public BarbedLeather() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BarbedLeather( int amount ) : base( CraftResource.BarbedLeather, amount )
|
||||
{
|
||||
}
|
||||
|
||||
public BarbedLeather( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
73
Scripts/Items/Resources/Tailor/UncutCloth.cs
Normal file
73
Scripts/Items/Resources/Tailor/UncutCloth.cs
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x1765, 0x1767 )]
|
||||
public class UncutCloth : Item, IScissorable, IDyable, ICommodity
|
||||
{
|
||||
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
|
||||
bool ICommodity.IsDeedable { get { return true; } }
|
||||
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get { return 0.1; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public UncutCloth() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public UncutCloth( int amount ) : base( 0x1767 )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public UncutCloth( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public bool Dye( Mobile from, DyeTub sender )
|
||||
{
|
||||
if ( Deleted )
|
||||
return false;
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
int number = (Amount == 1) ? 1049124 : 1049123;
|
||||
|
||||
from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, number, "", Amount.ToString() ) );
|
||||
}
|
||||
public bool Scissor( Mobile from, Scissors scissors )
|
||||
{
|
||||
if ( Deleted || !from.CanSee( this ) ) return false;
|
||||
|
||||
base.ScissorHelper( from, new Bandage(), 1 );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
158
Scripts/Items/Resources/Tailor/Wool.cs
Normal file
158
Scripts/Items/Resources/Tailor/Wool.cs
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Wool : Item, IDyable
|
||||
{
|
||||
[Constructable]
|
||||
public Wool() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Wool( int amount ) : base( 0xDF8 )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 4.0;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Wool( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
public bool Dye( Mobile from, DyeTub sender )
|
||||
{
|
||||
if ( Deleted )
|
||||
return false;
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 502655 ); // What spinning wheel do you wish to spin this on?
|
||||
from.Target = new PickWheelTarget( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnSpun( ISpinningWheel wheel, Mobile from, int hue )
|
||||
{
|
||||
Item item = new DarkYarn( 3 );
|
||||
item.Hue = hue;
|
||||
|
||||
from.AddToBackpack( item );
|
||||
from.SendLocalizedMessage( 1010576 ); // You put the balls of yarn in your backpack.
|
||||
}
|
||||
|
||||
private class PickWheelTarget : Target
|
||||
{
|
||||
private Wool m_Wool;
|
||||
|
||||
public PickWheelTarget( Wool wool ) : base( 3, false, TargetFlags.None )
|
||||
{
|
||||
m_Wool = wool;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Wool.Deleted )
|
||||
return;
|
||||
|
||||
ISpinningWheel wheel = targeted as ISpinningWheel;
|
||||
|
||||
if ( wheel == null && targeted is AddonComponent )
|
||||
wheel = ((AddonComponent)targeted).Addon as ISpinningWheel;
|
||||
|
||||
if ( wheel is Item )
|
||||
{
|
||||
Item item = (Item)wheel;
|
||||
|
||||
if ( !m_Wool.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
else if ( wheel.Spinning )
|
||||
{
|
||||
from.SendLocalizedMessage( 502656 ); // That spinning wheel is being used.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Wool.Consume();
|
||||
if ( m_Wool is TaintedWool ) wheel.BeginSpin( new SpinCallback( TaintedWool.OnSpun ), from, m_Wool.Hue );
|
||||
else wheel.BeginSpin( new SpinCallback( Wool.OnSpun ), from, m_Wool.Hue );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502658 ); // Use that on a spinning wheel.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public class TaintedWool : Wool
|
||||
{
|
||||
[Constructable]
|
||||
public TaintedWool() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public TaintedWool( int amount ) : base( 0x101F )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 4.0;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public TaintedWool( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
new public static void OnSpun( ISpinningWheel wheel, Mobile from, int hue )
|
||||
{
|
||||
Item item = new DarkYarn( 1 );
|
||||
item.Hue = hue;
|
||||
|
||||
from.AddToBackpack( item );
|
||||
from.SendLocalizedMessage( 1010574 ); // You put a ball of yarn in your backpack.
|
||||
}
|
||||
}
|
||||
}
|
||||
235
Scripts/Items/Resources/Tailor/YarnsAndThreads.cs
Normal file
235
Scripts/Items/Resources/Tailor/YarnsAndThreads.cs
Normal file
|
|
@ -0,0 +1,235 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseClothMaterial : Item, IDyable
|
||||
{
|
||||
public BaseClothMaterial( int itemID ) : this( itemID, 1 )
|
||||
{
|
||||
}
|
||||
|
||||
public BaseClothMaterial( int itemID, int amount ) : base( itemID )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public BaseClothMaterial( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public bool Dye( Mobile from, DyeTub sender )
|
||||
{
|
||||
if ( Deleted )
|
||||
return false;
|
||||
|
||||
Hue = sender.DyedHue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 500366 ); // Select a loom to use that on.
|
||||
from.Target = new PickLoomTarget( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
private class PickLoomTarget : Target
|
||||
{
|
||||
private BaseClothMaterial m_Material;
|
||||
|
||||
public PickLoomTarget( BaseClothMaterial material ) : base( 3, false, TargetFlags.None )
|
||||
{
|
||||
m_Material = material;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Material.Deleted )
|
||||
return;
|
||||
|
||||
ILoom loom = targeted as ILoom;
|
||||
|
||||
if ( loom == null && targeted is AddonComponent )
|
||||
loom = ((AddonComponent)targeted).Addon as ILoom;
|
||||
|
||||
if ( loom != null )
|
||||
{
|
||||
if ( !m_Material.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
else if ( loom.Phase < 4 )
|
||||
{
|
||||
m_Material.Consume();
|
||||
|
||||
if ( targeted is Item )
|
||||
((Item)targeted).SendLocalizedMessageTo( from, 1010001 + loom.Phase++ );
|
||||
}
|
||||
else
|
||||
{
|
||||
Item create = new BoltOfCloth();
|
||||
create.Hue = m_Material.Hue;
|
||||
|
||||
m_Material.Consume();
|
||||
loom.Phase = 0;
|
||||
from.SendLocalizedMessage( 500368 ); // You create some cloth and put it in your backpack.
|
||||
from.AddToBackpack( create );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 500367 ); // Try using that on a loom.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DarkYarn : BaseClothMaterial
|
||||
{
|
||||
[Constructable]
|
||||
public DarkYarn() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DarkYarn( int amount ) : base( 0xE1D, amount )
|
||||
{
|
||||
}
|
||||
|
||||
public DarkYarn( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LightYarn : BaseClothMaterial
|
||||
{
|
||||
[Constructable]
|
||||
public LightYarn() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LightYarn( int amount ) : base( 0xE1E, amount )
|
||||
{
|
||||
}
|
||||
|
||||
public LightYarn( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class LightYarnUnraveled : BaseClothMaterial
|
||||
{
|
||||
[Constructable]
|
||||
public LightYarnUnraveled() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public LightYarnUnraveled( int amount ) : base( 0xE1F, amount )
|
||||
{
|
||||
}
|
||||
|
||||
public LightYarnUnraveled( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SpoolOfThread : BaseClothMaterial
|
||||
{
|
||||
[Constructable]
|
||||
public SpoolOfThread() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SpoolOfThread( int amount ) : base( 0xFA0, amount )
|
||||
{
|
||||
}
|
||||
|
||||
public SpoolOfThread( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue