我对这篇文章有很多不喜欢的地方,我不知道为什么,但是为了让你们帮我解决这个问题,我会把这个剧本作为礼物给你.此脚本将经验转换为级别,并从给定指数表达式的级别转换为经验点.这些常数确保100级将等于1000万经验.在Runescape中,它们的等级99等于13,032,xxx是一个奇怪的数字.
using System.IO;
using System;
class Program
{
const float salt = 2.82842712474619f;
const float factor = 0.64977928f;
const int lvl_100_XP = 10000000;
static void Main()
{
int xp = 9717096;// lvl 99
int lvl = ExperienceToLevel(xp);
Console.WriteLine("LVL: " + lvl.ToString()+ " XP: " + LevelToExperience(lvl).ToString());
}
static public int ExperienceToLevel(int xp){
int lvl = 0;
if (xp == lvl_100_XP){//9999987 is lvl 100 due to roundoff issues so it is fixed to 10mill
lvl = 100;
}
else{
lvl = …Run Code Online (Sandbox Code Playgroud)