#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
132
Scripts/Items/Special/Rares/Containers/BaseWaterContainer.cs
Normal file
132
Scripts/Items/Special/Rares/Containers/BaseWaterContainer.cs
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public abstract class BaseWaterContainer : Container, IHasQuantity
|
||||
{
|
||||
public abstract int voidItem_ID { get; }
|
||||
public abstract int fullItem_ID { get; }
|
||||
public abstract int MaxQuantity { get; }
|
||||
|
||||
public override int DefaultGumpID { get { return 0x3e; } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public virtual bool IsEmpty { get { return ( m_Quantity <= 0 ); } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public virtual bool IsFull { get { return ( m_Quantity >= MaxQuantity ); } }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public virtual int Quantity
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Quantity;
|
||||
}
|
||||
set
|
||||
{
|
||||
if( value != m_Quantity )
|
||||
{
|
||||
m_Quantity = ( value < 1 ) ? 0 : ( value > MaxQuantity ) ? MaxQuantity : value;
|
||||
|
||||
Movable = ( !IsLockedDown ) ? IsEmpty : false;
|
||||
|
||||
ItemID = ( IsEmpty ) ? voidItem_ID : fullItem_ID;
|
||||
|
||||
if( !IsEmpty )
|
||||
{
|
||||
IEntity rootParent = RootParent;
|
||||
|
||||
if( rootParent != null && rootParent.Map != null && rootParent.Map != Map.Internal )
|
||||
MoveToWorld( rootParent.Location, rootParent.Map );
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int m_Quantity;
|
||||
|
||||
public BaseWaterContainer( int Item_Id, bool filled )
|
||||
: base( Item_Id )
|
||||
{
|
||||
m_Quantity = ( filled ) ? MaxQuantity : 0;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if( IsEmpty )
|
||||
{
|
||||
base.OnDoubleClick( from );
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSingleClick( Mobile from )
|
||||
{
|
||||
if( IsEmpty )
|
||||
{
|
||||
base.OnSingleClick( from );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( Name == null )
|
||||
LabelTo( from, LabelNumber );
|
||||
else
|
||||
LabelTo( from, Name );
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAosSingleClick( Mobile from )
|
||||
{
|
||||
if( IsEmpty )
|
||||
{
|
||||
base.OnAosSingleClick( from );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( Name == null )
|
||||
LabelTo( from, LabelNumber );
|
||||
else
|
||||
LabelTo( from, Name );
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
if( IsEmpty )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
|
||||
{
|
||||
if( !IsEmpty )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.OnDragDropInto( from, item, p );
|
||||
}
|
||||
|
||||
public BaseWaterContainer( Serial serial )
|
||||
: base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int)0 ); // version
|
||||
writer.Write( (int)m_Quantity );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
m_Quantity = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
43
Scripts/Items/Special/Rares/Containers/Bucket.cs
Normal file
43
Scripts/Items/Special/Rares/Containers/Bucket.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
class Bucket : BaseWaterContainer
|
||||
{
|
||||
public override int voidItem_ID { get { return vItemID; } }
|
||||
public override int fullItem_ID { get { return fItemID; } }
|
||||
public override int MaxQuantity { get { return 25; } }
|
||||
|
||||
private static int vItemID = 0x14e0;
|
||||
private static int fItemID = 0x2004;
|
||||
|
||||
[Constructable]
|
||||
public Bucket()
|
||||
: this( false )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Bucket( bool filled )
|
||||
: base( ( filled ) ? Bucket.fItemID : Bucket.vItemID, filled )
|
||||
{
|
||||
}
|
||||
|
||||
public Bucket( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Scripts/Items/Special/Rares/Containers/ClosedBarrel.cs
Normal file
32
Scripts/Items/Special/Rares/Containers/ClosedBarrel.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
class ClosedBarrel : TrapableContainer
|
||||
{
|
||||
public override int DefaultGumpID{ get { return 0x3e; } }
|
||||
|
||||
[Constructable]
|
||||
public ClosedBarrel()
|
||||
: base( 0x0FAE )
|
||||
{
|
||||
}
|
||||
|
||||
public ClosedBarrel( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Scripts/Items/Special/Rares/Containers/UnfinishedBarrel.cs
Normal file
33
Scripts/Items/Special/Rares/Containers/UnfinishedBarrel.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class UnfinishedBarrel : Item
|
||||
{
|
||||
|
||||
[Constructable]
|
||||
public UnfinishedBarrel() : base( 0x1EB5 )
|
||||
{
|
||||
Movable = true;
|
||||
Stackable = false;
|
||||
}
|
||||
|
||||
public UnfinishedBarrel( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
45
Scripts/Items/Special/Rares/Containers/WaterBarrel.cs
Normal file
45
Scripts/Items/Special/Rares/Containers/WaterBarrel.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
class WaterBarrel : BaseWaterContainer
|
||||
{
|
||||
public override int LabelNumber { get { return 1025453; } } /* water barrel */
|
||||
|
||||
public override int voidItem_ID { get { return vItemID; } }
|
||||
public override int fullItem_ID { get { return fItemID; } }
|
||||
public override int MaxQuantity { get { return 100; } }
|
||||
|
||||
private static int vItemID = 0xe77;
|
||||
private static int fItemID = 0x154d;
|
||||
|
||||
[Constructable]
|
||||
public WaterBarrel()
|
||||
: this( false )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WaterBarrel( bool filled )
|
||||
: base( ( filled ) ? WaterBarrel.fItemID : WaterBarrel.vItemID, filled )
|
||||
{
|
||||
}
|
||||
|
||||
public WaterBarrel( 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
43
Scripts/Items/Special/Rares/Containers/WaterTub.cs
Normal file
43
Scripts/Items/Special/Rares/Containers/WaterTub.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
class Tub : BaseWaterContainer
|
||||
{
|
||||
public override int voidItem_ID { get { return vItemID; } }
|
||||
public override int fullItem_ID { get { return fItemID; } }
|
||||
public override int MaxQuantity { get { return 50; } }
|
||||
|
||||
private static int vItemID = 0xe83;
|
||||
private static int fItemID = 0xe7b;
|
||||
|
||||
[Constructable]
|
||||
public Tub()
|
||||
: this( false )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public Tub( bool filled )
|
||||
: base( ( filled ) ? Tub.fItemID : Tub.vItemID, filled )
|
||||
{
|
||||
}
|
||||
|
||||
public Tub( 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