#W# Initial Commit: Avatars Conquest
This commit is contained in:
commit
5df497787a
7510 changed files with 416048 additions and 0 deletions
65
Scripts/Items/Resources/Tailor/BoltOfCloth.cs
Normal file
65
Scripts/Items/Resources/Tailor/BoltOfCloth.cs
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
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
|
||||
{
|
||||
[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 UncutCloth(), 25 );
|
||||
|
||||
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() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Scripts/Items/Resources/Tailor/Bone.cs
Normal file
41
Scripts/Items/Resources/Tailor/Bone.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Bone : Item
|
||||
{
|
||||
[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();
|
||||
}
|
||||
}
|
||||
}
|
||||
72
Scripts/Items/Resources/Tailor/Cloth.cs
Normal file
72
Scripts/Items/Resources/Tailor/Cloth.cs
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute( 0x1766, 0x1768 )]
|
||||
public class Cloth : Item, IScissorable, IDyable
|
||||
{
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get { return 0.1; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Cloth() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Cloth( int amount ) : base( 0x1766 )
|
||||
{
|
||||
Name = "cloth";
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
122
Scripts/Items/Resources/Tailor/Cotton.cs
Normal file
122
Scripts/Items/Resources/Tailor/Cotton.cs
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Cotton : Item, IDyable
|
||||
{
|
||||
[Constructable]
|
||||
public Cotton() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get { return 0.1; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Cotton( int amount ) : base( 0xDF9 )
|
||||
{
|
||||
Stackable = true;
|
||||
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, Item yarn )
|
||||
{
|
||||
if ( yarn != null )
|
||||
{
|
||||
Item item = new SpoolOfThread( (yarn.Amount * 6 ) );
|
||||
item.Hue = yarn.Hue;
|
||||
yarn.Delete();
|
||||
|
||||
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
|
||||
{
|
||||
wheel.BeginSpin( new SpinCallback( Cotton.OnSpun ), from, m_Cotton );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502658 ); // Use that on a spinning wheel.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
110
Scripts/Items/Resources/Tailor/Flax.cs
Normal file
110
Scripts/Items/Resources/Tailor/Flax.cs
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Flax : Item
|
||||
{
|
||||
[Constructable]
|
||||
public Flax() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get { return 0.1; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Flax( int amount ) : base( 0x1A9C )
|
||||
{
|
||||
Stackable = true;
|
||||
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, Item yarn )
|
||||
{
|
||||
if ( yarn != null )
|
||||
{
|
||||
Item item = new SpoolOfThread( (yarn.Amount * 6 ) );
|
||||
item.Hue = yarn.Hue;
|
||||
yarn.Delete();
|
||||
|
||||
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
|
||||
{
|
||||
wheel.BeginSpin( new SpinCallback( Flax.OnSpun ), from, m_Flax );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502658 ); // Use that on a spinning wheel.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
Scripts/Items/Resources/Tailor/Hides.cs
Normal file
120
Scripts/Items/Resources/Tailor/Hides.cs
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseHides : Item
|
||||
{
|
||||
private CraftResource m_Resource;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get{ return m_Resource; }
|
||||
set{ m_Resource = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
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;
|
||||
m_Resource = resource;
|
||||
}
|
||||
|
||||
public BaseHides( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1047023;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1079, 0x1078 )]
|
||||
public class Hides : BaseHides, IScissorable
|
||||
{
|
||||
[Constructable]
|
||||
public Hides() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Hides( int amount ) : base( CraftResource.Leathered, 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 ( !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;
|
||||
}
|
||||
}
|
||||
}
|
||||
106
Scripts/Items/Resources/Tailor/Leathers.cs
Normal file
106
Scripts/Items/Resources/Tailor/Leathers.cs
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseLeather : Item
|
||||
{
|
||||
private CraftResource m_Resource;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get{ return m_Resource; }
|
||||
set{ m_Resource = value; InvalidateProperties(); }
|
||||
}
|
||||
|
||||
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;
|
||||
m_Resource = resource;
|
||||
}
|
||||
|
||||
public BaseLeather( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1047022;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[FlipableAttribute( 0x1081, 0x1082 )]
|
||||
public class Leather : BaseLeather
|
||||
{
|
||||
[Constructable]
|
||||
public Leather() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Leather( int amount ) : base( CraftResource.Leathered, 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
72
Scripts/Items/Resources/Tailor/UncutCloth.cs
Normal file
72
Scripts/Items/Resources/Tailor/UncutCloth.cs
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class UncutCloth : Item, IScissorable, IDyable
|
||||
{
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get { return 0.1; }
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public UncutCloth() : this( 1 )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public UncutCloth( int amount ) : base( 0x1767 )
|
||||
{
|
||||
Name = "uncut cloth";
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
ItemID = Utility.RandomList( 0x175D, 0x175E, 0x175F, 0x1760, 0x1761, 0x1762, 0x1763, 0x1764, 0x1765, 0x1767 );
|
||||
}
|
||||
|
||||
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 Cloth(), 2 );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
165
Scripts/Items/Resources/Tailor/Wool.cs
Normal file
165
Scripts/Items/Resources/Tailor/Wool.cs
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
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, Item yarn )
|
||||
{
|
||||
if ( yarn != null )
|
||||
{
|
||||
Item item = new DarkYarn( (yarn.Amount * 3 ) );
|
||||
item.Hue = yarn.Hue;
|
||||
yarn.Delete();
|
||||
|
||||
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
|
||||
{
|
||||
if ( m_Wool is TaintedWool ) wheel.BeginSpin( new SpinCallback( TaintedWool.OnSpun ), from, m_Wool );
|
||||
else wheel.BeginSpin( new SpinCallback( Wool.OnSpun ), from, m_Wool );
|
||||
}
|
||||
}
|
||||
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, Item yarn )
|
||||
{
|
||||
if ( yarn != null )
|
||||
{
|
||||
Item item = new DarkYarn( yarn.Amount );
|
||||
item.Hue = yarn.Hue;
|
||||
yarn.Delete();
|
||||
|
||||
from.AddToBackpack( item );
|
||||
from.SendLocalizedMessage( 1010574 ); // You put a ball of yarn in your backpack.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
291
Scripts/Items/Resources/Tailor/YarnsAndThreads.cs
Normal file
291
Scripts/Items/Resources/Tailor/YarnsAndThreads.cs
Normal file
|
|
@ -0,0 +1,291 @@
|
|||
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 override double DefaultWeight
|
||||
{
|
||||
get { return 0.1; }
|
||||
}
|
||||
|
||||
public BaseClothMaterial( int itemID, int amount ) : base( itemID )
|
||||
{
|
||||
Stackable = true;
|
||||
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
|
||||
{
|
||||
int cycle = m_Material.Amount;
|
||||
int looms = loom.Phase;
|
||||
int amount = 0;
|
||||
|
||||
bool sendMessage = false;
|
||||
|
||||
while ( cycle > 0 )
|
||||
{
|
||||
cycle--;
|
||||
|
||||
if ( looms >= 4 )
|
||||
{
|
||||
looms = 0;
|
||||
amount++;
|
||||
sendMessage = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
looms++;
|
||||
}
|
||||
}
|
||||
|
||||
m_Material.Delete();
|
||||
loom.Phase = looms;
|
||||
|
||||
if ( sendMessage )
|
||||
{
|
||||
Item create = new BoltOfCloth(amount);
|
||||
create.Hue = m_Material.Hue;
|
||||
from.AddToBackpack( create );
|
||||
|
||||
from.SendLocalizedMessage( 500368 ); // You create some cloth and put it in your backpack.
|
||||
if ( loom.Phase > 0 ){ from.SendMessage( "The loom still has some incomplete cloth started." ); }
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "You don't have enough to create a bolt of cloth." );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 500367 ); // Try using that on a loom.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BaseString: BaseClothMaterial
|
||||
{
|
||||
public BaseString( int itemID, int amount ) : base( itemID )
|
||||
{
|
||||
Stackable = true;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public BaseString( 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 DarkYarn : BaseString
|
||||
{
|
||||
[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 : BaseString
|
||||
{
|
||||
[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 : BaseString
|
||||
{
|
||||
[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 )
|
||||
{
|
||||
Name = "spool of thread";
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
ItemID = 0x543A;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue