Hi everyone.

I'm trying to create an item that gives you randomly 0.1 - 5.0 skill points in a randomly generated skill when it is constructed. However, I cannot figure out how to access the skill data in the array. I also can't seem to find the methods in the Skills class (it doesn't have a .toString() method apparently).

This is what I have thus far...

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Items;
using Server.ContextMenus;

namespace Server.Items
{
    public class AncientSkillGlyph : Item
    {
        private int skill = 0;
        private string skillName = " ";

        [Constructable]
        public AncientSkillGlyph() : this(1)
        {

        }

        [Constructable]
        public AncientSkillGlyph(int amount) : base (0x3155)
        {

            Weight = 1.0;
            LootType = LootType.Blessed;
            Hue = 2221;
            //skillName = getSkill();  //choose random skill and return name
            Name = "Ancient Glyph of ";  // + skillName
            Stackable = false;
        }

        private string getSkill()
        {
            skill = Utility.Random(0, 54);
            // not sure how to access skill name  skillName = ?.Skills[skill].skillName   or toString() method?

            return skillName;
        }

        public AncientSkillGlyph(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);
        }

		public override void OnDoubleClick( Mobile from )
		{
            double amt = Utility.Random(1, 50) * 0.1;
            from.Skills[skill].Base += amt;

            this.Delete();
        }
	}
}


Also, I'm still using RunUO currently, but I will be reading about converting to ServUO considering that there still is support and documentation!
 
RunUO should have the Scrolls of Transcendence...those create skill points, under 1.0 (i.e. 0.1, 0.2, etc). You could use that code as the base for this. :)
 
  • Like
Reactions: Lif
Wow. Hahaha...I'm a gigantic idiot! (It has been a long time since I've worked on a server/uo. But thank you!
 
Last edited:
Back