Jump to content

Pest Control Calculator


All_Bogs

Recommended Posts

Submitted by website user Pushee. Leaving this here ...

 

You need to add some form of truncate function (cuts off the decimal) to the following equation on the Pest Control Calculator. I believe the Javascript function is "floor()".

 

var xpPerPoint = Math.floor(((curLvl * curLvl) / 600) * data[skill][4]) * bonus); // Points per ticket for the theoretical level

var xpPerPoint = Math.floor((floor((curLvl * curLvl) / 600) * data[skill][4]) * bonus); // Points per ticket for the theoretical level

 

Because when I'm level 34, your equation say that I'm getting 67xp per point. Which then tells me I need 33 points to level up to 35, But in reality, I need 62.

 

34 * 34 = 1156 / 600 = 1.926 * 35 = 67

Where as... 34 * 34 = 1156 / 600 = 1.926 -> floor() = 1 * 35 = 35

 

 

A week or two ago I submitted a correction for the Pest Control Calculator. You guys did not put the Math.floor command in the right spot' date=' so it's still not working properly. Every level from 25 to 34 will earn the player 35xp per point (disregarding bonus), not 67xp for level 34. Please note the placements of the parenthesis () in the code below!

 

Current code: Line 287: var xpPerPoint = Math.floor((((curLvl * curLvl) / 600) * data[skill'][4]) * bonus); // Points per ticket for the theoretical level

Needs to be: var xpPerPoint = ((Math.floor((curLvl * curLvl) / 600) * data[skill][4]) * bonus); // Points per ticket for the theoretical level

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.