All_Bogs Posted February 28, 2012 Share Posted February 28, 2012 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 levelvar 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 = 67Where 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 levelNeeds 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 More sharing options...
All_Bogs Posted March 5, 2012 Author Share Posted March 5, 2012 All good now. Link to comment Share on other sites More sharing options...
Recommended Posts