Advertisement
Pergatory

SMN Magic Damage Calculator

Mar 16th, 2017
2,203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 16.64 KB | None | 0 0
  1. <html><head>
  2. <meta http-equiv="content-type" content="text/html; charset=windows-1252">
  3. <title>Summoner Magic Damage Calculator</title>
  4. <script type="text/javascript" language="JavaScript">
  5.  
  6. var setNum = 1;
  7.  
  8. // Defaults for equipment panel
  9. var mainMab = 140;
  10. var mainBpd = 10;
  11. var subMab = 0;
  12. var subBpd = 5;
  13. var rangeMab = 0;
  14. var rangeBpd = 0;
  15. var ammoMab = 0;
  16. var ammoBpd = 15;
  17. var headMab = 38;
  18. var headBpd = 10;
  19. var neckMab = 10;
  20. var neckBpd = 0;
  21. var ear1Mab = 0;
  22. var ear1Bpd = 10;
  23. var ear2Mab = 0;
  24. var ear2Bpd = 5;
  25. var bodyMab = 35;
  26. var bodyBpd = 10;
  27. var handsMab = 48;
  28. var handsBpd = 15;
  29. var ring1Mab = 0;
  30. var ring1Bpd = 4;
  31. var ring2Mab = 0;
  32. var ring2Bpd = 4;
  33. var backMab = 0;
  34. var backBpd = 5;
  35. var waistMab = 10;
  36. var waistBpd = 0;
  37. var legsMab = 35;
  38. var legsBpd = 17;
  39. var feetMab = 35;
  40. var feetBpd = 12;
  41.  
  42. function startup()
  43. {
  44.   addSet();
  45.   dmgCalc();
  46.   copyValues(1);
  47. }
  48.  
  49. function dmgEvent()
  50. {
  51.   dmgCalc();
  52. }
  53.  
  54. function dmgCalc()
  55. {
  56.   var mab = 100 + +document.getElementById("equipmentMAB").value;
  57.   var bpd = 100 + +document.getElementById("equipmentBPD").value;
  58.   var nativeMAB = document.getElementsByName("nativeMAB");
  59.   for(var i = 0; i < nativeMAB.length; i++) {
  60.    if(nativeMAB[i].checked == true) {
  61.      mab = mab + +nativeMAB[i].value;
  62.    }
  63.  }
  64.  var meritMAB = document.getElementsByName("meritMAB");
  65.  for(var i = 0; i < meritMAB.length; i++) {
  66.    if(meritMAB[i].checked == true) {
  67.      mab = mab + +meritMAB[i].value;
  68.    }
  69.  }
  70.  var capacityMAB = document.getElementsByName("capacityMAB");
  71.  for(var i = 0; i < capacityMAB.length; i++) {
  72.    if(capacityMAB[i].checked == true) {
  73.      mab = mab + +capacityMAB[i].value;
  74.    }
  75.  }  
  76.  document.getElementById("textResults").innerHTML = (mab/100) + " MAB multiplier x " + (bpd/100) + " BPD multiplier = " + (mab*bpd/10000) + " Total Multiplier";
  77.  
  78.  var lastSet = document.getElementById("lastSet").value;
  79.  document.getElementById("lastTotal"+lastSet).value = (mab*bpd/10000).toFixed(4);
  80. }
  81.  
  82. function equipEvent(recalcSet)
  83. {
  84.  equipCalc(recalcSet);
  85. }
  86.  
  87. function equipCalc(recalcSet)
  88. {
  89.  var mab = +document.getElementById("mainMAB"+recalcSet).value + +document.getElementById("subMAB"+recalcSet).value + +document.getElementById("rangeMAB"+recalcSet).value + +document.getElementById("ammoMAB"+recalcSet).value
  90.    + +document.getElementById("headMAB"+recalcSet).value + +document.getElementById("neckMAB"+recalcSet).value + +document.getElementById("ear1MAB"+recalcSet).value + +document.getElementById("ear2MAB"+recalcSet).value
  91.    + +document.getElementById("bodyMAB"+recalcSet).value + +document.getElementById("handsMAB"+recalcSet).value + +document.getElementById("ring1MAB"+recalcSet).value + +document.getElementById("ring2MAB"+recalcSet).value
  92.    + +document.getElementById("backMAB"+recalcSet).value + +document.getElementById("waistMAB"+recalcSet).value + +document.getElementById("legsMAB"+recalcSet).value + +document.getElementById("feetMAB"+recalcSet).value;
  93.  var bpd = +document.getElementById("mainBPD"+recalcSet).value + +document.getElementById("subBPD"+recalcSet).value + +document.getElementById("rangeBPD"+recalcSet).value + +document.getElementById("ammoBPD"+recalcSet).value
  94.    + +document.getElementById("headBPD"+recalcSet).value + +document.getElementById("neckBPD"+recalcSet).value + +document.getElementById("ear1BPD"+recalcSet).value + +document.getElementById("ear2BPD"+recalcSet).value
  95.    + +document.getElementById("bodyBPD"+recalcSet).value + +document.getElementById("handsBPD"+recalcSet).value + +document.getElementById("ring1BPD"+recalcSet).value + +document.getElementById("ring2BPD"+recalcSet).value
  96.    + +document.getElementById("backBPD"+recalcSet).value + +document.getElementById("waistBPD"+recalcSet).value + +document.getElementById("legsBPD"+recalcSet).value + +document.getElementById("feetBPD"+recalcSet).value;
  97.  
  98.  document.getElementById("totalMAB"+recalcSet).value = mab;
  99.  document.getElementById("totalBPD"+recalcSet).value = bpd;
  100. }
  101.  
  102. function copyValues(set)
  103. {
  104.  document.getElementById("equipmentBPD").value = document.getElementById("totalBPD"+set).value;
  105.  document.getElementById("equipmentMAB").value = document.getElementById("totalMAB"+set).value;
  106.  document.getElementById("lastSet").value = set;
  107.  dmgCalc();
  108. }
  109.  
  110. function addSet()
  111. {
  112.  var newDiv = document.createElement("div");
  113.  newDiv.id = "set" + setNum;
  114.  newDiv.style = "float:left; margin:5;";
  115.  var divText = "<table border='1' cellspacing='0' cellpadding='2'><tr><td>";
  116.   divText += "<p align='center'>Set Name: <input /></p>";
  117.   divText += "<table class='EquipTable'>";
  118.   divText += "  <tr>";
  119.   divText += "    <th><br/>BPD<br/>MAB</th>";
  120.   divText += "    <td>Main<br/><input id='mainBPD"+setNum+"' size='3' value='"+mainBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='mainMAB"+setNum+"' size='3' value='"+mainMab+"' onchange='equipEvent("+setNum+");' /></td>";
  121.   divText += "    <td>Sub<br/><input id='subBPD"+setNum+"' size='3' value='"+subBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='subMAB"+setNum+"' size='3' value='"+subMab+"' onchange='equipEvent("+setNum+");' /></td>";
  122.   divText += "    <td>Range<br/><input id='rangeBPD"+setNum+"' size='3' value='"+rangeBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='rangeMAB"+setNum+"' size='3' value='"+rangeMab+"' onchange='equipEvent("+setNum+");' /></td>";
  123.   divText += "    <td>Ammo<br/><input id='ammoBPD"+setNum+"' size='3' value='"+ammoBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='ammoMAB"+setNum+"' size='3' value='"+ammoMab+"' onchange='equipEvent("+setNum+");' /></td>";
  124.   divText += "  </tr>";
  125.   divText += "  <tr>";
  126.   divText += "    <th><br/>BPD<br/>MAB</th>";
  127.   divText += "    <td>Head<br/><input id='headBPD"+setNum+"' size='3' value='"+headBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='headMAB"+setNum+"' size='3' value='"+headMab+"' onchange='equipEvent("+setNum+");' /></td>";
  128.   divText += "    <td>Neck<br/><input id='neckBPD"+setNum+"' size='3' value='"+neckBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='neckMAB"+setNum+"' size='3' value='"+neckMab+"' onchange='equipEvent("+setNum+");' /></td>";
  129.   divText += "    <td>Ear1<br/><input id='ear1BPD"+setNum+"' size='3' value='"+ear1Bpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='ear1MAB"+setNum+"' size='3' value='"+ear1Mab+"' onchange='equipEvent("+setNum+");' /></td>";
  130.   divText += "    <td>Ear2<br/><input id='ear2BPD"+setNum+"' size='3' value='"+ear2Bpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='ear2MAB"+setNum+"' size='3' value='"+ear2Mab+"' onchange='equipEvent("+setNum+");' /></td>";
  131.   divText += "  </tr>";
  132.   divText += "  <tr>";
  133.   divText += "    <th><br/>BPD<br/>MAB</th>";
  134.   divText += "    <td>Body<br/><input id='bodyBPD"+setNum+"' size='3' value='"+bodyBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='bodyMAB"+setNum+"' size='3' value='"+bodyMab+"' onchange='equipEvent("+setNum+");' /></td>";
  135.   divText += "    <td>Hands<br/><input id='handsBPD"+setNum+"' size='3' value='"+handsBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='handsMAB"+setNum+"' size='3' value='"+handsMab+"' onchange='equipEvent("+setNum+");' /></td>";
  136.   divText += "    <td>Ring1<br/><input id='ring1BPD"+setNum+"' size='3' value='"+ring1Bpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='ring1MAB"+setNum+"' size='3' value='"+ring1Mab+"' onchange='equipEvent("+setNum+");' /></td>";
  137.   divText += "    <td>Ring2<br/><input id='ring2BPD"+setNum+"' size='3' value='"+ring2Bpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='ring2MAB"+setNum+"' size='3' value='"+ring2Mab+"' onchange='equipEvent("+setNum+");' /></td>";
  138.   divText += "  </tr>";
  139.   divText += "  <tr>";
  140.   divText += "    <th><br/>BPD<br/>MAB</th>";
  141.   divText += "    <td>Back<br/><input id='backBPD"+setNum+"' size='3' value='"+backBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='backMAB"+setNum+"' size='3' value='"+backMab+"' onchange='equipEvent("+setNum+");' /></td>";
  142.   divText += "    <td>Waist<br/><input id='waistBPD"+setNum+"' size='3' value='"+waistBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='waistMAB"+setNum+"' size='3' value='"+waistMab+"' onchange='equipEvent("+setNum+");' /></td>";
  143.   divText += "    <td>Legs<br/><input id='legsBPD"+setNum+"' size='3' value='"+legsBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='legsMAB"+setNum+"' size='3' value='"+legsMab+"' onchange='equipEvent("+setNum+");' /></td>";
  144.   divText += "    <td>Feet<br/><input id='feetBPD"+setNum+"' size='3' value='"+feetBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='feetMAB"+setNum+"' size='3' value='"+feetMab+"' onchange='equipEvent("+setNum+");' /></td>";
  145.   divText += "  </tr>";
  146.   divText += "</table>";
  147.   divText += "<div align='center'>";
  148.   divText += "  <p>Total BPD: <input id='totalBPD"+setNum+"' size='4' class='blue' readonly /> Total MAB: <input id='totalMAB"+setNum+"' size='4' class='orange' readonly /></p>";
  149.   divText += "  <p>Last Total: <input id='lastTotal"+setNum+"' size='8' readonly /></p>";
  150.   divText += "  <p><input type='button' onClick='copyValues("+setNum+");' value='Use These Values' /></p>";
  151.   divText += "</div>";
  152.   divText += "</td></tr></table>";  
  153.   newDiv.innerHTML = divText;  
  154.   var div = document.getElementById("sets");
  155.   div.appendChild(newDiv);
  156.   if (setNum > 1)
  157.   {
  158.     document.getElementById("mainMAB"+setNum).value = document.getElementById("mainMAB1").value;
  159.     document.getElementById("mainBPD"+setNum).value = document.getElementById("mainBPD1").value;
  160.     document.getElementById("subMAB"+setNum).value = document.getElementById("subMAB1").value;
  161.     document.getElementById("subBPD"+setNum).value = document.getElementById("subBPD1").value;
  162.     document.getElementById("rangeMAB"+setNum).value = document.getElementById("rangeMAB1").value;
  163.     document.getElementById("rangeBPD"+setNum).value = document.getElementById("rangeBPD1").value;
  164.     document.getElementById("ammoMAB"+setNum).value = document.getElementById("ammoMAB1").value;
  165.     document.getElementById("ammoBPD"+setNum).value = document.getElementById("ammoBPD1").value;
  166.     document.getElementById("headMAB"+setNum).value = document.getElementById("headMAB1").value;
  167.     document.getElementById("headBPD"+setNum).value = document.getElementById("headBPD1").value;
  168.     document.getElementById("neckMAB"+setNum).value = document.getElementById("neckMAB1").value;
  169.     document.getElementById("neckBPD"+setNum).value = document.getElementById("neckBPD1").value;
  170.     document.getElementById("ear1MAB"+setNum).value = document.getElementById("ear1MAB1").value;
  171.     document.getElementById("ear1BPD"+setNum).value = document.getElementById("ear1BPD1").value;
  172.     document.getElementById("ear2MAB"+setNum).value = document.getElementById("ear2MAB1").value;
  173.     document.getElementById("ear2BPD"+setNum).value = document.getElementById("ear2BPD1").value;
  174.     document.getElementById("bodyMAB"+setNum).value = document.getElementById("bodyMAB1").value;
  175.     document.getElementById("bodyBPD"+setNum).value = document.getElementById("bodyBPD1").value;
  176.     document.getElementById("handsMAB"+setNum).value = document.getElementById("handsMAB1").value;
  177.     document.getElementById("handsBPD"+setNum).value = document.getElementById("handsBPD1").value;
  178.     document.getElementById("ring1MAB"+setNum).value = document.getElementById("ring1MAB1").value;
  179.     document.getElementById("ring1BPD"+setNum).value = document.getElementById("ring1BPD1").value;
  180.     document.getElementById("ring2MAB"+setNum).value = document.getElementById("ring2MAB1").value;
  181.     document.getElementById("ring2BPD"+setNum).value = document.getElementById("ring2BPD1").value;
  182.     document.getElementById("backMAB"+setNum).value = document.getElementById("backMAB1").value;
  183.     document.getElementById("backBPD"+setNum).value = document.getElementById("backBPD1").value;
  184.     document.getElementById("waistMAB"+setNum).value = document.getElementById("waistMAB1").value;
  185.     document.getElementById("waistBPD"+setNum).value = document.getElementById("waistBPD1").value;
  186.     document.getElementById("legsMAB"+setNum).value = document.getElementById("legsMAB1").value;
  187.     document.getElementById("legsBPD"+setNum).value = document.getElementById("legsBPD1").value;
  188.     document.getElementById("feetMAB"+setNum).value = document.getElementById("feetMAB1").value;
  189.     document.getElementById("feetBPD"+setNum).value = document.getElementById("feetBPD1").value;
  190.   }
  191.   equipCalc(setNum);
  192.   setNum++;
  193. }
  194.  
  195. </script>
  196. <style type="text/css">
  197. body
  198. {
  199.   font-family: Verdana, Arial;
  200.   font-size: 8pt;
  201. }
  202.  
  203. p{font-size: 10pt; margin:5px 0px 5px 0px;}
  204.  
  205. span{white-space: nowrap;}
  206.  
  207. td
  208. {
  209.   font-size: 10pt;
  210.   padding: 3px;
  211. }
  212.  
  213. input, select{font-family: inherit;}
  214.  
  215. .blue {border-color: blue;}
  216.  
  217. .orange {border-color: orange;}
  218.  
  219. .big {font-size: 1.6em; vertical-align: middle;}
  220.  
  221. .tooltip {border:1px solid; padding: 4px 2px; background-color: #ffe}
  222.  
  223. .EquipTable TR TH
  224. {
  225.   padding: 8px;
  226.   text-align: right;
  227.   font-weight: normal;
  228. }
  229.  
  230. .EquipTable TR TD
  231. {
  232.   background-color: threedface;
  233.   padding: 8px;
  234.   color: menutext;
  235.   border-width: 2px;
  236.   border-style: solid;
  237.   border-color: threedhighlight threedshadow threedshadow threedhighlight;
  238.   text-align: center;
  239. }
  240.  
  241. .radioSpan
  242. {
  243.   border: 1px solid #cfcfcf;
  244.   padding: 2px 10px 1px 3px;
  245.   line-height: 2em;
  246. }
  247. </style>
  248. </head>
  249.  
  250. <body onload="startup();">
  251. <h1>Summoner Magic Damage Calculator</h1>
  252. <div name="main">
  253. <span class="tooltip"><span class="big">&#10068;</span> You can use the helper below to calculate the totals from your equipment and compare different sets.</span>
  254. <table>
  255.   <tr>
  256.     <td>Avatar Level:</td>
  257.     <td>
  258.       <label><span class="radioSpan"><input type="radio" id="radioLv99" name="nativeMAB" value="40" onchange="dmgEvent();">99</input></span></label>
  259.       <label><span class="radioSpan"><input type="radio" id="radioLv113" name="nativeMAB" value="58" onchange="dmgEvent();">113</input></span></label>
  260.       <label><span class="radioSpan"><input type="radio" id="radioLv115" name="nativeMAB" value="62" onchange="dmgEvent();">115</input></span></label>
  261.       <label><span class="radioSpan"><input type="radio" id="radioLv119" name="nativeMAB" value="69" onchange="dmgEvent();">119</input></span></label>
  262.       <label><span class="radioSpan"><input type="radio" id="radioLv120" name="nativeMAB" value="70" onchange="dmgEvent();" checked>120+</input></span></label>
  263.     </td>
  264.   </tr>
  265.   <tr>
  266.     <td>Avatar MAB from Merits:</td>
  267.     <td>
  268.       <label><span class="radioSpan"><input type="radio" id="radioMerit0" name="meritMAB" value="0" onchange="dmgEvent();"> +0</input></span></label>
  269.       <label><span class="radioSpan"><input type="radio" id="radioMerit1" name="meritMAB" value="2" onchange="dmgEvent();"> +2</input></span></label>
  270.       <label><span class="radioSpan"><input type="radio" id="radioMerit2" name="meritMAB" value="4" onchange="dmgEvent();"> +4</input></span></label>
  271.       <label><span class="radioSpan"><input type="radio" id="radioMerit3" name="meritMAB" value="6" onchange="dmgEvent();"> +6</input></span></label>
  272.       <label><span class="radioSpan"><input type="radio" id="radioMerit4" name="meritMAB" value="8" onchange="dmgEvent();"> +8</input></span></label>
  273.       <label><span class="radioSpan"><input type="radio" id="radioMerit5" name="meritMAB" value="10" onchange="dmgEvent();" checked> +10</input></span></label>
  274.     </td>
  275.   </tr>
  276.   <tr>
  277.     <td>Avatar MAB from Gifts:</td>
  278.     <td>
  279.       <label><span class="radioSpan"><input type="radio" id="radioJP0" name="capacityMAB" value="0" onchange="dmgEvent();"> +0</input></span></label>
  280.       <label><span class="radioSpan"><input type="radio" id="radioJP1" name="capacityMAB" value="5" onchange="dmgEvent();"> +5 (80)</input></span></label>
  281.       <label><span class="radioSpan"><input type="radio" id="radioJP2" name="capacityMAB" value="13" onchange="dmgEvent();"> +13 (405)</input></span></label>
  282.       <label><span class="radioSpan"><input type="radio" id="radioJP3" name="capacityMAB" value="23" onchange="dmgEvent();"> +23 (980)</input></span></label>
  283.       <label><span class="radioSpan"><input type="radio" id="radioJP4" name="capacityMAB" value="36" onchange="dmgEvent();" checked> +36 (1805)</input></span></label>
  284.     </td>
  285.   </tr>
  286.   <tr>
  287.     <td>BP Dmg From Equipment:</td>
  288.     <td><input id="equipmentBPD" size="3" onchange="dmgEvent();" class="blue" /></td>
  289.   </tr>
  290.   <tr>
  291.     <td>MAB From Equipment:</td>
  292.     <td><input id="equipmentMAB" size="3" onchange="dmgEvent();" class="orange" /></td>
  293.   </tr>
  294. </table>
  295. <h2><label id="textResults" /></h2>
  296. </div>
  297.  
  298. <hr/>
  299.  
  300. <input id="lastSet" type="hidden" value="1" />
  301. <h1>Equipment Bonus Helper <input type='button' onClick='addSet();' value='Add Set' /></h1>
  302.  
  303. <div id="sets" />
  304.  
  305. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement