Notice: Undefined index: language in /var/www/erevtools.com/public_html/config.php on line 21
eRevTools - Individual Damage Calculator
"") { $erevid = $_POST["erevid"]; } if ($_GET["erevid"] <> "") { $erevid = $_GET["erevid"]; } if ($erevid <> "") { getplayerfromerev($erevid, false); $query = "select * from players where playerid = ".$erevid; $result = mysql_query($query); $numrows = mysql_num_rows($result); if ($numrows > 0) { while ($row = mysql_fetch_array($result)) { $level = $row["level"]; $str = $row["strength"]; $rank = $row["militaryrank"]; $name = $row["name"]; $xp = $row["experience"]; $energy = $row["energy"]; $country = $row["country"]; $banned = $row["banned"]; $damagehit = $row["damage"]; $status = $row["status"]; $intelligence = $row["intelligence"]; $navyrank = $row["navyrank"]; } } mysql_free_result($result); } ?>

Individual Damage Calculator


eRev ID:
Name:
Level:
Strength:
Military Rank:
Booster:
Intelligence:
Navy Rank:
Defense System:
Natural Enemy: >
Hits (10 energy per hit): ">

Land Weapons


"; if (is_numeric($_POST["kills"])) { echo ""; } else { echo ""; } $query = "select * from weapons where weapontype in ('Weapon', 'Tank', 'Helicopter', 'RPG') order by weaponid"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { $damage = 0; $gold = 0; /* Save avg price */ $price = preg_replace('/\W/', '.', $_POST["unitprice".$row['weaponid']]); if (is_numeric($price)) { if ($price > 0) { $query = "insert into weapons_histprice (weaponid, price) values (".$row['weaponid'].", ".$price.")"; mysql_query($query); /* Calculate new avg. price */ $priceqty = 0; $pricesum = 0; $query = "select * from weapons_histprice where weaponid = ".$row['weaponid']." and date >= '".date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s')) - 2592000)."'"; $result2 = mysql_query($query); while ($row2 = mysql_fetch_array($result2)) { if ($row['avgprice'] == 0) { $priceqty++; $pricesum = $pricesum + $row2['price']; } else { if (abs(1-($row['avgprice']/$row2['price'])) <= 0.25) { $priceqty++; $pricesum = $pricesum + $row2['price']; } } } mysql_free_result($result2); if ($priceqty > 0) { $query = "update weapons set avgprice = ".$pricesum/$priceqty." where weaponid = ".$row['weaponid']; mysql_query($query); } } } echo ""; echo ""; if (is_numeric($_POST["kills"])) { echo ""; $damage = $_POST["kills"]*$hit*$row['firepower']; } else { echo ""; } if ($row['weaponid'] <> 16) { echo ""; } else { echo ""; } echo ""; if (is_numeric($price) && is_numeric($_POST["kills"])) { if ($price > 0) { echo ""; $gold = $price*$_POST["kills"]; } else { echo ""; $gold = $row['avgprice']*$_POST["kills"]; } } else { echo ""; $gold = $row['avgprice']*$_POST["kills"]; } if ($gold > 0) { echo ""; } else { echo ""; } echo ""; } mysql_free_result($result); echo "
WeaponFire PowerDamageTotal DamageUnit Price (g)Avg. Unit Price (g)Total Cost (g)Damage per gold
No weapon1.00".number_format($hit, 0, '.', ',')."".number_format($_POST["kills"]*$hit, 0, '.', ',')."
".$row['description']."".$row['firepower']."".number_format($row['firepower']*$hit, 0, '.', ',')."".number_format($_POST["kills"]*$hit*$row['firepower'], 0, '.', ',')."".number_format($row['avgprice'], 3, '.', ',')."".number_format($price*$_POST["kills"], 2, '.', ',')."".number_format($row['avgprice']*$_POST["kills"], 2, '.', ',')."".number_format($row['avgprice']*$_POST["kills"], 2, '.', ',')."".number_format($damage/$gold, 2, '.', ',')."

"; // Naval weapons echo "

Naval Weapons


"; echo ""; if (is_numeric($_POST["kills"])) { echo ""; } else { echo ""; } $query = "select * from weapons where weapontype in ('Warship', 'RPG') order by firepower"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { $damage = 0; $gold = 0; /* Save avg price */ $price = preg_replace('/\W/', '.', $_POST["unitprice".$row['weaponid']]); if (is_numeric($price)) { if ($price > 0) { $query = "insert into weapons_histprice (weaponid, price) values (".$row['weaponid'].", ".$price.")"; mysql_query($query); /* Calculate new avg. price */ $priceqty = 0; $pricesum = 0; $query = "select * from weapons_histprice where weaponid = ".$row['weaponid']." and date >= '".date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s')) - 2592000)."'"; $result2 = mysql_query($query); while ($row2 = mysql_fetch_array($result2)) { if ($row['avgprice'] == 0) { $priceqty++; $pricesum = $pricesum + $row2['price']; } else { if (abs(1-($row['avgprice']/$row2['price'])) <= 0.25) { $priceqty++; $pricesum = $pricesum + $row2['price']; } } } mysql_free_result($result2); if ($priceqty > 0) { $query = "update weapons set avgprice = ".$pricesum/$priceqty." where weaponid = ".$row['weaponid']; mysql_query($query); } } } echo ""; echo ""; if (is_numeric($_POST["kills"])) { echo ""; $damage = $_POST["kills"]*$navyhit*$row['firepower']; } else { echo ""; } if ($row['weaponid'] <> 16) { echo ""; } else { echo ""; } echo ""; if (is_numeric($price) && is_numeric($_POST["kills"])) { if ($price > 0) { echo ""; $gold = $price*$_POST["kills"]; } else { echo ""; $gold = $row['avgprice']*$_POST["kills"]; } } else { echo ""; $gold = $row['avgprice']*$_POST["kills"]; } if ($gold > 0) { echo ""; } else { echo ""; } echo ""; } mysql_free_result($result); ?>
WeaponFire PowerDamageTotal DamageUnit Price (g)Avg. Unit Price (g)Total Cost (g)Damage per gold
No weapon1.00".number_format($navyhit, 0, '.', ',')."".number_format($_POST["kills"]*$navyhit, 0, '.', ',')."
".$row['description']."".$row['firepower']."".number_format($row['firepower']*$navyhit, 0, '.', ',')."".number_format($_POST["kills"]*$navyhit*$row['firepower'], 0, '.', ',')."".number_format($row['avgprice'], 3, '.', ',')."".number_format($price*$_POST["kills"], 2, '.', ',')."".number_format($row['avgprice']*$_POST["kills"], 2, '.', ',')."".number_format($row['avgprice']*$_POST["kills"], 2, '.', ',')."".number_format($damage/$gold, 2, '.', ',')."