Poleaxe Spec vs Sword Spec calculator

Want to know how will you do with your gear if you pick sword or axe? Not sure what's better for PvP or PvE? This little tool will help you figure stuff out, it's by no means asbolutly perfect, but will give you good estimation of damage with either spec. You can get source code here, feel free to point me any mistakes I could have done...

% (without axe spec!)
%


"); $attackPower = floatval($_POST['attackPower']); $weaponSpeed = floatval($_POST['weaponSpeed']); $weaponDPS = floatval($_POST['weaponDPS']); $toHit = $axeToHit = $swordToHit = 1 - ($_POST['avoidance']/100); // dodge/parry/miss combined (0.8 = 20% avoidance) // Racials || 5 expertise = -1.25% dodge and -1.25% parry if($_POST['racial'] == "orc"){ $axeToHit = $toHit + (0.0125 * $_POST['parry']); }elseif($_POST['racial'] == "human"){ $swordToHit = $toHit + (0.0125 * $_POST['parry']); } if($axeToHit > 1){ $axeToHit = 1; } $baseCrit = $_POST['crit']/100 - ($_POST['resilience'] / 3940); $resilienceRed = 1 - ($_POST['resilience'] / 1970); // adding flurry simulation if($_POST['flurry']){ $flurry = true; $flurriedWeaponSpeed = $weaponSpeed * (1 - 0.05 * $_POST['flurry'] * flurryUptime($baseCrit)); $flurriedAxeWeaponSpeed = $weaponSpeed * (1 - 0.05 * $_POST['flurry'] * flurryUptime($baseCrit + 0.05)); }else{ $flurry = false; $flurriedWeaponSpeed = $weaponSpeed; $flurriedAxeWeaponSpeed = $weaponSpeed; } $hitspersecond = round(1/$flurriedWeaponSpeed + 1/(6 - $_POST['impMS']) + 0.15, 2); // 0.1 for whirlwind and 0.05 for hamstring if($flurry){ $whiteDPS = round($attackPower/14 + $weaponDPS * $weaponSpeed / $flurriedWeaponSpeed, 3); $whiteAxeDPS = round($attackPower/14 + $weaponDPS * $weaponSpeed / $flurriedAxeWeaponSpeed, 3); }else{ $whiteDPS = $whiteAxeDPS = round($attackPower/14 + $weaponDPS); } $MSDPS = ($attackPower/14 * 3.3 + $weaponDPS * $weaponSpeed + 210) / (6 - $_POST['impMS']); if($_POST['impMS']){ $MSDPS *= 1.05; } $WWDPS = ($attackPower/14 * 3.3 + $weaponDPS * $weaponSpeed) / 10; //$flurryFactor = (1.08 + 0.04 * $_POST['flurry']); - removed, replaced with solid 1.1 for deep wounds and precise flurry impact on whiteDPS $critFactor = 1 + ($baseCrit * $resilienceRed * 1.1); // 1.1 here = deep wounds $axeCritFactor = 1 + (($baseCrit + 0.05) * $resilienceRed * 1.1); // 1.1 here = deep wounds $skillCritFactor = (($critFactor-1) * 1.1) + 1; /* impale */ $axeSkillCritFactor = (($axeCritFactor-1) * 1.1) + 1; // DAMAGE OVER 300 SECONDS: $normalDMG = round(($whiteDPS * $critFactor + ($MSDPS + $WWDPS) * $skillCritFactor) * 300 * $toHit); echo($normalDMG." - no spec
"); // DAMAGE OVER 300 SECONDS WITH AXE $axeDMG = round(($whiteAxeDPS * $axeCritFactor + ($MSDPS + $WWDPS) * $axeSkillCritFactor) * 300 * $axeToHit); echo($axeDMG." - axe spec
"); // DAMAGE OVER 300 SECONDS WITH SWORD $swordDMG = round(($whiteDPS * $critFactor + ($MSDPS + $WWDPS) * $skillCritFactor) * 300 * $swordToHit + 300 * $swordToHit * $swordToHit * $hitspersecond * 0.05 * $whiteDPS * $weaponSpeed * $critFactor); echo($swordDMG." - sword spec
"); $axeBonus = $axeDMG - $normalDMG; $swordBonus = $swordDMG - $normalDMG; echo('
Axe added '.$axeBonus.' damage.
Sword added '.$swordBonus.' damage.'); if($swordBonus > $axeBonus){ echo('

Sword spec better by '.round((($swordBonus / $axeBonus) - 1)*100, 2).'%'); }else{ echo('

Axe spec better by '.round((($axeBonus / $swordBonus) - 1)*100, 2).'%'); } if($flurry){ echo('

Flurry uptime is simulated on 100000 virtual strikes (for both axe spec and non-axe spec), script can slow down a bit when calculating Flurry and can give a bit different results every time. There is however no fucking way on earth you can get any more accurate results then that.'); } } ?>