Buff Experience

You are here:
← All Topics
Version: 2019.200 Requirements:uMMORPG3d, ToolsScript Define:_IMMOBUFFEXPERIENCE
Core Changes:YesTutorial Video:No

Description

Everytime experience is gained, the affected player gains increased experience, as long as the buff is active.


Core Changes

  1. [Required] Open the following script Player.cs. See Changes...

    Comment Out/Delete this line:
    public long experience
        {
            get { return _experience; }
            set
            {
                if (value <= _experience)
                {
                    // decrease
                    _experience = Math.Max(value, 0);
                }
                else
                {
                    // increase with level ups
                    // set the new value (which might be more than expMax)
                    _experience = value;
    
                    // now see if we leveled up (possibly more than once too)
                    // (can't level up if already max level)
                    while (_experience >= experienceMax && level < maxLevel)
                    {
                        // subtract current level's required exp, then level up
                        _experience -= experienceMax;
                        ++level;
    
                        // addon system hooks
                        Utils.InvokeMany(typeof(Player), this, "OnLevelUp_");
                    }
    
                    // set to expMax if there is still too much exp remaining
                    if (_experience > experienceMax) _experience = experienceMax;
                }
            }
        }
    

Installation

  1. [Required] Apply all core changes.
  2. [Required] Now create a new buff skill (or modify an existing one) and make it available to your players.

Support the IndieMMO Team Today!

Leave a reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.