Hi I'm just beginning my journey with ServUO. So far it has been very fun to mess around with and learn the "code".
Can someone help me with this question?
I am curious if there is something that you can add to an item to have it show the text below.
I've tried a couple things however it breaks the code.
Here is the code I'm messing around with.
using Server.Engines.Craft;
using System;
namespace Server.Items
{
public class TestRock : Item, ICommodity, ICraftable
{
[Constructable]
public TestRock()
: this(1)
{
}
[Constructable]
public TestRock(int amount)
: base(0x1779)
{
this.Name = "Here is main line of text";
this.Hue = 0x9ED; //changes color of item
this.Stackable = false;
//this.EngravedText = "This doesn't work"
//this.Weight = 1.0;
this.Amount = amount;
}
public TestRock(Serial serial)
: base(serial)
{
}
TextDefinition ICommodity.Description
{
get
{
return this.LabelNumber;
}
}
bool ICommodity.IsDeedable
{
get
{
return (Core.ML);
}
}
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 int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
{
Amount = 5;
return 1;
}
}
}
Thanks in advance!!!!
Can someone help me with this question?
I am curious if there is something that you can add to an item to have it show the text below.
I've tried a couple things however it breaks the code.
Here is the code I'm messing around with.
using Server.Engines.Craft;
using System;
namespace Server.Items
{
public class TestRock : Item, ICommodity, ICraftable
{
[Constructable]
public TestRock()
: this(1)
{
}
[Constructable]
public TestRock(int amount)
: base(0x1779)
{
this.Name = "Here is main line of text";
this.Hue = 0x9ED; //changes color of item
this.Stackable = false;
//this.EngravedText = "This doesn't work"
//this.Weight = 1.0;
this.Amount = amount;
}
public TestRock(Serial serial)
: base(serial)
{
}
TextDefinition ICommodity.Description
{
get
{
return this.LabelNumber;
}
}
bool ICommodity.IsDeedable
{
get
{
return (Core.ML);
}
}
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 int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
{
Amount = 5;
return 1;
}
}
}
Thanks in advance!!!!