Commodity deed updates: added bottles, potions, spell scrolls, zoogifungus. fixed filled hue, removed unnecessary desc prop from ICommodity, pre-aos OSI style labels dont need it.

This commit is contained in:
xavier 2010-11-19 18:59:44 +00:00
parent c9101845f5
commit 15c6828541
36 changed files with 79 additions and 271 deletions

View file

@ -4,10 +4,10 @@ using Server.Network;
namespace Server.Items
{
public interface ICommodity
public interface ICommodity /* added IsDeedable prop so expansion-based deedables can determine true/false */
{
string Description{ get; }
int DescriptionNumber{ get; }
bool IsDeedable { get; }
}
public class CommodityDeed : Item
@ -27,7 +27,7 @@ namespace Server.Items
{
InvalidateProperties();
if ( m_Commodity == null && item is ICommodity )
if ( m_Commodity == null && item is ICommodity && ((ICommodity)item).IsDeedable )
{
m_Commodity = item;
m_Commodity.Internalize();
@ -45,7 +45,7 @@ namespace Server.Items
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int) 1 ); // version
writer.Write( m_Commodity );
}
@ -56,12 +56,16 @@ namespace Server.Items
int version = reader.ReadInt();
m_Commodity = reader.ReadItem();
switch ( version )
{
case 0:
{
m_Commodity = reader.ReadItem();
if (m_Commodity != null)
{
Hue = 0x592;
}
break;
}
}
@ -105,10 +109,12 @@ namespace Server.Items
{
base.GetProperties( list );
if ( m_Commodity != null && m_Commodity is ICommodity )
list.Add( 1060658, "#{0}\t{1}", ((ICommodity)m_Commodity).DescriptionNumber, m_Commodity.Amount ); // ~1_val~: ~2_val~
if (m_Commodity != null && m_Commodity is ICommodity)
{
list.Add(1060658, "#{0}\t{1}", ((ICommodity)m_Commodity).DescriptionNumber, m_Commodity.Amount); // ~1_val~: ~2_val~
}
else
list.Add( 1060748 ); // unfilled
list.Add(1060748); // unfilled
}
public override void OnSingleClick( Mobile from )
@ -116,7 +122,20 @@ namespace Server.Items
base.OnSingleClick( from );
if ( m_Commodity != null && m_Commodity is ICommodity )
from.Send( new UnicodeMessage( Serial, ItemID, MessageType.Label, 0x3B2, 3, "ENU", "", ((ICommodity)m_Commodity).Description ) );
from.Send(new MessageLocalizedAffix(
Serial,
ItemID,
MessageType.Label,
0x3B2,
3,
(m_Commodity.Name == null) ? ((ICommodity)m_Commodity).DescriptionNumber : 0,
(m_Commodity.Name != null) ? m_Commodity.Name : null,
AffixType.Append,
String.Format(": {0}",
m_Commodity.Amount),
null)
);
}
public override void OnDoubleClick( Mobile from )
@ -220,6 +239,7 @@ namespace Server.Items
{
if ( m_Deed.SetCommodity( (Item) targeted ) )
{
m_Deed.Hue = 0x592;
number = 1047030; // The commodity deed has been filled.
}
else

View file

@ -4,15 +4,8 @@ namespace Server.Items
{
public class Arrow : Item, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( Amount == 1 ? "{0} arrow" : "{0} arrows", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
public override double DefaultWeight
{

View file

@ -4,15 +4,8 @@ namespace Server.Items
{
public class Bolt : Item, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( Amount == 1 ? "{0} bolt" : "{0} bolts", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
public override double DefaultWeight
{

View file

@ -5,15 +5,8 @@ namespace Server.Items
{
public class Feather : Item, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( Amount == 1 ? "{0} feather" : "{0} feathers", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
public override double DefaultWeight
{

View file

@ -5,15 +5,8 @@ namespace Server.Items
{
public class Shaft : Item, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( Amount == 1 ? "{0} shaft" : "{0} shafts", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
public override double DefaultWeight
{

View file

@ -20,15 +20,8 @@ namespace Server.Items
get { return 0.1; }
}
string ICommodity.Description
{
get
{
return String.Format( Amount == 1 ? "{0} {1} ingot" : "{0} {1} ingots", Amount, CraftResources.GetName( m_Resource ).ToLower() );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
public override void Serialize( GenericWriter writer )
{

View file

@ -18,15 +18,8 @@ namespace Server.Items
set{ m_Resource = value; InvalidateProperties(); }
}
string ICommodity.Description
{
get
{
return String.Format( "{0} {1} ore", Amount, CraftResources.GetName( m_Resource ).ToLower() );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
public abstract BaseIngot GetIngot();

View file

@ -22,15 +22,8 @@ namespace Server.Items
get { return 0.1; }
}
string ICommodity.Description
{
get
{
return String.Format( Amount == 1 ? "{1}" : "{0} {1}", Amount, CraftResources.GetName( m_Resource ).ToLower() );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
public override void Serialize( GenericWriter writer )
{

View file

@ -6,15 +6,8 @@ namespace Server.Items
{
public class BatWing : BaseReagent, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( "{0} bat wing", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public BatWing() : this( 1 )

View file

@ -6,15 +6,8 @@ namespace Server.Items
{
public class BlackPearl : BaseReagent, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( "{0} black pearl", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public BlackPearl() : this( 1 )
@ -30,8 +23,6 @@ namespace Server.Items
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );

View file

@ -6,15 +6,8 @@ namespace Server.Items
{
public class Bloodmoss : BaseReagent, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( "{0} bloodmoss", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public Bloodmoss() : this( 1 )

View file

@ -6,15 +6,8 @@ namespace Server.Items
{
public class DaemonBlood : BaseReagent, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( "{0} daemon blood", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public DaemonBlood() : this( 1 )

View file

@ -6,15 +6,8 @@ namespace Server.Items
{
public class DeadWood : BaseReagent, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( "{0} dead wood", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public DeadWood() : this( 1 )

View file

@ -6,15 +6,8 @@ namespace Server.Items
{
public class Garlic : BaseReagent, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( "{0} garlic", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public Garlic() : this( 1 )

View file

@ -6,16 +6,8 @@ namespace Server.Items
{
public class Ginseng : BaseReagent, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( "{0} ginseng", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public Ginseng() : this( 1 )

View file

@ -6,15 +6,8 @@ namespace Server.Items
{
public class GraveDust : BaseReagent, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( "{0} grave dust", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public GraveDust() : this( 1 )

View file

@ -6,15 +6,8 @@ namespace Server.Items
{
public class MandrakeRoot : BaseReagent, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( "{0} mandrake root", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public MandrakeRoot() : this( 1 )

View file

@ -6,15 +6,8 @@ namespace Server.Items
{
public class Nightshade : BaseReagent, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( "{0} nightshade", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public Nightshade() : this( 1 )

View file

@ -6,15 +6,8 @@ namespace Server.Items
{
public class NoxCrystal : BaseReagent, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( "{0} nox crystal", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public NoxCrystal() : this( 1 )

View file

@ -6,15 +6,8 @@ namespace Server.Items
{
public class PigIron : BaseReagent, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( "{0} pig iron", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public PigIron() : this( 1 )

View file

@ -6,15 +6,8 @@ namespace Server.Items
{
public class SpidersSilk : BaseReagent, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( "{0} spiders' silk", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public SpidersSilk() : this( 1 )

View file

@ -6,15 +6,8 @@ namespace Server.Items
{
public class SulfurousAsh : BaseReagent, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( "{0} sulfurous ash", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public SulfurousAsh() : this( 1 )

View file

@ -7,15 +7,8 @@ namespace Server.Items
[FlipableAttribute( 0xF95, 0xF96, 0xF97, 0xF98, 0xF99, 0xF9A, 0xF9B, 0xF9C )]
public class BoltOfCloth : Item, IScissorable, IDyable, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( Amount == 1 ? "{0} bolt of cloth" : "{0} bolts of cloth", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public BoltOfCloth() : this( 1 )

View file

@ -5,15 +5,8 @@ namespace Server.Items
{
public class Bone : Item, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( Amount == 1 ? "{0} bone" : "{0} bones", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public Bone() : this( 1 )

View file

@ -7,15 +7,8 @@ namespace Server.Items
[FlipableAttribute( 0x1766, 0x1768 )]
public class Cloth : Item, IScissorable, IDyable, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( Amount == 1 ? "{0} piece of cloth" : "{0} pieces of cloth", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
public override double DefaultWeight
{

View file

@ -15,15 +15,8 @@ namespace Server.Items
set{ m_Resource = value; InvalidateProperties(); }
}
string ICommodity.Description
{
get
{
return String.Format( Amount == 1 ? "{0} pile of hides" : "{0} piles of hides", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
public override void Serialize( GenericWriter writer )
{

View file

@ -15,15 +15,8 @@ namespace Server.Items
set{ m_Resource = value; InvalidateProperties(); }
}
string ICommodity.Description
{
get
{
return String.Format( Amount == 1 ? "{0} piece of {1} leather" : "{0} pieces of {1} leather", Amount, CraftResources.GetName( m_Resource ).ToLower() );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
public override void Serialize( GenericWriter writer )
{

View file

@ -7,15 +7,8 @@ namespace Server.Items
[FlipableAttribute( 0x1765, 0x1767 )]
public class UncutCloth : Item, IScissorable, IDyable, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( Amount == 1 ? "{0} piece of cloth" : "{0} pieces of cloth", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
public override double DefaultWeight
{

View file

@ -14,14 +14,6 @@ namespace Server.Items
set { m_Resource = value; InvalidateProperties(); }
}
string ICommodity.Description
{
get
{
return String.Format( Amount == 1 ? "{0} {1} board" : "{0} {1} boards", Amount, CraftResources.IsStandard( m_Resource ) ? String.Empty : CraftResources.GetName( m_Resource ).ToLower() );
}
}
int ICommodity.DescriptionNumber
{
get
@ -40,6 +32,8 @@ namespace Server.Items
}
}
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public Board()
: this( 1 )

View file

@ -15,16 +15,8 @@ namespace Server.Items
set { m_Resource = value; InvalidateProperties(); }
}
string ICommodity.Description
{
get
{
return String.Format( Amount == 1 ? "{0} {1} log" : "{0} {1} logs", Amount, CraftResources.IsStandard( m_Resource ) ? String.Empty : CraftResources.GetName( m_Resource ).ToLower() );
}
}
int ICommodity.DescriptionNumber { get { return CraftResources.IsStandard( m_Resource ) ? LabelNumber : 1075062 + ( (int)m_Resource - (int)CraftResource.RegularWood ); } }
bool ICommodity.IsDeedable { get { return true; } }
[Constructable]
public Log() : this( 1 )
{

View file

@ -17,22 +17,13 @@ namespace Server.Items
Amount = amount;
}
string ICommodity.Description
{
get
{
return String.Format( "blank scroll: {0}", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return (Core.ML); } }
public BlankScroll( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );

View file

@ -2,8 +2,11 @@ using System;
namespace Server.Items
{
public class Bottle : Item
public class Bottle : Item, ICommodity
{
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return (Core.ML); } }
[Constructable]
public Bottle() : this( 1 )
{

View file

@ -35,7 +35,7 @@ namespace Server.Items
ConfusionBlastGreater
}
public abstract class BasePotion : Item, ICraftable
public abstract class BasePotion : Item, ICraftable, ICommodity
{
private PotionEffect m_PotionEffect;
@ -52,6 +52,9 @@ namespace Server.Items
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return (Core.ML); } }
public override int LabelNumber{ get{ return 1041314 + (int)m_PotionEffect; } }
public BasePotion( int itemID, PotionEffect effect ) : base( itemID )

View file

@ -6,7 +6,7 @@ using Server.ContextMenus;
namespace Server.Items
{
public class SpellScroll : Item
public class SpellScroll : Item, ICommodity
{
private int m_SpellID;
@ -18,6 +18,9 @@ namespace Server.Items
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return (Core.ML); } }
public SpellScroll( Serial serial ) : base( serial )
{
}

View file

@ -6,15 +6,8 @@ namespace Server.Items
[FlipableAttribute( 0x11EA, 0x11EB )]
public class Sand : Item, ICommodity
{
string ICommodity.Description
{
get
{
return String.Format( Amount == 1 ? "{0} sand" : "{0} sand", Amount );
}
}
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return true; } }
public override int LabelNumber{ get{ return 1044626; } } // sand

View file

@ -3,8 +3,11 @@ using Server;
namespace Server.Items
{
public class ZoogiFungus : Item
public class ZoogiFungus : Item, ICommodity
{
int ICommodity.DescriptionNumber { get { return LabelNumber; } }
bool ICommodity.IsDeedable { get { return (Core.ML); } }
[Constructable]
public ZoogiFungus() : this( 1 )
{
@ -18,8 +21,6 @@ namespace Server.Items
Amount = amount;
}
public ZoogiFungus( Serial serial ) : base( serial )
{
}