I am attempting to make a "coal ore" that simply produces an iron ingot with a hue of 1109 and the name "coal ingots". I don't really want to make a whole new resource as it does not need to be mineable at all. It is simply a holiday item that I want players to be able to smelt and craft with changing no properties of iron except the hue. I can make the coal ore just fine but it still spits out a regular colored iron ingot when smelted. This seems like it should be super simple to do. Here is what I have. Any suggestions? I am running on RunUO 2.2. I also attempted to make a coal ingot as well instead but it is not recognized as Iron and therefore wont craft.
C#:
public class CoalOre : BaseOre
{
[Constructable]
public CoalOre() : this( 1 )
{
}
[Constructable]
public CoalOre( int amount ) : base( CraftResource.Iron, amount )
{
Weight = 20.0;
Hue = 1109;
}
public CoalOre( Serial serial ) : base( serial )
{
}
public override void OnSingleClick(Mobile from)
{
if (this.Name != null)
{
if (Amount >= 2)
{
from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", Amount + " " + this.Name));
}
else
{
from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
}
}
else
{
if (Amount >= 2)
{
from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", Amount + " coal"));
}
else
{
from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "coal"));
}
}
}
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();
}
public override BaseIngot GetIngot()
{
return new IronIngot();
Hue = 1109;
Name = "coal ingot";
}
}
C#:
[FlipableAttribute( 0x1BF2, 0x1BEF )]
public class CoalIngot : BaseIngot
{
[Constructable]
public CoalIngot() : this( 1 )
{
}
[Constructable]
public CoalIngot( int amount ) : base( CraftResource.Iron, amount )
{
Tag = "mining";
Hue = 1109;
}
public CoalIngot( Serial serial ) : base( serial )
{
}
public override void OnSingleClick(Mobile from)
{
if (this.Name != null)
{
if (Amount >= 2)
{
from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", Amount + " " + this.Name));
}
else
{
from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
}
}
else
{
if (Amount >= 2)
{
from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", Amount + " coal ingots"));
}
else
{
from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a coal ingot"));
}
}
}
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();
}
}
Last edited: