Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 28th, 2012  |  syntax: PHP  |  size: 3.10 KB  |  views: 53  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <html>
  2. <head>
  3. <title>Dps Calc.</title>
  4. </head>
  5.  
  6. <body>
  7.  
  8. <form method = "post"
  9.                 action = "character.php">
  10. <h3>Character -> Details -> Offense</h3>
  11. <h3>With no weapon on</h3>
  12. <h3>At the current time this only supports 2h / or 1h with a shield / quiver. Any questions please message Adam#1323 directly.</h3>
  13. <fieldset>
  14. <table cellspacing="0" cellpadding ="0" border="0">
  15. <tr>
  16. <td>
  17. Primary stat</td><td><input type = "text"
  18.                    name = "PrimaryStat"
  19.                    value = "0" /></td>
  20. </tr>
  21. <tr>
  22. <td>
  23. Dmg Increased by Skills</td><td><input type = "text"
  24.                    name = "DmgBySkills"
  25.                    value = "0" /></td>
  26. </tr>
  27. <tr>
  28. <td>
  29. Critical Hit Chance</td><td><input type = "text"
  30.                    name = "CritChance"
  31.                    value = "0" /></td>
  32. </tr>
  33. <tr>
  34. <td>
  35. Critical Hit Dmg</td><td><input type = "text"
  36.                    name = "CritDmg"
  37.                    value = "0" /></tr>
  38. </table>
  39. </fieldset>
  40. <h3>Weapon</h3>
  41. <fieldset>
  42. WeaponMinDmg <input type = "text"
  43.                    name = "WeaponMinDmg"
  44.                    value = "0" /> <br />
  45. WeaponMaxDmg <input type = "text"
  46.                    name = "WeaponMaxDmg"
  47.                    value = "0" /> <br />
  48. Primary stat <input type = "text"
  49.                    name = "WeaponPrimaryStat"
  50.                    value = "0" /><br />
  51. Attacks per second (In Gray Text above the blue Mods)<input type = "text"
  52.                    name = "WeaponAttackSpeed"
  53.                    value = "0" /> <br />
  54. Critical Hit Chance <input type = "text"
  55.                    name = "WeaponCritChance"
  56.                    value = "0" /> <br />
  57. Critical Hit Dmg <input type = "text"
  58.                    name = "WeaponCritDmg"
  59.                    value = "0" /> <br />                   
  60. </fieldset>
  61.  
  62. <h3>Look at your gear, put in totals</h3>
  63. <fieldset>
  64. +Attack speed (add it all up)<input type = "text"
  65.                    name = "AttackSpeed"
  66.                    value = "0" /><br />
  67. +Damage (minimum values)<input type = "text"
  68.                    name = "CDmgMin"
  69.                    value = "0" /><br />
  70. +Damage (maximum values)<input type = "text"
  71.                    name = "CDmgMax"
  72.                    value = "0" /><br />
  73. </fieldset>
  74. <input  type="hidden"
  75.                         name="hidden0"
  76.                         value="submitted"/>
  77.  
  78. <button type = "submit">
  79.         calculate
  80. </button>
  81.  
  82. </form>
  83. </fieldset>
  84. <?php
  85. $CPrimaryStat= filter_input(INPUT_POST, "PrimaryStat");
  86. $CSkill= filter_input(INPUT_POST, "DmgBySkills");
  87. $CAs= filter_input(INPUT_POST, "AttackSpeed");
  88. $CCrit= filter_input(INPUT_POST, "CritChance");
  89. $CCritDmg= filter_input(INPUT_POST, "CritDmg");
  90. $Wmin= filter_input(INPUT_POST, "WeaponMinDmg");
  91. $Cmin= filter_input(INPUT_POST, "CDmgMin");
  92. $Cmax= filter_input(INPUT_POST, "CDmgMax");
  93. $Wmax= filter_input(INPUT_POST, "WeaponMaxDmg");
  94. $WPrimaryStat= filter_input(INPUT_POST, "WeaponPrimaryStat");
  95. $WAs= filter_input(INPUT_POST, "WeaponAttackSpeed");
  96. $WCrit= filter_input(INPUT_POST, "WeaponCritChance");
  97. $WCritDmg= filter_input(INPUT_POST, "WeaponCritDmg");
  98. if(isset($_POST['hidden0']))
  99. {
  100.         $wpndmg = ($Wmin + $Wmax)/2;
  101.         $chardmg = ($Cmin + $Cmax)/2;
  102.         $damage = $wpndmg + $chardmg;
  103.         $attackspeed = $WAs * (1+$CAs);
  104.         $crit = (($CCrit + $WCrit)/100) * (($WCritDmg + $CCritDmg)/100);
  105.         $primestat = $CPrimaryStat + $WPrimaryStat;
  106.         $Shown = (1+($primestat/100))*$damage*$attackspeed*(1+$crit)*(1+($CSkill/100));
  107.         echo $Shown;
  108. }else{
  109. print "Fill in the blanks please<br />";
  110. }
  111.  
  112.  
  113. ?>
  114.  
  115. </body>
  116. </html>