Resource icon

Level System 3 - Rerelease 4.2

No permission to download
Requirements
XMLSpawner and Servuo Distro older than 2/1/2020
IMPORTANT NOTICE!

This resource is no longer going to receive updates due to his evolved version. Its being left here for reference or for those that still want it but I will not be posting any changes here.



Due to the changes with the overhaul of the servuo distro, removing a lot of the older code and removing partial support for the XML spawner, the level system as it is IS NOT compatible with the newest version of servuo. Until the XML Spawner is updated to be fully supported again by myself or the original creator this is only compatible with the system BEFORE the overhaul. You can use any distro you want from the previous distro, however, I will post a download to the latest distro I have tested things out with and will continue to use moving forward! As time permits I will see about rewriting the XML spawner, however for now this is what it will be. To note I will not be managing the distro below, it's not a fork, just a version of servuo that I have confirmed works with the level system.

This is the reborn version of this system that is coming to life. This is compatible with the current distro.


If interested this is the version of XML Spawner that is within the above distro.

Description of System
This is a re-release of the level System 3 that was popular with RunUo 2.2. The original release was a bit buggy and also required edits to playermobile which caused serialization errors periodically.

The expansion of this system is NOT destructive to mobiles since the level information is handled via XML and not Playermobile. However, upgrades to the xml attachment itself and changes to the serialization will cause existing attachments to break and be deleted unless version switching is used in the serialization methods.

Some distro edits cannot be helped for some features to work, I will continue to see if i can move the rest of this strictly to XML attachments instead of using distro edits so the system can, for the most part, drop and go.

I will continue to offer support for this system. This system originated from the RunUO site contributed by someone, unfortunately, i have no idea who. However, I've taken the system to new heights and made a lot of improvements.

Update ExpTables.cs Based on Shard. Default Tables may not be complete for all creatures, it's easy enough to add them in. Also, you may toggle the feature to gain exp based on raw stats.

The system IS set to attach the XML attachment on login, just delete or turn off XMLPlayerLevelAttOnLogin.cs if that is not desired.

I WILL WARN ANYONE NEW TO THIS RELEASE! ALTHOUGH EVERYTHING IS GENERALLY WELL DOCUMENTED AND WHAT CHANGES ARE NEEDED, ATTENTION TO DETAIL IS A MUST! THERE IS A LOT MORE IN THIS NEW ITERATION OF LEVEL 3 AND A LOT MORE ROOM FOR HUMAN ERROR.

Anyone that complains this has too much in it, that's what the config files are for, just set things to false that you do not want to use.


Features
- Fully functional Level up system for Players and Pets
- Stat Sheet gumps for players and pets to manage their levels and stats.
- Stat point and Skill point distribution for players. Pets only get stats, not skill points.
- Mount Level Requirement Check, choose what level is required for mounts of all variants.
- Gain Bonus Stat points on Levelling up.
- Various Items ( EXPCoin, StatResetToken, SkillResetToken, LevelGate, MaxLevelScroll, LevelSheets, More)
- Low-Level Bonus for new players under X Level.
- Level Vendors - They look normal, however they care about your level if you want to buy from them.
- Skill Chain Mechanics Block Out, have your server completely rely on the level system.
- Complete configuration build-out, the whole system can be changed on the drop of a hat.
- EXP awards for turning in Bods, based on points.
- Equipment Level Requirements - Specific Equipment or All equipment, both options exist.

For a full list of additional features/items please review the scripts and configuration files.
If any problems come up, please post in the discussion thread and not to me directly so everyone can benefit from the question. Anything deemed working as intended will not be patched out as a bug, and will be left up to the reporter to make the changes to better suit their server's needs.

Current Issues that will not be squashed
- Level over PlayerMobile's head. In the current version of Servuo it can disappear if too many skill titles appear, the only way around this is to disable those skill titles in playermobile.cs. Suggested to use the Titles.cs edit and put the level info in the paper doll instead.

Turning AdvancedExp to false in the configuration will cause the system to ignore the EXPTables.cs entirely and go based on stats.

Download and place folder in Customs Folder
Please find the suggested Edits Below. They are considered suggested edits due to none of the edits below are required for the system to compile, they are only required for certain features of the system to actually work.

Use command [getatt to see the attachments on creatures and items.
PlayerMobile.cs Distro Edits

Under
C#:
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);


Add under base.GetProperties
C#:
            #region Player Level system
            Configured cf = new Configured();
            XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(this, typeof(XMLPlayerLevelAtt));
            if (cf.LevelBelowToon && xmlplayer != null)
            {
                string d = LevelCore.Display(this, new Configured());
                list.Add("<BASEFONT COLOR=#7FCAE7>Level: <BASEFONT COLOR=#17FF01>" + d);
            }
            #endregion



Also in PlayerMobile, it SHOULD be there however if its not please add
Code:
using Server.Engines.XmlSpawner2;
To the list of systems being used at the top.

Basecreature.cs Distro Edits
Under
C#:
        public override string ApplyNameSuffix( string suffix )
        {

Add
C#:
           #region Level System
            Configured c = new Configured();
            XMLPetLevelAtt petxml2 = (XMLPetLevelAtt)XmlAttach.FindAttachment(this, typeof(XMLPetLevelAtt));
            int cl = LevelCore.CreatureLevel(this, new Configured());
            if (c.CreatureLevels && petxml2 == null)
            {
                    if (cl > 0)
                    {
                            if (suffix.Length == 0)
                                suffix = String.Concat(suffix, "(level " + cl + ")");
                            else
                                suffix = String.Concat(suffix, " (level " + cl + ")");
                    }
            }
            #endregion

Just after public override string ApplyNameSuffix Section, Add the getprops section.
If you happen to already have a getprops, merge this edit, otherwise its not in the normal distro so it won't typically exist.

C#:
        #region Player Level system - BaseCreature Expansion
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);
            ConfiguredPetXML cp2 = new ConfiguredPetXML();
            XMLPetLevelAtt petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(this, typeof(XMLPetLevelAtt));
            if (cp2.LevelBelowPet)
            {
                if (petxml != null)
                {
                    int petlevelint = LevelCore.PetLevelXML(this, new Configured());
                    list.Add("<BASEFONT COLOR=#7FCAE7>Level: <BASEFONT COLOR=#17FF01>" + petlevelint);
                }
            }

        }
        #endregion


CraftItem.cs Distro Edits
Locate this line
C#:
{
from.AddToBackpack
}
Should be somewhere under
if ( item != null )
and below - from.AddToBackpack section , add
Code:
                   //Level System
                    PlayerMobile pm = from as PlayerMobile;
                    Configured c = new Configured();

                    double ch = GetSuccessChance(pm, typeRes, craftSystem, false, ref allRequiredSkills);
                    double ex = GetExceptionalChance(craftSystem, ch, pm);

                    LevelCore.Craft(item, quality, ch, ex, pm, new Configured());
                    //End Level System

Titles.cs Distro Edits
If your titles.cs looks vastly different then below, then carefully merge! Can also post your titles.cs here for help.

Add the Service to top of file
using Server.Engines.XmlSpawner2;

Locate this Section: Should be around Line Number 277
C#:
            if (Core.SA)
            {
                if (beheld is PlayerMobile && ((PlayerMobile)beheld).PaperdollSkillTitle != null)
                    title.Append(", ").Append(((PlayerMobile)beheld).PaperdollSkillTitle);
                else if (beheld is BaseVendor)
                    title.AppendFormat(" {0}", customTitle);
            }

and Replace that whole section with the below

C#:
            if (Core.SA)
            {
                #region Level System
                PlayerMobile pm = beheld as PlayerMobile;
                XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(pm, typeof(XMLPlayerLevelAtt));
                Configured c = new Configured();

                if (beheld is PlayerMobile && ((PlayerMobile)beheld).PaperdollSkillTitle != null)
                {
                    if (c.PaperdollLevel)
                    {
                        string d = LevelCore.Display(pm, new Configured());
                        title.Append(" - Level " + d + ", ").Append(((PlayerMobile)beheld).PaperdollSkillTitle);
                    }
                    else
                        title.Append(", ").Append(((PlayerMobile)beheld).PaperdollSkillTitle);
                }
                else if (beheld is PlayerMobile && ((PlayerMobile)beheld).PaperdollSkillTitle == null)
                {
                    string d = LevelCore.Display(pm, new Configured());
                    if (c.PaperdollLevel)
                    {
                        if (pm.AccessLevel > AccessLevel.Player && c.StaffHasLevel)
                        {
                            title.Append(" - Level " + d);
                        }
                        else
                        {
                            if (pm.AccessLevel < AccessLevel.GameMaster)
                            {
                                title.Append(" - Level " + d);
                            }
                        }

                    }
                }

                else if (beheld is BaseVendor)
                    title.AppendFormat(" {0}", customTitle);


                /*
                if (beheld is PlayerMobile && ((PlayerMobile)beheld).PaperdollSkillTitle != null)
                    title.Append(", ").Append(((PlayerMobile)beheld).PaperdollSkillTitle);
                else if (beheld is BaseVendor)
                    title.AppendFormat(" {0}", customTitle);
                */
                #endregion
            }

SkillCheck.cs Distro Edits
This is required for the disabling built-in skill mechanics and EXP Gain from Skill Usage.
This has been adjusted and only needs one edit below.

Locate This Section
C#:
                if (toGain == 1 && skill.Base <= 10.0)
                    toGain = Utility.Random(4) + 1;

Under the if statement located, add this below
C#:
                /* XML Level System Start */
                Configured ct = new Configured();
                if (ct.DisableSkillGain == true && from is PlayerMobile)
                {
                    return;
                }
                if (toGain != 0 && from is PlayerMobile)
                {
                    LevelHandler.DoGainSkillExp(from, skill);
                }
                /* XML Level System End */


BaseVendor.cs Distro Edits - for level vendor discount
Locate the below section
C#:
[B]       public void UpdateBuyInfo()
        {
[/B]

Merge in the following, replacing can work but its usually best to merge just in case your basevendor doesn't match this.

C#:
       public void UpdateBuyInfo()
        {
            #region Level Vendor Discount Edit
            Configured c = new Configured();
            Town town = Town.FromRegion(Region);
            int priceScalar = GetPriceScalar();

            if (c.DiscountsForLevels == true)
            {
                if (this is LevelVendor10     || this is LevelVendor20     || this is LevelVendor30     || this is LevelVendor40  ||
                    this is LevelVendor50     || this is LevelVendor60     || this is LevelVendor70     || this is LevelVendor80  ||
                    this is LevelVendor90    || this is LevelVendor100    || this is LevelVendor120    || this is LevelVendor140 ||
                    this is LevelVendor160    || this is LevelVendor180    || this is LevelVendor200    || this is LevelVendor230 ||
                    this is LevelVendor250)
                {
                    priceScalar = (int)(priceScalar * 0.6);
                }
            }
            var buyinfo = (IBuyItemInfo[])m_ArmorBuyInfo.ToArray(typeof(IBuyItemInfo));
            if (buyinfo != null)
            {
                foreach (IBuyItemInfo info in buyinfo)
                {
                    info.PriceScalar = priceScalar;
                }
            }
            #endregion
        }

ConfirmBankPointsGump.cs Edits
This is for EXP for turning in Bods.

At the bottom of the section
C#:
public ConfirmBankPointsGump
Add in this
C#:
            #region Level System Mod
            Configured c = new Configured();
            if (c.GainExpFromBods == true)
            {
                LevelHandler.BodGainEXP(user, (int)points);
            }
            #endregion

BaseArmor.cs / BaseWeapon.cs / BaseJewel.cs Distro Edits
In each of the named scripts above, there are edits to allow the battle rating and level requirement system to function.
The changes are only cosmetic! the system functions without them it just won't be obvious why a player cannot equip something.

In the current Distro 2/7/2020 it seems BaseArmor / BaseWeapon and BaseJewel already have the changes needed to display
xml properties when the mouse hovers over.

Locate this section
C#:
public override void AddNameProperties(ObjectPropertyList list)
At the bottom of the section
Add in this line, likely before the end of the region tag.

C#:
Server.Engines.XmlSpawner2.XmlAttach.AddAttachmentProperties(this, list);

((NOTE))
In BaseWeapon.cs the line DOES exist however for me its a personal tick that the XML property appears ABOVE the weight line.
So to make it more universal simply move the line down to the very bottom of the AddNameProperties section.

C#:
XmlAttach.AddAttachmentProperties(this, list);

BaseClothing.cs Distro Edit (THIS IS REQUIRED FOR THE LEVEL SYSTEM TO WORK WITH BASECLOTHING!

Locate this section
C#:
public override void AddNameProperties(ObjectPropertyList list)
At the bottom of the section
Add in this line, likely before the end of the region tag.

C#:
Server.Engines.XmlSpawner2.XmlAttach.AddAttachmentProperties(this, list);

Next Locate this section
C#:
        public override bool CanEquip(Mobile from)
        {

At the bottom of that section replace

C#:
            }

            return base.CanEquip(from);
        }

With

C#:
            }

            if (!Server.Engines.XmlSpawner2.XmlAttach.CheckCanEquip(this, from))
                return false;
            else
                return base.CanEquip(from);
        }
Author
Kamras
Downloads
225
Views
4,327
First release
Last update
Rating
5.00 star(s) 1 ratings

More resources from Kamras

Latest Updates

  1. Changes to Servuo

    With the most recent changes and change of direction taken by the servuo team the level system...
  2. Added Feature and fixes applied.

    -Modified Files -- XMLItemlevelReq.cs -- LevelCore.CS - Fixed old code - Thanks to Malbolger for...
  3. Final Update - Enjoy.

    Welcome to the final update. Beyond this point no additional features will be added. Thank you...
  4. Feature and Bug Update

    Files Adjusted or added - LevelHandler.cs - PlayerLevelGump.cs - LevelCore.cs -...
  5. Forgot the Updated Zip

    Attached ZIP Still getting used to the new form for submitting changes.
Back