#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
51
Scripts/Items/Farming/FarmableCabbage.cs
Normal file
51
Scripts/Items/Farming/FarmableCabbage.cs
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FarmableCabbage : FarmableCrop
|
||||
{
|
||||
public static int GetCropID()
|
||||
{
|
||||
return 3254;
|
||||
}
|
||||
|
||||
public override Item GetCropObject()
|
||||
{
|
||||
Cabbage cabbage = new Cabbage();
|
||||
|
||||
cabbage.ItemID = Utility.Random( 3195, 2 );
|
||||
|
||||
return cabbage;
|
||||
}
|
||||
|
||||
public override int GetPickedID()
|
||||
{
|
||||
return 3254;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FarmableCabbage() : base( GetCropID() )
|
||||
{
|
||||
}
|
||||
|
||||
public FarmableCabbage( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
51
Scripts/Items/Farming/FarmableCarrot.cs
Normal file
51
Scripts/Items/Farming/FarmableCarrot.cs
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FarmableCarrot : FarmableCrop
|
||||
{
|
||||
public static int GetCropID()
|
||||
{
|
||||
return 3190;
|
||||
}
|
||||
|
||||
public override Item GetCropObject()
|
||||
{
|
||||
Carrot carrot = new Carrot();
|
||||
|
||||
carrot.ItemID = Utility.Random( 3191, 2 );
|
||||
|
||||
return carrot;
|
||||
}
|
||||
|
||||
public override int GetPickedID()
|
||||
{
|
||||
return 3254;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FarmableCarrot() : base( GetCropID() )
|
||||
{
|
||||
}
|
||||
|
||||
public FarmableCarrot( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
47
Scripts/Items/Farming/FarmableCotton.cs
Normal file
47
Scripts/Items/Farming/FarmableCotton.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FarmableCotton : FarmableCrop
|
||||
{
|
||||
public static int GetCropID()
|
||||
{
|
||||
return Utility.Random( 3153, 4 );
|
||||
}
|
||||
|
||||
public override Item GetCropObject()
|
||||
{
|
||||
return new Cotton();
|
||||
}
|
||||
|
||||
public override int GetPickedID()
|
||||
{
|
||||
return 3254;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FarmableCotton() : base( GetCropID() )
|
||||
{
|
||||
}
|
||||
|
||||
public FarmableCotton( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
94
Scripts/Items/Farming/FarmableCrop.cs
Normal file
94
Scripts/Items/Farming/FarmableCrop.cs
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class FarmableCrop : Item
|
||||
{
|
||||
private bool m_Picked;
|
||||
|
||||
public abstract Item GetCropObject();
|
||||
public abstract int GetPickedID();
|
||||
|
||||
public FarmableCrop( int itemID ) : base( itemID )
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
Map map = this.Map;
|
||||
Point3D loc = this.Location;
|
||||
|
||||
if ( Parent != null || Movable || IsLockedDown || IsSecure || map == null || map == Map.Internal )
|
||||
return;
|
||||
|
||||
if ( !from.InRange( loc, 2 ) || !from.InLOS( this ) )
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
else if ( !m_Picked )
|
||||
OnPicked( from, loc, map );
|
||||
}
|
||||
|
||||
public virtual void OnPicked( Mobile from, Point3D loc, Map map )
|
||||
{
|
||||
ItemID = GetPickedID();
|
||||
|
||||
Item spawn = GetCropObject();
|
||||
|
||||
if ( spawn != null )
|
||||
spawn.MoveToWorld( loc, map );
|
||||
|
||||
m_Picked = true;
|
||||
|
||||
Unlink();
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromMinutes( 5.0 ), new TimerCallback( Delete ) );
|
||||
}
|
||||
|
||||
public void Unlink()
|
||||
{
|
||||
ISpawner se = this.Spawner;
|
||||
|
||||
if ( se != null )
|
||||
{
|
||||
this.Spawner.Remove( this );
|
||||
this.Spawner = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public FarmableCrop( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
|
||||
writer.Write( m_Picked );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
m_Picked = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
if ( m_Picked )
|
||||
{
|
||||
Unlink();
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
51
Scripts/Items/Farming/FarmableFlax.cs
Normal file
51
Scripts/Items/Farming/FarmableFlax.cs
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FarmableFlax : FarmableCrop
|
||||
{
|
||||
public static int GetCropID()
|
||||
{
|
||||
return Utility.Random( 6809, 3 );
|
||||
}
|
||||
|
||||
public override Item GetCropObject()
|
||||
{
|
||||
Flax flax = new Flax();
|
||||
|
||||
flax.ItemID = Utility.Random( 6812, 2 );
|
||||
|
||||
return flax;
|
||||
}
|
||||
|
||||
public override int GetPickedID()
|
||||
{
|
||||
return 3254;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FarmableFlax() : base( GetCropID() )
|
||||
{
|
||||
}
|
||||
|
||||
public FarmableFlax( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
51
Scripts/Items/Farming/FarmableLettuce.cs
Normal file
51
Scripts/Items/Farming/FarmableLettuce.cs
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FarmableLettuce : FarmableCrop
|
||||
{
|
||||
public static int GetCropID()
|
||||
{
|
||||
return 3254;
|
||||
}
|
||||
|
||||
public override Item GetCropObject()
|
||||
{
|
||||
Lettuce lettuce = new Lettuce();
|
||||
|
||||
lettuce.ItemID = Utility.Random( 3184, 2 );
|
||||
|
||||
return lettuce;
|
||||
}
|
||||
|
||||
public override int GetPickedID()
|
||||
{
|
||||
return 3254;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FarmableLettuce() : base( GetCropID() )
|
||||
{
|
||||
}
|
||||
|
||||
public FarmableLettuce( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
51
Scripts/Items/Farming/FarmableOnion.cs
Normal file
51
Scripts/Items/Farming/FarmableOnion.cs
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FarmableOnion : FarmableCrop
|
||||
{
|
||||
public static int GetCropID()
|
||||
{
|
||||
return 3183;
|
||||
}
|
||||
|
||||
public override Item GetCropObject()
|
||||
{
|
||||
Onion onion = new Onion();
|
||||
|
||||
onion.ItemID = Utility.Random( 3181, 2 );
|
||||
|
||||
return onion;
|
||||
}
|
||||
|
||||
public override int GetPickedID()
|
||||
{
|
||||
return 3254;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FarmableOnion() : base( GetCropID() )
|
||||
{
|
||||
}
|
||||
|
||||
public FarmableOnion( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
53
Scripts/Items/Farming/FarmablePumpkin.cs
Normal file
53
Scripts/Items/Farming/FarmablePumpkin.cs
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FarmablePumpkin : FarmableCrop
|
||||
{
|
||||
public static int GetCropID()
|
||||
{
|
||||
return Utility.Random( 3166, 3 );
|
||||
}
|
||||
|
||||
public override Item GetCropObject()
|
||||
{
|
||||
Pumpkin pumpkin = new Pumpkin();
|
||||
|
||||
pumpkin.ItemID = Utility.Random( 3178, 3 );
|
||||
|
||||
return pumpkin;
|
||||
}
|
||||
|
||||
public override int GetPickedID()
|
||||
{
|
||||
return Utility.Random( 3166, 3 );
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FarmablePumpkin()
|
||||
: base( GetCropID() )
|
||||
{
|
||||
}
|
||||
|
||||
public FarmablePumpkin( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
51
Scripts/Items/Farming/FarmableTurnip.cs
Normal file
51
Scripts/Items/Farming/FarmableTurnip.cs
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FarmableTurnip : FarmableCrop
|
||||
{
|
||||
public static int GetCropID()
|
||||
{
|
||||
return Utility.Random( 3169, 3 );
|
||||
}
|
||||
|
||||
public override Item GetCropObject()
|
||||
{
|
||||
Turnip turnip = new Turnip();
|
||||
|
||||
turnip.ItemID = Utility.Random( 3385, 2 );
|
||||
|
||||
return turnip;
|
||||
}
|
||||
|
||||
public override int GetPickedID()
|
||||
{
|
||||
return 3254;
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FarmableTurnip() : base( GetCropID() )
|
||||
{
|
||||
}
|
||||
|
||||
public FarmableTurnip( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
47
Scripts/Items/Farming/FarmableWheat.cs
Normal file
47
Scripts/Items/Farming/FarmableWheat.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class FarmableWheat : FarmableCrop
|
||||
{
|
||||
public static int GetCropID()
|
||||
{
|
||||
return Utility.Random( 3157, 4 );
|
||||
}
|
||||
|
||||
public override Item GetCropObject()
|
||||
{
|
||||
return new WheatSheaf();
|
||||
}
|
||||
|
||||
public override int GetPickedID()
|
||||
{
|
||||
return Utility.Random( 3502, 2 );
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public FarmableWheat() : base( GetCropID() )
|
||||
{
|
||||
}
|
||||
|
||||
public FarmableWheat( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue