- Added a [TileAvg command, which tiles items/mobiles on the average Z of the map instead of a fixed Z. - For all the tile commands ([Tile, [TileRXYZ, [TileXYZ, [TileZ, [TileAvg), added outline commands to only put items/mobiles on the outside of the area ([Outline, [OutlineRXYZ, [OutlineXYZ, [OutlineZ, [OutlineAvg). - Removed the [OpenBrowser confirmation messages when using the command on multiple mobiles at the same time. - Added a label showing the type of the object currently being viewed to the top of the properties gump. - Added SA skills (Mysticism, Throwing and Imbuing) to the [Skills gump. - Fixed DeathRobe decay when automatically dropped by self looting your corpse. - Removed the (summoned) property on mouseover from clones summoned through Mirror Image. - The Z of the Magincia destination of the public moongates is now calculated when the server starts, so both old and new maps will have the correct Z (34 and 31 respectively). - KeywordTeleporters no longer teleport if you're not within the trigger range when the delay ends. - Added WaitTeleporter, which is a KeywordTeleporter supporting adding messages when a character starts the process and showing the remaining time. When a character logs and times out, any running teleport timer is stopped. - Fixed BaseWaterContainer single click behavior. - Fixed MageAI reveal behavior. - House placement will now return the correct message when targeting inside a TempNoHousingRegion. - Tracking will no longer be able to track characters with higher access after they hide. - Added CorpseNameOverride to BaseCreature to override the name used for the generated corpse. - Pet ghosts will no longer be deleted when (auto)stabled.
132 lines
No EOL
2.7 KiB
C#
132 lines
No EOL
2.7 KiB
C#
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 = RootParentEntity;
|
|
|
|
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();
|
|
}
|
|
}
|
|
} |