Hello guys,

I've been trying to make a new system, let me explain first what i want to do, so you guys/gals could tell me if its possible to create it.

A "X" custom made bow with no properties, where when u double click it, it asks for you to click like 100 diamonds, then after u do that (diamonds in backpack) the "X" bow "transforms" into a new one, same "X"" bow but with spell channeling and a custom slayer type. (When u click with the old custom bow on the diamonds both will dissapear and the new one will appear)

I tried to find any similar script in ServUO scripts but i got no luck so far... maybe someone here could point me to the right direction.

What i already discovered or no:

To put the random slayer i gotta put something like that on "X" bow before clicking it(?):

if (Utility.RandomDouble( ) < 0.05) // 5% chance
{
BaseRunicTool.GetRandomSlayer();
}

Well anything further that is really welcome. lol
 
The way I did this was without targeting. If you want targeting I would suggest looking into HitchingRope.cs and see how it is done. This one when you double click the item it checks for 100 diamonds in the backpack and if it can consume 100 of them then it performs the transformation.

Code:
using System;

namespace Server.Items
{
    public class TransformItem : Item
    {
     
        [Constructable]
        public TransformItem() : base(0xF25)
        {
            Name = "Custom Name";
        }

        public TransformItem(Serial serial)
            : base(serial)
        {
        }
        public override void OnDoubleClick(Mobile from)
        {
            if (!this.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
            else
            {
                if (from.Backpack.ConsumeTotal(typeof(Diamond), 100))
                {
                    this.Delete();
                    Crossbow bow = new Crossbow();
                    bow.Attributes.SpellChanneling = 1;
                    bow.Slayer = SlayerName.DragonSlaying;
                    from.AddToBackpack(bow);
                    from.SendMessage("You transform the item into a Crossbow.");
                }
                else
                {
                    from.SendMessage("You do not have enough diamonds.");
                }
            }
        }

        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();
        }
    }
}
 
Will take a look on ur script and if it works ill be in forever in ur debt! will try to implement the targeting and if i manage to make it work ill post here. thanks!!
 
Do you specifically have an issue with working it through a gump? It seems that it would be easier to manage if it was set up similar to a crafting menu. JMO. The system sounds similar to weapon socketing from Diablo.
 
the way Drilikath posted gave me an light in the tunnel. I just wanted it to give me a target to a specified amount of an item, and if i had the items on my backpack it would transform this item into another one. I had some problems adding the random properties (spell channeling and a random slayer) to the new item but after some time of frustration i got it working. lol
 
Back