"") { $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); } ?>

Inventory Damage Calculator


eRev ID:
Name:
Inventory:
Level:
Strength:
Military Rank:
Natural Enemy: >
Intelligence:
Navy Rank:
Defense System:
>Field Hospital 50
>Field Hospital 100
>House Q1
>House Q2
>House Q3
>House Q4
>House Q5

Energy


"; $totqty = $totqty + $qty; $totenergy = $totenergy + $energy; $tothits = $tothits + $hits; } else { $pos = strpos($_POST["inventory"], "EnergyQ5"); if ($pos!== false) { $begin = $pos + 8; $i = 1; while (is_numeric(substr($_POST["inventory"], $begin, $i))) { $i++; } $length = $i - 1; $qty = substr($_POST["inventory"], $begin, $length); $energy = $qty * 100; $hits = $qty * 10; echo ""; $totqty = $totqty + $qty; $totenergy = $totenergy + $energy; $tothits = $tothits + $hits; } } $query = "select * from lifekits order by lifekitid"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { $pos = strpos($_POST["inventory"], "Life Kit\r\nQ".$row["lifekitid"]); if ($pos !== false) { $begin = $pos + 12; $length = strpos($_POST["inventory"], "\r\n", $begin+1) - $begin; $qty = substr($_POST["inventory"], $begin, $length); $energy = lifekitenergy($row["lifekitid"], $qty, $_POST["fieldhospital50"], $_POST["fieldhospital100"], $_POST["houseq1"], $_POST["houseq2"], $_POST["houseq3"], $_POST["houseq4"], $_POST["houseq5"]); $hits = $energy / 10; echo ""; $totqty = $totqty + $qty; $totenergy = $totenergy + $energy; $tothits = $tothits + $hits; } else { $pos = strpos($_POST["inventory"], "Life KitQ".$row["lifekitid"]); if ($pos!== false) { $begin = $pos + 10; $i = 1; while (is_numeric(substr($_POST["inventory"], $begin, $i))) { $i++; } $length = $i - 1; $qty = substr($_POST["inventory"], $begin, $length); $energy = lifekitenergy($row["lifekitid"], $qty, $_POST["fieldhospital50"], $_POST["fieldhospital100"], $_POST["houseq1"], $_POST["houseq2"], $_POST["houseq3"], $_POST["houseq4"], $_POST["houseq5"]); $hits = $energy / 10; echo ""; $totqty = $totqty + $qty; $totenergy = $totenergy + $energy; $tothits = $tothits + $hits; } } } echo ""; $tothitsorig = $tothits; ?>
Energy ItemQtyTotal EnergyHits
Energy Q5".number_format($qty, 0, '.', ',')."".number_format($energy, 0, '.', ',')."".number_format($hits, 0, '.', ',')."
Energy Q5".number_format($qty, 0, '.', ',')."".number_format($energy, 0, '.', ',')."".number_format($hits, 0, '.', ',')."
Life Kit Q".$row["lifekitid"]."".number_format($qty, 0, '.', ',')."".number_format($energy, 0, '.', ',')."".number_format($hits, 0, '.', ',')."
Life Kit Q".$row["lifekitid"]."".number_format($qty, 0, '.', ',')."".number_format($energy, 0, '.', ',')."".number_format($hits, 0, '.', ',')."
Total".number_format($totqty, 0, '.', ',')."".number_format($totenergy, 0, '.', ',')."".number_format($tothits, 0, '.', ',')."

Land Weapons


0) { if ($qty > $tothits) { $qty = $tothits; $tothits = 0; } else { $tothits = $tothits - $qty; } echo ""; echo ""; echo ""; $damage = $qty*$hit*$row['firepower']; $totdamage = $totdamage + $damage; $totweapons = $totweapons + $qty; echo ""; echo ""; $gold = $gold + $row['avgprice']*$qty; echo ""; } } mysql_free_result($result); // Verificar se ainda tem energy e acabou a arma if ($tothits > 0) { $query = "select * from weapons where weapontype in ('Weapon', 'Tank', 'Helicopter') order by firepower desc limit 1"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { echo ""; echo ""; echo ""; $damage = $tothits*$hit*$row['firepower']; $totdamage = $totdamage + $damage; $totweapons = $totweapons + $tothits; echo ""; echo ""; $gold = $gold + $row['avgprice']*$tothits; echo ""; } mysql_free_result($result); } echo ""; echo "
WeaponFire PowerDamageQuantityTotal DamageAvg. Unit Price (g)Total Cost (g)
".$row['description']."".$row['firepower']."".number_format($row['firepower']*$hit, 0, '.', ',')."".number_format($qty, 0, '.', ',')."".number_format($qty*$hit*$row['firepower'], 0, '.', ',')."".number_format($row['avgprice'], 3, '.', ',')."".number_format($row['avgprice']*$qty, 2, '.', ',')."
".$row['description']."".$row['firepower']."".number_format($row['firepower']*$hit, 0, '.', ',')."".number_format($tothits, 0, '.', ',')."".number_format($tothits*$hit*$row['firepower'], 0, '.', ',')."".number_format($row['avgprice'], 3, '.', ',')."".number_format($row['avgprice']*$tothits, 2, '.', ',')."
Total".number_format($totweapons, 0, '.', ',')."".number_format($totdamage, 0, '.', ',')."".number_format($gold, 2, '.', ',')."

"; ?>

Naval Weapons


0) { if ($qty > $tothits) { $qty = $tothits; $tothits = 0; } else { $tothits = $tothits - $qty; } echo ""; echo ""; echo ""; $damage = $qty*$navyhit*$row['firepower']; $totdamage = $totdamage + $damage; $totweapons = $totweapons + $qty; echo ""; echo ""; $gold = $gold + $row['avgprice']*$qty; echo ""; } } mysql_free_result($result); // Verificar se ainda tem energy e acabou a arma if ($tothits > 0) { $query = "select * from weapons where weapontype in ('Warship') order by firepower desc limit 1"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { echo ""; echo ""; echo ""; $damage = $tothits*$navyhit*$row['firepower']; $totdamage = $totdamage + $damage; $totweapons = $totweapons + $tothits; echo ""; echo ""; $gold = $gold + $row['avgprice']*$tothits; echo ""; } mysql_free_result($result); } echo ""; echo "
WeaponFire PowerDamageQuantityTotal DamageAvg. Unit Price (g)Total Cost (g)
".$row['description']."".$row['firepower']."".number_format($row['firepower']*$navyhit, 0, '.', ',')."".number_format($qty, 0, '.', ',')."".number_format($qty*$navyhit*$row['firepower'], 0, '.', ',')."".number_format($row['avgprice'], 3, '.', ',')."".number_format($row['avgprice']*$qty, 2, '.', ',')."
".$row['description']."".$row['firepower']."".number_format($row['firepower']*$navyhit, 0, '.', ',')."".number_format($tothits, 0, '.', ',')."".number_format($tothits*$navyhit*$row['firepower'], 0, '.', ',')."".number_format($row['avgprice'], 3, '.', ',')."".number_format($row['avgprice']*$tothits, 2, '.', ',')."
Total".number_format($totweapons, 0, '.', ',')."".number_format($totdamage, 0, '.', ',')."".number_format($gold, 2, '.', ',')."

"; ?>