ServUO Version
Publish 57
Ultima Expansion
Time Of Legends
hello folks, i just noticed that items which have Hit points bonus or stat bonuses, arent adding them to player.
is there any way for them to not obey cap of stats and hp? i did obeycaps = false for skills and its working perfectly but didnot find solution for stats and hp.
main thing is that i dont want players to have ability to train stats over the defined caps (i have class system) so each class has individual caps for each stats.
 
Stat bonuses caps you can set in Config/PlayerCaps.cfg
Hits cap in PlayerMobile.cs
C#:
    #region [Stats]Max
        [CommandProperty(AccessLevel.GameMaster)]
        public override int HitsMax
        {
            get
            {
                int strBase;
                int strOffs = GetStatOffset(StatType.Str);

                if (Core.AOS)
                {
                    strBase = Str; //Str already includes GetStatOffset/str
                    strOffs = AosAttributes.GetValue(this, AosAttribute.BonusHits);

                    if (Core.ML && strOffs > 25 && IsPlayer())
                    {
                        strOffs = 25;
                    }

                    if (AnimalForm.UnderTransformation(this, typeof(BakeKitsune)) ||
                        AnimalForm.UnderTransformation(this, typeof(GreyWolf)))
                    {
                        strOffs += 20;
                    }

                    // Skill Masteries
                    if(Core.TOL)
                        strOffs += ToughnessSpell.GetHPBonus(this);
                }
                else
                {
                    strBase = RawStr;
                }

                return (strBase / 2) + 50 + strOffs;
            }
        }

where if (Core.ML && strOffs > 25 && IsPlayer()) - it's check on Max Hits Bonus
for class system you could easy define specific caps in the same methods in PlayerMobile.cs
or make for it special table with classes and cap values.
or set individual caps after character creation depends on selected classes by using StrCap|StrMaxCap etc. properties of PlayerMobile class.
There are lot of ways how you could to do this.
 
all i need is items to override caps and add bonuses of stats and hp regardless of caps. i dont want to increase caps
 
there should still be an property in AOS.cs that is called ObeyCaps. That would be your thing to change
 
there should still be an property in AOS.cs that is called ObeyCaps. That would be your thing to change
all i found there was for skills

C#:
public void AddTo(Mobile m)
        {
            if (Discordance.UnderPVPEffects(m))
            {
                return;
            }

            Remove();

            for (int i = 0; i < 5; ++i)
            {
                SkillName skill;
                double bonus;

                if (!GetValues(i, out skill, out bonus))
                    continue;

                if (m_Mods == null)
                    m_Mods = new List<SkillMod>();

                SkillMod sk = new DefaultSkillMod(skill, true, bonus);
                sk.ObeyCap = false;
                m.AddSkillMod(sk);
                m_Mods.Add(sk);
            }
        }
i want same for stats, so item can bypass the cap and still add stats or hp bonuses over the cap
 
Back