Dragonlance

Initiate
ServUO Version
Publish 58
Ultima Expansion
Endless Journey
I have been working on trying to get some lesser skills to not count in the total skill point cap. I am doing this so that players don't have to screw a good build up to add these lesser skills to their main build character. The attached file is what I have this point. Players can only gain up to the total skill points cap with having points in one of the "excluded" skills. The area that I have edited is labeled.

Any and all help would be greatly appreciated.
 

Attachments

  • Skills.cs
    30.9 KB · Views: 5
Thank you for the help but that doesn't seem to be working either. The attached image shows how I have the character skills set up to test this. I am trying to gain Focus which at 40 should get gains like crazy.
 

Attachments

  • Skills.png
    Skills.png
    84 KB · Views: 6
Try making changes to SkillCheck.cs

Gain:
public static void Gain(Mobile from, Skill skill, int toGain)
{
    if (from.Region.IsPartOf<Jail>())
        return;

    if (from is BaseCreature && ((BaseCreature)from).IsDeadPet)
        return;

    if (skill.SkillName == SkillName.Focus && from is BaseCreature &&
        (!PetTrainingHelper.Enabled || !((BaseCreature)from).Controlled))
        return;

    if (skill.Base < skill.Cap && skill.Lock == SkillLock.Up)
    {
        var skills = from.Skills;

        // Define excluded skills (must match BaseFixedPoint)
        HashSet<SkillName> excludedSkills = new HashSet<SkillName>
        {
            SkillName.ArmsLore, SkillName.Begging, SkillName.Camping,
            SkillName.DetectHidden, SkillName.Herding, SkillName.Forensics,
            SkillName.ItemID, SkillName.Stealing, SkillName.TasteID,
            SkillName.RemoveTrap, SkillName.Tracking
        };

       // We calculate the sum of only non-excluded skills
        int nonExcludedTotal = 0;
        foreach (var s in skills)
        {
            if (s != null && !excludedSkills.Contains(s.SkillName))
                nonExcludedTotal += s.BaseFixedPoint;
        }

        // Check the limit only for non-excluded skills
        if (from is PlayerMobile && Siege.SiegeShard)
        {
            var minsPerGain = Siege.MinutesPerGain(from, skill);

            if (minsPerGain > 0)
            {
                if (Siege.CheckSkillGain((PlayerMobile)from, minsPerGain, skill))
                {
                    CheckReduceSkill(skills, toGain, skill);

                    if (nonExcludedTotal + toGain <= skills.Cap)
                    {
                        skill.BaseFixedPoint += toGain;
                    }
                }

                return;
            }
        }

        if (toGain == 1 && skill.Base <= 10.0)
            toGain = Utility.Random(4) + 1;

        #region Mondain's Legacy
        if (from is PlayerMobile && QuestHelper.EnhancedSkill((PlayerMobile)from, skill))
        {
            toGain *= Utility.RandomMinMax(2, 4);
        }
        #endregion

        #region Scroll of Alacrity
        if (from is PlayerMobile && skill.SkillName == ((PlayerMobile)from).AcceleratedSkill &&
            ((PlayerMobile)from).AcceleratedStart > DateTime.UtcNow)
        {
            ((PlayerMobile)from).SendLocalizedMessage(1077956);
            toGain = Utility.RandomMinMax(2, 5);
        }
        #endregion

        #region Skill Masteries
        else if (from is BaseCreature && !(from is Server.Engines.Despise.DespiseCreature) && (((BaseCreature)from).Controlled || ((BaseCreature)from).Summoned))
        {
            var master = ((BaseCreature)from).GetMaster();

            if (master != null)
            {
                var spell = SkillMasterySpell.GetSpell(master, typeof(WhisperingSpell)) as WhisperingSpell;

                if (spell != null && master.InRange(from.Location, spell.PartyRange) && master.Map == from.Map &&
                    spell.EnhancedGainChance >= Utility.Random(100))
                {
                    toGain = Utility.RandomMinMax(2, 5);
                }
            }
        }
        #endregion

        if (from is PlayerMobile)
        {
            CheckReduceSkill(skills, toGain, skill);
        }

        // Apply the increase only if the non-excluded skills do not exceed the limit
        if (!from.Player || (nonExcludedTotal + toGain <= skills.Cap))
        {
            skill.BaseFixedPoint = Math.Min(skill.CapFixedPoint, skill.BaseFixedPoint + toGain);

            EventSink.InvokeSkillGain(new SkillGainEventArgs(from, skill, toGain));

            if (from is PlayerMobile)
                UpdateGGS(from, skill);
        }
    }

    #region Mondain's Legacy
    if (from is PlayerMobile)
        QuestHelper.CheckSkill((PlayerMobile)from, skill);
    #endregion

    if (skill.Lock == SkillLock.Up &&
        (!Siege.SiegeShard || !(from is PlayerMobile) || Siege.CanGainStat((PlayerMobile)from)))
    {
        var info = skill.Info;

        if (!Core.ML)
        {
            var scalar = 1.0;

            if (from.StrLock == StatLockType.Up && (info.StrGain / 33.3) * scalar > Utility.RandomDouble())
                GainStat(from, Stat.Str);
            else if (from.DexLock == StatLockType.Up && (info.DexGain / 33.3) * scalar > Utility.RandomDouble())
                GainStat(from, Stat.Dex);
            else if (from.IntLock == StatLockType.Up && (info.IntGain / 33.3) * scalar > Utility.RandomDouble())
                GainStat(from, Stat.Int);
        }
        else
        {
            TryStatGain(info, from);
        }
    }
}
 

Active Shards

Donations

Total amount
$0.00
Goal
$500.00
Back