From 93917a81cae02eea0f41b0e2cd9e06a5a837dea5 Mon Sep 17 00:00:00 2001 From: xavier Date: Sun, 31 Jul 2011 15:58:03 +0000 Subject: [PATCH] --- .../Rares/Containers/BaseWaterContainer.cs | 26 ++++++++++++++----- .../Items/Special/Rares/Containers/Bucket.cs | 1 - 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Scripts/Items/Special/Rares/Containers/BaseWaterContainer.cs b/Scripts/Items/Special/Rares/Containers/BaseWaterContainer.cs index 7099f26ae..79f40c792 100644 --- a/Scripts/Items/Special/Rares/Containers/BaseWaterContainer.cs +++ b/Scripts/Items/Special/Rares/Containers/BaseWaterContainer.cs @@ -6,14 +6,18 @@ public abstract int fullItem_ID { get; } public abstract int MaxQuantity { get; } - public override int DefaultGumpID { get { return 0x3d; } } + 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 currItemID { get { return ( IsEmpty ) ? voidItem_ID : fullItem_ID; } } - private int m_Quantity; - + [CommandProperty( AccessLevel.GameMaster )] public int Quantity { get @@ -22,7 +26,7 @@ } set { - if( value != m_Quantity && !IsFull ) + if( value != m_Quantity ) { UpdateContainer( value ); @@ -31,6 +35,8 @@ } } + private int m_Quantity; + public BaseWaterContainer( int Item_Id, bool filled ) : base( Item_Id ) { @@ -73,9 +79,17 @@ public virtual void UpdateContainer( int amount ) { - m_Quantity = amount; + if( amount <= 0 ) + { + m_Quantity = 0; + } + else + { + m_Quantity = ( MaxQuantity > amount ) ? amount : MaxQuantity; + } + Movable = IsEmpty; - ItemID = currItemID; + ItemID = currItemID; } public BaseWaterContainer( Serial serial ) diff --git a/Scripts/Items/Special/Rares/Containers/Bucket.cs b/Scripts/Items/Special/Rares/Containers/Bucket.cs index e61762ee7..b4b9faa29 100644 --- a/Scripts/Items/Special/Rares/Containers/Bucket.cs +++ b/Scripts/Items/Special/Rares/Containers/Bucket.cs @@ -12,7 +12,6 @@ [Constructable] public Bucket() : this( false ) - { }