Pergatory

SMN Physical Damage Calculator

Mar 16th, 2017
1,619
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html><head>
  2. <meta http-equiv="content-type" content="text/html; charset=windows-1252">
  3. <title>Summoner 3-hit Physical BP Damage Calculator</title>
  4. <script type="text/javascript" language="JavaScript">
  5.  
  6. var setNum = 1;
  7.  
  8. // Defaults for equipment panel
  9. var mainBpd = 40;
  10. var mainDa = 0;
  11. var subBpd = 5;
  12. var subDa = 0;
  13. var rangeBpd = 0;
  14. var rangeDa = 0;
  15. var ammoBpd = 15;
  16. var ammoDa = 0;
  17. var headBpd = 7;
  18. var headDa = 8;
  19. var neckBpd = 10;
  20. var neckDa = 0;
  21. var ear1Bpd = 10;
  22. var ear1Da = 0;
  23. var ear2Bpd = 1;
  24. var ear2Da = 3;
  25. var bodyBpd = 0;
  26. var bodyDa = 15;
  27. var handsBpd = 15;
  28. var handsDa = 0;
  29. var ring1Bpd = 0;
  30. var ring1Da = 5;
  31. var ring2Bpd = 4;
  32. var ring2Da = 0;
  33. var backBpd = 5;
  34. var backDa = 0;
  35. var waistBpd = 0;
  36. var waistDa = 4;
  37. var legsBpd = 21;
  38. var legsDa = 4;
  39. var feetBpd = 7;
  40. var feetDa = 8;
  41.  
  42. function startup()
  43. {
  44.   addSet();
  45.   copyValues(1);
  46.   dmgCalc();
  47. }
  48.  
  49. function dmgEvent()
  50. {
  51.   dmgCalc();
  52. }
  53.  
  54. function dmgCalc()
  55. {
  56.   var bpd = +document.getElementById("equipmentBPD").value / 100;
  57.  
  58.   var jobpoints = document.getElementsByName("radioAC");
  59.   for(var i = 0; i < jobpoints.length; i++) {
  60.    if(jobpoints[i].checked == true) {
  61.      bpd = bpd + (+jobpoints[i].value / 100);
  62.    }
  63.  }
  64.  
  65.  var da = +document.getElementById("equipmentDA").value / 100;
  66.  var noMultiChance = 0;
  67.  var oneMultiChance = 0;
  68.  var twoMultiChance = 0;
  69.  
  70.  // Assumptions:
  71.  // You only get 2 chances to proc DA per BP.
  72.  // The max multi-attack procs per BP is 2 (AM3 TA on first hit means no more DA procs)
  73.  // All hits of the BP are equal damage (it's been theorized the first hit may be stronger)
  74.  var radioAM = document.getElementById("radioAM1");
  75.  if(radioAM.checked == true) {
  76.    var firstHitDa = da + ((1-da) * 0.4);
  77.    var firstHitTa = ((1-da) * 0.2);
  78.     noMultiChance = (1 - firstHitDa - firstHitTa) * (1 - da);
  79.     oneMultiChance = (firstHitDa * (1-da)) + ((1-firstHitDa-firstHitTa) * da);
  80.     twoMultiChance = firstHitTa + (firstHitDa * da);
  81.  }
  82.  else
  83.  {
  84.    noMultiChance = (1-da) * (1-da);
  85.    oneMultiChance = (da * (1-da)) * 2;
  86.    twoMultiChance = (da * da);
  87.  }
  88.  var daModifier = noMultiChance + (oneMultiChance * 4/3) + (twoMultiChance * 5/3);
  89.  document.getElementById("textResults").textContent = (bpd+1).toFixed(2) + " BPD multiplier * " + daModifier.toFixed(4) + " DA multiplier = " + ((bpd+1)*(daModifier)).toFixed(4) + " Total Multiplier";
  90.  document.getElementById("textNoMulti").textContent = (noMultiChance*100).toFixed(2) + "%";
  91.  document.getElementById("textOneMulti").textContent = (oneMultiChance*100).toFixed(2) + "%";
  92.  document.getElementById("textTwoMulti").textContent = (twoMultiChance*100).toFixed(2) + "%";
  93.  
  94.  var lastSet = document.getElementById("lastSet").value;
  95.  document.getElementById("lastTotal"+lastSet).value = ((bpd+1)*(daModifier)).toFixed(4);
  96. }
  97. function equipEvent(recalcSet)
  98. {
  99.  equipCalc(recalcSet);
  100. }
  101. function equipCalc(recalcSet)
  102. {
  103.  var bpd = +document.getElementById("mainBPD"+recalcSet).value + +document.getElementById("subBPD"+recalcSet).value + +document.getElementById("rangeBPD"+recalcSet).value + +document.getElementById("ammoBPD"+recalcSet).value
  104.    + +document.getElementById("headBPD"+recalcSet).value + +document.getElementById("neckBPD"+recalcSet).value + +document.getElementById("ear1BPD"+recalcSet).value + +document.getElementById("ear2BPD"+recalcSet).value
  105.    + +document.getElementById("bodyBPD"+recalcSet).value + +document.getElementById("handsBPD"+recalcSet).value + +document.getElementById("ring1BPD"+recalcSet).value + +document.getElementById("ring2BPD"+recalcSet).value
  106.    + +document.getElementById("backBPD"+recalcSet).value + +document.getElementById("waistBPD"+recalcSet).value + +document.getElementById("legsBPD"+recalcSet).value + +document.getElementById("feetBPD"+recalcSet).value;
  107.  var da = +document.getElementById("mainDA"+recalcSet).value + +document.getElementById("subDA"+recalcSet).value + +document.getElementById("rangeDA"+recalcSet).value + +document.getElementById("ammoDA"+recalcSet).value
  108.    + +document.getElementById("headDA"+recalcSet).value + +document.getElementById("neckDA"+recalcSet).value + +document.getElementById("ear1DA"+recalcSet).value + +document.getElementById("ear2DA"+recalcSet).value
  109.    + +document.getElementById("bodyDA"+recalcSet).value + +document.getElementById("handsDA"+recalcSet).value + +document.getElementById("ring1DA"+recalcSet).value + +document.getElementById("ring2DA"+recalcSet).value
  110.    + +document.getElementById("backDA"+recalcSet).value + +document.getElementById("waistDA"+recalcSet).value + +document.getElementById("legsDA"+recalcSet).value + +document.getElementById("feetDA"+recalcSet).value;
  111.  document.getElementById("totalBPD"+recalcSet).value = bpd;
  112.  document.getElementById("totalDA"+recalcSet).value = da;
  113. }
  114. function copyValues(set)
  115. {
  116.  document.getElementById("equipmentBPD").value = document.getElementById("totalBPD"+set).value;
  117.  document.getElementById("equipmentDA").value = document.getElementById("totalDA"+set).value;
  118.  document.getElementById("lastSet").value = set;
  119.  dmgCalc();
  120. }
  121. function addSet()
  122. {
  123.  var newDiv = document.createElement("div");
  124.  newDiv.id = "set" + setNum;
  125.  newDiv.style = "float:left; margin:5;";
  126.  var divText = "<table border='1' cellspacing='0' cellpadding='2'><tr><td>";
  127.   divText += "<p align='center'>Set Name: <input /></p>";
  128.   divText += "<table class='EquipTable'>";
  129.   divText += "  <tr>";
  130.   divText += "    <th><br/>BPD<br/>DA</th>";
  131.   divText += "    <td>Main<br/><input id='mainBPD"+setNum+"' size='3' value='"+mainBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='mainDA"+setNum+"' size='3' value='"+mainDa+"' onchange='equipEvent("+setNum+");' /></td>";
  132.   divText += "    <td>Sub<br/><input id='subBPD"+setNum+"' size='3' value='"+subBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='subDA"+setNum+"' size='3' value='"+subDa+"' onchange='equipEvent("+setNum+");' /></td>";
  133.   divText += "    <td>Range<br/><input id='rangeBPD"+setNum+"' size='3' value='"+rangeBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='rangeDA"+setNum+"' size='3' value='"+rangeDa+"' onchange='equipEvent("+setNum+");' /></td>";
  134.   divText += "    <td>Ammo<br/><input id='ammoBPD"+setNum+"' size='3' value='"+ammoBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='ammoDA"+setNum+"' size='3' value='"+ammoDa+"' onchange='equipEvent("+setNum+");' /></td>";
  135.   divText += "  </tr>";
  136.   divText += "  <tr>";
  137.   divText += "    <th><br/>BPD<br/>DA</th>";
  138.   divText += "    <td>Head<br/><input id='headBPD"+setNum+"' size='3' value='"+headBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='headDA"+setNum+"' size='3' value='"+headDa+"' onchange='equipEvent("+setNum+");' /></td>";
  139.   divText += "    <td>Neck<br/><input id='neckBPD"+setNum+"' size='3' value='"+neckBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='neckDA"+setNum+"' size='3' value='"+neckDa+"' onchange='equipEvent("+setNum+");' /></td>";
  140.   divText += "    <td>Ear1<br/><input id='ear1BPD"+setNum+"' size='3' value='"+ear1Bpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='ear1DA"+setNum+"' size='3' value='"+ear1Da+"' onchange='equipEvent("+setNum+");' /></td>";
  141.   divText += "    <td>Ear2<br/><input id='ear2BPD"+setNum+"' size='3' value='"+ear2Bpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='ear2DA"+setNum+"' size='3' value='"+ear2Da+"' onchange='equipEvent("+setNum+");' /></td>";
  142.   divText += "  </tr>";
  143.   divText += "  <tr>";
  144.   divText += "    <th><br/>BPD<br/>DA</th>";
  145.   divText += "    <td>Body<br/><input id='bodyBPD"+setNum+"' size='3' value='"+bodyBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='bodyDA"+setNum+"' size='3' value='"+bodyDa+"' onchange='equipEvent("+setNum+");' /></td>";
  146.   divText += "    <td>Hands<br/><input id='handsBPD"+setNum+"' size='3' value='"+handsBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='handsDA"+setNum+"' size='3' value='"+handsDa+"' onchange='equipEvent("+setNum+");' /></td>";
  147.   divText += "    <td>Ring1<br/><input id='ring1BPD"+setNum+"' size='3' value='"+ring1Bpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='ring1DA"+setNum+"' size='3' value='"+ring1Da+"' onchange='equipEvent("+setNum+");' /></td>";
  148.   divText += "    <td>Ring2<br/><input id='ring2BPD"+setNum+"' size='3' value='"+ring2Bpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='ring2DA"+setNum+"' size='3' value='"+ring2Da+"' onchange='equipEvent("+setNum+");' /></td>";
  149.   divText += "  </tr>";
  150.   divText += "  <tr>";
  151.   divText += "    <th><br/>BPD<br/>DA</th>";
  152.   divText += "    <td>Back<br/><input id='backBPD"+setNum+"' size='3' value='"+backBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='backDA"+setNum+"' size='3' value='"+backDa+"' onchange='equipEvent("+setNum+");' /></td>";
  153.   divText += "    <td>Waist<br/><input id='waistBPD"+setNum+"' size='3' value='"+waistBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='waistDA"+setNum+"' size='3' value='"+waistDa+"' onchange='equipEvent("+setNum+");' /></td>";
  154.   divText += "    <td>Legs<br/><input id='legsBPD"+setNum+"' size='3' value='"+legsBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='legsDA"+setNum+"' size='3' value='"+legsDa+"' onchange='equipEvent("+setNum+");' /></td>";
  155.   divText += "    <td>Feet<br/><input id='feetBPD"+setNum+"' size='3' value='"+feetBpd+"' onchange='equipEvent("+setNum+");' /><br /><input id='feetDA"+setNum+"' size='3' value='"+feetDa+"' onchange='equipEvent("+setNum+");' /></td>";
  156.   divText += "  </tr>";
  157.   divText += "</table>";
  158.   divText += "<div align='center'>";
  159.   divText += "  <p>Total BPD: <input id='totalBPD"+setNum+"' size='4' class='blue' readonly /> Total DA: <input id='totalDA"+setNum+"' size='4' class='orange' readonly /></p>";
  160.   divText += "  <p>Last Total: <input id='lastTotal"+setNum+"' size='8' readonly /></p>";
  161.   divText += "  <p><input type='button' onClick='copyValues("+setNum+");' value='Use These Values' /></p>";
  162.   divText += "</div>";
  163.   divText += "</td></tr></table>";
  164.   newDiv.innerHTML = divText;
  165.   var div = document.getElementById("sets");
  166.   div.appendChild(newDiv);
  167.   if (setNum > 1)
  168.   {
  169.     document.getElementById("mainBPD"+setNum).value = document.getElementById("mainBPD1").value;
  170.     document.getElementById("mainDA"+setNum).value = document.getElementById("mainDA1").value;
  171.     document.getElementById("subBPD"+setNum).value = document.getElementById("subBPD1").value;
  172.     document.getElementById("subDA"+setNum).value = document.getElementById("subDA1").value;
  173.     document.getElementById("rangeBPD"+setNum).value = document.getElementById("rangeBPD1").value;
  174.     document.getElementById("rangeDA"+setNum).value = document.getElementById("rangeDA1").value;
  175.     document.getElementById("ammoBPD"+setNum).value = document.getElementById("ammoBPD1").value;
  176.     document.getElementById("ammoDA"+setNum).value = document.getElementById("ammoDA1").value;
  177.     document.getElementById("headBPD"+setNum).value = document.getElementById("headBPD1").value;
  178.     document.getElementById("headDA"+setNum).value = document.getElementById("headDA1").value;
  179.     document.getElementById("neckBPD"+setNum).value = document.getElementById("neckBPD1").value;
  180.     document.getElementById("neckDA"+setNum).value = document.getElementById("neckDA1").value;
  181.     document.getElementById("ear1BPD"+setNum).value = document.getElementById("ear1BPD1").value;
  182.     document.getElementById("ear1DA"+setNum).value = document.getElementById("ear1DA1").value;
  183.     document.getElementById("ear2BPD"+setNum).value = document.getElementById("ear2BPD1").value;
  184.     document.getElementById("ear2DA"+setNum).value = document.getElementById("ear2DA1").value;
  185.     document.getElementById("bodyBPD"+setNum).value = document.getElementById("bodyBPD1").value;
  186.     document.getElementById("bodyDA"+setNum).value = document.getElementById("bodyDA1").value;
  187.     document.getElementById("handsBPD"+setNum).value = document.getElementById("handsBPD1").value;
  188.     document.getElementById("handsDA"+setNum).value = document.getElementById("handsDA1").value;
  189.     document.getElementById("ring1BPD"+setNum).value = document.getElementById("ring1BPD1").value;
  190.     document.getElementById("ring1DA"+setNum).value = document.getElementById("ring1DA1").value;
  191.     document.getElementById("ring2BPD"+setNum).value = document.getElementById("ring2BPD1").value;
  192.     document.getElementById("ring2DA"+setNum).value = document.getElementById("ring2DA1").value;
  193.     document.getElementById("backBPD"+setNum).value = document.getElementById("backBPD1").value;
  194.     document.getElementById("backDA"+setNum).value = document.getElementById("backDA1").value;
  195.     document.getElementById("waistBPD"+setNum).value = document.getElementById("waistBPD1").value;
  196.     document.getElementById("waistDA"+setNum).value = document.getElementById("waistDA1").value;
  197.     document.getElementById("legsBPD"+setNum).value = document.getElementById("legsBPD1").value;
  198.     document.getElementById("legsDA"+setNum).value = document.getElementById("legsDA1").value;
  199.     document.getElementById("feetBPD"+setNum).value = document.getElementById("feetBPD1").value;
  200.     document.getElementById("feetDA"+setNum).value = document.getElementById("feetDA1").value;
  201.   }
  202.   equipCalc(setNum);
  203.   setNum++;
  204. }
  205.  
  206. </script>
  207. <style type="text/css">
  208. body
  209. {
  210.   font-family: Verdana, Arial;
  211.   font-size: 8pt;
  212. }
  213.  
  214. p{font-size: 10pt; margin:5px 0px 5px 0px;}
  215.  
  216. span{white-space: nowrap;}
  217.  
  218. td
  219. {
  220.   font-size: 10pt;
  221.   padding: 3px;
  222. }
  223.  
  224. input, select{font-family: inherit;}
  225.  
  226. .blue {border-color: blue;}
  227.  
  228. .orange {border-color: orange;}
  229.  
  230. .big {font-size: 1.6em; vertical-align: middle;}
  231.  
  232. .tooltip {border:1px solid; padding: 4px 2px; background-color: #ffe}
  233.  
  234. .EquipTable TR TH
  235. {
  236.   padding: 8px;
  237.   text-align: right;
  238.   font-weight: normal;
  239. }
  240.  
  241. .EquipTable TR TD
  242. {
  243.   background-color: threedface;
  244.   padding: 8px;
  245.   color: menutext;
  246.   border-width: 2px;
  247.   border-style: solid;
  248.   border-color: threedhighlight threedshadow threedshadow threedhighlight;
  249.   text-align: center;
  250. }
  251.  
  252. .radioSpan
  253. {
  254.   border: 1px solid #cfcfcf;
  255.   padding: 2px 10px 1px 3px;
  256.   line-height: 2em;
  257. }
  258.  
  259. .rightPane
  260. {
  261.   vertical-align: bottom;
  262.   padding-left: 200;
  263. }
  264.  
  265. </style>
  266. </head>
  267.  
  268. <body onload="startup();">
  269. <h1>Summoner Volt Strike & Pred Claws Damage Calculator</h1>
  270.  
  271. <div id="main">
  272. <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>
  273. <table>
  274.   <tr>
  275.     <td>BP Dmg From Equipment:</td>
  276.     <td><input id="equipmentBPD" size="3" onchange="dmgEvent();" class="blue" /></td>
  277.     <td rowspan="4" class="rightPane">
  278.       <span>5x Hits: <label id="textTwoMulti" /></span><br/>
  279.       <span>4x Hits: <label id="textOneMulti" /></span><br/>
  280.       <span>3x Hits: <label id="textNoMulti" /></span>
  281.     </td>
  282.   </tr>
  283.   <tr>
  284.     <td>DA From Equipment:</td>
  285.     <td><input id="equipmentDA" size="3" onchange="dmgEvent();" class="orange" /></td>
  286.   </tr>
  287.   <tr>
  288.     <td>Nirvana AM3:</td>
  289.     <td>
  290.       <label><span class="radioSpan"><input type="radio" id="radioAM1" name="radioAM" value="1" onchange="dmgEvent();">Yes</input></span></label>
  291.       <label><span class="radioSpan"><input type="radio" id="radioAM0" name="radioAM" value="0" onchange="dmgEvent();" checked>No</input></span></label>
  292.     </td>
  293.   </tr>
  294.   <tr>
  295.     <td>Astral Conduit Job Points:</td>
  296.     <td>
  297.       <label><span class="radioSpan"><input type="radio" id="radioAC0" name="radioAC" value="0" onchange="dmgEvent();" checked>None/Inactive</input></span></label>
  298.       <label><span class="radioSpan"><input type="radio" id="radioAC10" name="radioAC" value="10" onchange="dmgEvent();">10</input></span></label>
  299.       <label><span class="radioSpan"><input type="radio" id="radioAC20" name="radioAC" value="20" onchange="dmgEvent();">20</input></span></label>
  300.     </td>
  301.   </tr>
  302. </table>
  303. <h2><label id="textResults" /></h2>
  304. </div>
  305.  
  306. <hr/>
  307.  
  308. <input id="lastSet" type="hidden" value="1" />
  309. <h1>Equipment Bonus Helper <input type='button' onClick='addSet();' value='Add Set' /></h1>
  310.  
  311. <div id="sets" />
  312.  
  313. </body></html>
RAW Paste Data