Added Weight property on items for ML expansion

This commit is contained in:
krrios 2007-04-21 03:18:04 +00:00
parent b290d0d18f
commit a8d3bcbec9

View file

@ -995,6 +995,25 @@ namespace Server
list.Add( 1060446, v.ToString() ); // energy resist ~1_val~%
}
/// <summary>
/// Overridable. Determines whether the item will show <see cref="AddWeightProperty" />.
/// </summary>
public virtual bool DisplayWeight { get { return ( Core.Expansion >= Expansion.ML ); } }
/// <summary>
/// Overridable. Displays cliloc 1072788-1072789.
/// </summary>
public virtual void AddWeightProperty( ObjectPropertyList list )
{
int weight = this.PileWeight + this.TotalWeight;
if ( weight == 1 ) {
list.Add( 1072788, weight.ToString() ); //Weight: ~1_WEIGHT~ stone
} else {
list.Add( 1072789, weight.ToString() ); //Weight: ~1_WEIGHT~ stones
}
}
/// <summary>
/// Overridable. Adds header properties. By default, this invokes <see cref="AddNameProperty" />, <see cref="AddBlessedForProperty" /> (if applicable), and <see cref="AddLootTypeProperty" /> (if <see cref="DisplayLootType" />).
/// </summary>
@ -1015,6 +1034,10 @@ namespace Server
if ( DisplayLootType )
AddLootTypeProperty( list );
if ( DisplayWeight ) {
AddWeightProperty( list );
}
AppendChildNameProperties( list );
}