9
3

pull type chance.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <html><head><title>Extending Pull Type</title>
  2. <script>
  3. function decimal(n, places)
  4. {
  5. n += 0.000001; // for the case of 100 not displaying as 100.0
  6. var s = n + "";
  7. var d = s.indexOf(".");
  8. return(s.substr(0,d+1+places));
  9. }
  10. </script>
  11. </head>
  12. <body>
  13. <h1>Extending Pull Type</h1>
  14. <script>
  15. function _Pull(isRare, chance)
  16. {
  17. this.isRare = isRare;
  18. this.chance = chance;
  19. }
  20. var pullType = [ "1 common", "3 common", "5 common", "1 imbue", "1 rare", "10 common<BR>1 rare" ];
  21. var baseTable =
  22. [
  23. new _Pull(0, 70 ), // 1 common
  24. new _Pull(0, 20 ), // 3 common
  25. new _Pull(0, 8 ), // 5 common
  26. new _Pull(0, 1 ), // 1 imbue
  27. new _Pull(1, 0.7 ), // 1 rare
  28. new _Pull(1, 0.3 ) // 10 common and 1 rare
  29. ];
  30. function copyTable(oldTable)
  31. {
  32. var newTable = [];
  33. for(var x=0, xl=oldTable.length; x<xl; ++x)
  34. newTable[x] = new _Pull(oldTable[x].isRare, oldTable[x].chance);
  35. return(newTable);
  36. }
  37. function mkBonus(table)
  38. {
  39. var bonus = copyTable(table);
  40. var increase = 0;
  41. /* mult chances by 1.5 (round up) except "1 common" */
  42. for(var x=1, xl=bonus.length; x<xl; ++x)
  43. {
  44. bonus[x].chance = decimal(table[x].chance * 1.5 + 0.05, 1) - 0;
  45. increase += bonus[x].chance - table[x].chance;
  46. }
  47. bonus[0].chance -= increase;
  48. return(bonus);
  49. }
  50. function header()
  51. {
  52. document.write("<tr>");
  53. document.write("<td># Rares</td><td>Table Type</td><td>Total</td>");
  54. for(var x=0, xl=pullType.length; x<xl; ++x)
  55. document.write("<td>" + pullType[x] + "</td>");
  56. document.write("<td>Checked<BR>Total</td>");
  57. document.write("</tr>");
  58. }
  59. function row(nRares, tableType, table)
  60. {
  61. var oldTotal = newTotal = 0;
  62. for(var x=0, xl=table.length; x<xl; ++x)
  63. oldTotal += table[x].chance;
  64. document.write("<tr>");
  65. document.write("<td align=right>" + nRares + "</td>");
  66. document.write("<td>" + tableType + "</td>");
  67. document.write("<td align=right>" + decimal(oldTotal, 2) + "</td>");
  68. for(var x=0, xl=table.length; x<xl; ++x)
  69. {
  70. var chance = table[x].chance / oldTotal * 100 + 0.05;
  71. var s = decimal(chance, 1);
  72. newTotal += (s - 0);
  73. if(s == "0.0")
  74. document.write("<td align=right>----</td>");
  75. else
  76. document.write("<td align=right>" + s + "</td>");
  77. }
  78. document.write("<td align=right>" + decimal(newTotal, 2) + "</td>");
  79. }
  80. /*----------------*/
  81. document.write("<P>Starting with the numbers Domino gave for T4 root node base table:");
  82. document.write("<table border=1 cellpadding=5>");
  83. header();
  84. row(1, "Base", baseTable);
  85. document.write("</table>");
  86. /*----------------*/
  87. document.write("<P>I made the T4 root node bonus table such that everything except \"1 common\" was 1.5 better chance and took the extra off \"1 common\".");
  88. var bonusTable = mkBonus(baseTable);
  89. document.write("<table border=1 cellpadding=5>");
  90. header();
  91. row(1, "Bonus", bonusTable);
  92. document.write("</table>");
  93. /*----------------*/
  94. document.write("<P>Fish nodes have 0 rares and are a special case. I simply recalculated the table with no rares.");
  95. var noRares = copyTable(baseTable);
  96. for(var x=0, xl=noRares.length; x<xl; ++x)
  97. {
  98. if(noRares[x].isRare)
  99. noRares[x].chance = 0;
  100. }
  101. var noRaresBonus = mkBonus(noRares);
  102. document.write("<table border=1 cellpadding=5>");
  103. header();
  104. row(0, "Base", noRares);
  105. row(0, "Bonus", noRaresBonus);
  106. document.write("</table>");
  107. /*----------------*/
  108. document.write("<P>Ore (except T9) and Rocks are also special cases - they have 2 rares. Rare drop rates for these nodes have been doubled, again the excess is just taken off \"1 common\".");
  109. var twoRares = copyTable(baseTable);
  110. var increase = 0;
  111. for(var x=1, xl=noRares.length; x<xl; ++x)
  112. {
  113. if(twoRares[x].isRare)
  114. {
  115. increase += twoRares[x].chance;
  116. twoRares[x].chance *= 2;
  117. }
  118. }
  119. twoRares[0].chance -= increase;
  120. var twoRaresBonus = mkBonus(twoRares);
  121. document.write("<table border=1 cellpadding=5>");
  122. header();
  123. row(2, "Base", twoRares);
  124. row(2, "Bonus", twoRaresBonus);
  125. document.write("</table>");
  126. /*----------------*/
  127. document.write("<h2>Summary of Pull type chances</h2>");
  128. document.write("<table border=1 cellpadding=5>");
  129. header();
  130. row(0, "Base", noRares);
  131. row(0, "Bonus", noRaresBonus);
  132. row(1, "Base", baseTable);
  133. row(1, "Bonus", bonusTable);
  134. row(2, "Base", twoRares);
  135. row(2, "Bonus", twoRaresBonus);
  136. document.write("</table>");
  137. </script></body></html>