virtualchoirboy Posted December 13, 2010 Share Posted December 13, 2010 I like the new Dragonkin Lamp Calculator, but found that it doesn't take into account the benefit of levelling. For example, I haven't done much Dungeoneering and only have lvl 39 (35,342 xp). On a whim, I typed in 10 lamps and hit Tip.Me! and got back results of 30,080 xp gained and new level of 45. However, since each lamp would be done individually, later lamps would actually give me more experience because I had levelled up. Ideally, the calculator should have shown a final result of 38,988 xp gained and a new level of 46. I took a brief look at the javascript source and see that the calculation is a straight line multiplication of number of lamps * xp per lamp for the starting level. I took a stab at writing some very rough script to get a better result for a single skill (below). I also took the calculation and moved it to it's own function so it could be called with a parameter. Hope this helps. /math geek. function lampXP(lvl){ var exp = Math.floor(((lvl*lvl*lvl) - (2*(lvl*lvl)) + (100*lvl))/20); return exp} function roughFigure(){ var exp = parseInt(document.getElementById('xp').value); var lamps = parseInt(document.getElementById('ttllamps').value); var startlvl = 0; var newexp = 0; var newlvl = 0; startlvl = xplevel(exp); document.getElementById('startlvl').innerHTML = startlvl; newlvl = startlvl; newexp = exp; for (var cnt=1; cnt <= lamps; cnt++){ newexp = newexp + lampXP(newlvl); newlvl = xplevel(newexp); } document.getElementById('resultxp').innerHTML = outputComma(newexp); document.getElementById('resultlvl').innerHTML = newlvl;} Link to comment Share on other sites More sharing options...
Speedyshel Posted December 14, 2010 Share Posted December 14, 2010 Hey virtualchoirboy!Thanks for your suggestion! We are aware this feature is not currently active in the calculation. Funny you mention it, because it was the very last thing discussed about the calculator. Taking level ups into account will be added shortly - we're aware that with the significant experience these lamps grant and their ability to be saved up, it will be quite common to get multiple levels in close succession.Thanks for mentioning it, but keep your eyes peeled, it's just around the corner! :thumbsup:- Speedyshel - Speedyshel Website Updates and Corrections *..It is better to be hated for who you are than loved for who you're not..* Link to comment Share on other sites More sharing options...
All_Bogs Posted December 14, 2010 Share Posted December 14, 2010 It should properly account for levelling now. I used the following code, should it be of interest:function calculate_xp_gain(skill_name, skill_xp, lamps){ // Input: an XP value and the number of Dragonkin Lamps. // Output: the amount of XP that will be gained. var xp = skill_xp; var i; // Use the lamps, one by one. for(i = 0; i < lamps; i++){ lvl = xp_to_level(xp, skill_name); xp = xp + Math.floor((Math.pow(lvl, 3) - 2 * Math.pow(lvl, 2) + 100 * lvl) / 20); } return xp - skill_xp; } Edit: uh, yeah, the comments fail to mention what 'skill_name' is for :oops: Link to comment Share on other sites More sharing options...
Recommended Posts