Beispiel #1
0
        /// <summary>
        /// Removes ammount of exp (untested!)
        /// </summary>
        /// <param name="exp">The ammount of experience to remove</param>
        public void Remove(short exp)
        {
            if (p.CheckEXPLost(exp))
            {
                return;
            }

            short oldLevel = _Level;

            for (int i = 0; i < exp; i++)
            {
                _Experience--;
                _LevelExp--;
                _Level--;
                if (_Experience >= NeededExp)
                {
                    _Level++;
                }
                else
                {
                    _LevelExp = (short)(NeededLevelExp - 1);
                }
            }

            if (_Level < oldLevel)
            {
                p.SendMessage("You have been demoted to level " + _Level);
            }
            p.SendExperience(Bar, _Level, _Experience);
        }