Ejemplo n.º 1
0
                                         Defense Weapons
                                    </TH>
                                    <TH class=subh align=right>
                                         Quantity
                                    </TH>
                                    <TH class=subh>
                                         Strength
                                    </TH>
                                    <TH class=subh>
                                         Repair
                                    </TH>
                                    <TH class=subh>
                                         Scrap/Sell
                                    </TH>
                                </TR>
                                <? $wep = getDefUserWeapon($user);
$totalWCount = 0;
for ($i = 0;$i < count($wep);$i++) {
	$totalWCount+= $wep[$i]->weaponCount;
	printf("<TR><TD>%s</TD>", $conf["race"][$user->race]["defenseweapon"][$wep[$i]->weaponID]["name"]);
?>
                                <TD align=right>
                                    <? numecho($wep[$i]->weaponCount)
?>
                                </TD>
                                <? $x = $wep[$i]->weaponStrength;
	$y = $conf["weapon{$wep[$i]->weaponID}strength"];
	$torepair2 = $torepair2m = $y - $x;
	$cost = $costm = round($conf["weapon{$wep[$i]->weaponID}pp"] * $wep[$i]->weaponCount * $torepair2);
	if ($cost > $user->gold) {
		$torepair2m = floor($user->gold / ($conf["weapon{$wep[$i]->weaponID}pp"] * $wep[$i]->weaponCount));
Ejemplo n.º 2
0
					$weaponamount = floor($rnda * $aW[0]->weaponCount);
					if ($aW[0]->weaponCount <= 15) {
						$weaponamount = 0;
					}
					//setWeapon($aw[0]->ID," weaponCount=weaponCount-'$weaponamount' ");
					if ($aW[0]->weaponCount - $weaponamount <= 0) {
						$sql = "DELETE FROM Weapon WHERE weaponID='$weapontype2' AND userID='$defender->ID' AND isAttack='$weapontype';";
					} else {
						$sql = "UPDATE Weapon SET weaponCount=weaponCount-'$weaponamount' WHERE weaponID='$weapontype2' AND userID='$defender->ID' AND isAttack='$weapontype';";
					}
					mysql_query($sql) or die(mysql_error());
					//  print $sql;
					if ($weapontype == 1) {
						$a = getUserWeapon($attacker);
					} else {
						$a = getDefUserWeapon($attacker);
					}
					$in = true;
					// print_r($a);
					for ($x = - 1;$x <= count($a);$x++) {
						if ($a[$x]->weaponID == $aW[0]->weaponID) {
							setWeapon($a[$x]->ID, " weaponCount=weaponCount+$weaponamount ");
							$in = false;
						}
					}
					if ($in == true AND $weaponamount > 0) {
						$str = $conf["weapon$weapontype2" . "strength"];
						$q = @mysql_query("insert into `Weapon` (weaponID, weaponStrength, weaponCount, isAttack, userID) values ('$weapontype2', '$str', '$weaponamount', '$weapontype', '$attacker->ID')");
					}
				} else {
					$weaponamount = 0;