var classId = 2;
var levelExpAll = 0;
for(i=1;i<=19;i++){
var level = LevelConvert(classId,i);
levelEXP = LevelExp(level);
levelExpAll += LevelExp(level);
//console.log(level);
//console.log(levelEXP);
console.log(levelExpAll);
};
function LevelExp(level){
var i = level+1;
var a = 5;//基本值
var b = 20;//补正值
var c = 1;//增加度A
var d = 30;//增加度B
var expAll = Math.round(a*(Math.pow(i-1, 0.9+c/250))*i*
(i+1)/(6+Math.pow(i,2)/50/d)+(i-1)*b);
var expPre = Math.round(a*(Math.pow(i-2, 0.9+c/250))*(i-1)*
(i)/(6+Math.pow(i-1,2)/50/d)+(i-2)*b);
var exp = expAll-expPre;
return exp;
};
function LevelConvert(classId, levelId){
var level = 1;
switch (classId){
case 2:
level = levelId;
break;
case 3:
level = levelId+14;
break;
case 4:
level = levelId+28;
break;
case 5:
level = levelId+42;
break;
case 6:
level = levelId+56;
break;
case 7:
level = levelId+70;
break;
case 8:
level = levelId+84;
break;
};
return level;
};
console