BelfortUO

Member
ServUO-- :)

Hi I have a little custom ingot that I am trying to figure out how to bind the the player on pickup.

I will be adding it to a mob as a random drop for a quest turn in.

Below is the code the code. Without any of my random tests.

using System;

namespace Server.Items
{
public class FrostIngot : Item
{
public override bool IsArtifact { get { return true; } }
[Constructable]
public FrostIngot()
: base(0x1bf2)
{
Weight = 1.0;
Name = "Ingot of Frost";
Hue = 2212;
}

public FrostIngot(Serial serial)
: base(serial)
{
}

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:
I'll check it out. I have figured out the blessitem deed however I want the item to bind on pick up.

I'll mess around and see if I can make it work, or until I break something.
 
This will make it where the first person that picks it up will be the only person that can ever pick it up. It will also change the name to: Name's Ingot of Frost

C#:
using System;

namespace Server.Items
{
    public class FrostIngot : Item
    {
        public override bool IsArtifact { get { return true; } }
        private Mobile m_Owner;

        [Constructable]
        public FrostIngot() : base(0x1bf2)
        {
            Weight = 1.0;
            Name = "Ingot of Frost";
            Hue = 2212;
        }

        public FrostIngot(Serial serial) : base(serial)
        { }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version

            writer.Write(m_Owner);
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_Owner = reader.ReadMobile();
        }
        
        public override bool OnDragLift(Mobile from)
        {
            if (m_Owner == null)
            {
                m_Owner = from;
                this.Name = m_Owner.Name.ToString() + "'s Ingot of Frost";
                return base.OnDragLift(from);
            }
            else if (m_Owner == from)
                return base.OnDragLift(from);
            else
                from.SendMessage("The freezing cold causes you to drop the ingot.");

            return false;
        }
    }
}
 
Didn't think about trading. This will stop them from being able to be traded.
C#:
        public override bool AllowSecureTrade( Mobile from, Mobile to, Mobile newOwner, bool accepted )
        {
            return false;
        }
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back