Resource icon

Level System 3 - Rerelease 3.4

No permission to download
Requirements
XMLSpawner
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.

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 be 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 rawstats.

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, thats 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 distrbution for players. Pets only get stats, not skill points.
- Mount Level Requirement Check, choose what level is required for mounts of all varients.
- 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.

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 servers 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 disable built in skill mechanics and EXP Gain from Skill Usage

Locate This Section
C#:
        public static void Gain(Mobile from, Skill skill)
        {
Under the bracket, add this
C#:
            /* Level System XML Edit*/
            Configured c = new Configured();
            if (c.DisableSkillGain == true && from is PlayerMobile)
            {
                return;
            }
            /* End */
Locate the below section(s)
Should be 4 sections in total we needed to locate.

1st section

C#:
public static bool Mobile_SkillCheckLocation
Before the line
var loc = new Point2D add the below
C#:
            #region Level System Skills
            LevelHandler.DoGainSkillExp(from, skill, skillName);
            #endregion
2nd section
Locate
C#:
public static bool Mobile_SkillCheckDirectLocation
After the line
var skill = from.Skills[skillName]; add the below
C#:
            #region Level System Skills
            LevelHandler.DoGainSkillExp(from, skill, skillName);
            #endregion
3rd section
Locate
C#:
public static bool Mobile_SkillCheckTarget
After the line
CrystalBallOfKnowledge.TellSkillDifficulty(from, skillName, chance);
Add the below
C#:
            #region Level System Skills
            LevelHandler.DoGainSkillExp(from, skill, skillName);
            #endregion
4th section
Locate
C#:
public static bool Mobile_SkillCheckDirectTarget
After the line
var skill = from.Skills[skillName];
add
C#:
            #region Level System Skills
            LevelHandler.DoGainSkillExp(from, skill, skillName);
            #endregion
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
Author
Joshua
Downloads
93
Views
864
First release
Last update
Rating
5.00 star(s) 1 ratings

Latest updates

  1. Final Update - Enjoy.

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

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

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

Latest reviews

Thank you very much
Level up script is really fun to use
I'm using it too useful for my server.
Thank you very much
It's the system I really needed.
Thank you.