';
}
while ($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$technick1 = mysqli_fetch_array(db_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$prozent_technik1 = (20 * $technick1[aktiv]) - 20;
$technick1 = mysqli_fetch_array(db_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick2 = mysqli_fetch_array(db_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2[$x]' LIMIT 10"));
$prozent_technik2 = (20 * $technick2[aktiv]) - 20;
$technick2 = mysqli_fetch_array(db_query("SELECT * FROM attacken WHERE id='$technick2[at_id]' LIMIT 10"));
///////////////////Hier laedt er den RELOAD der technik wenn die zusammen setzung nicht stimmen sollte
include "include/kampf/andere_technik.php"; /////////////////// Wenn man ne andere technik sich aussuchen will...
$technick1[speed] = $technick1[speed] + (($technick1[speed] / 100) * $prozent_technik1);
$technick2[speed] = $technick2[speed] + (($technick2[speed] / 100) * $prozent_technik2);
$technick1[verteidigung] = $technick1[verteidigung] + (($technick1[verteidigung] / 100) * $prozent_technik1);
$technick2[verteidigung] = $technick2[verteidigung] + (($technick2[verteidigung] / 100) * $prozent_technik2);
$technick1[starke] = $technick1[starke] + (($technick1[starke] / 100) * $prozent_technik1);
$technick2[starke] = $technick2[starke] + (($technick2[starke] / 100) * $prozent_technik2);
$speeds_char1 = ($k_speed[0] + $technick1[speed]);
$speeds_char2 = ($k_speed[1] + $technick2[speed]);
$speeds_char1_4 = ($k_speed[0] + $technick1[speed]) / 1.5;
$speeds_char2_4 = ($k_speed[1] + $technick2[speed]) / 1.5;
if ($speeds_char1_4 < 1) {
$speeds_char1_4 = 1;
}
if ($speeds_char2_4 < 1) {
$speeds_char2_4 = 1;
}
$speed_char1 = mt_random_wrapper($speeds_char1_4, $speeds_char1);
$speed_char2 = mt_random_wrapper($speeds_char2_4, $speeds_char2);
include "kampf_include.php"; ////Rechnung
#####################################KAMPF SYSTEM
include "include/kampf/kampf_rechnung.php";
$sql = "SELECT * FROM turnier_kampf WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') AND dauer='0' order by id DESC LIMIT 1";
if(($qry = db_query($sql)) === false){
echo $sql.' Failed!!
';
}
$db_query = mysqli_fetch_array($qry);
$sql = "UPDATE turnier_kampf SET hp1='$db_query[hp1],$k_hp7[0]', hp2='$db_query[hp2],$k_hp7[1]', mp1='$db_query[mp1],$k_mp7[0]', mp2='$db_query[mp2],$k_mp7[1]', schaden1='$db_query[schaden1],$schaden_1', schaden2='$db_query[schaden2],$schaden_2', attacke1='$db_query[attacke1],$technick1[name]', attacke2='$db_query[attacke2],$technick2[name]', starke1='$db_query[starke1],$k_starke[0]', starke2='$db_query[starke2],$k_starke[1]', ver1='$db_query[ver1],$k_ver[0]', ver2='$db_query[ver2],$k_ver[1]', speed1='$db_query[speed1],$k_speed[0]', speed2='$db_query[speed2],$k_speed[1]', ausdauer1='$db_query[ausdauer1],$k_ausdauer[0]', ausdauer2='$db_query[ausdauer2],$k_ausdauer[1]', glueck1='$db_query[glueck1],$k_glueck[0]', glueck2='$db_query[glueck2],$k_glueck[1]' WHERE id='$db_query[id]'";
// echo $sql.'
';
db_query($sql);
$x++;
}
###########################EXP VERTEILUNG
if ($k_hp[0] <= 0 AND $k_hp[1] <= 0) {
if ($k_hp[0] > $k_hp[1]) {
$k_hp[0] = $k_hp1[1];
} else {
$k_hp[1] = $k_hp2[1];
}
}
$s = 0;
while ($s < 2) {
if ($s == 1) {
if ($k_hp[0] > $k_hp[1]) {
$X13 = HALLO;
} else {
$X23 = HALLO;
}
}
if ($k_hp[1] < $k_aufgabe[1] OR $X13 == "HALLO") {
$k_exp[1] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id']));
// $k_exp[1] = (($chara_1[starke] + $chara_1[verteidigung] + $chara_1[speed] + $chara_1[ausdauer] + $chara_1[glueck] + $chara_2[starke] + $chara_2[verteidigung] + $chara_2[speed] + $chara_2[ausdauer] + $chara_2[glueck] * ($x / 4)) / 2) * 5;
//$k_geld[1] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * ($x / 6);
$k_exp[0] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * 2.2;
// $k_exp[0] = ($chara_1[starke] + $chara_1[verteidigung] + $chara_1[speed] + $chara_1[ausdauer] + $chara_1[glueck] + $chara_2[starke] + $chara_2[verteidigung] + $chara_2[speed] + $chara_2[ausdauer] + $chara_2[glueck] * ($x / 4)) * 5;
#$k_geld[0] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * ($x / 6) * 2;
$k_geld[0] = 0;
$k_geld[1] = 0;
$sieger = $chara_1[id];
$verlierer = $chara_2[id];
}
if ($k_hp[0] < $k_aufgabe[0] OR $X23 == "HALLO") {
$sieger = $chara_2[id];
$verlierer = $chara_1[id];
$k_exp[1] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * 2.2;
// $k_exp[1] = ($chara_1[starke] + $chara_1[verteidigung] + $chara_1[speed] + $chara_1[ausdauer] + $chara_1[glueck] + $chara_2[starke] + $chara_2[verteidigung] + $chara_2[speed] + $chara_2[ausdauer] + $chara_2[glueck] * ($x / 4)) * 5;
//$k_geld[1] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * ($x / 6) * 2;
$k_geld[1] = 0;
$k_exp[0] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id']));
// $k_exp[0] = (($chara_1[starke] + $chara_1[verteidigung] + $chara_1[speed] + $chara_1[ausdauer] + $chara_1[glueck] + $chara_2[starke] + $chara_2[verteidigung] + $chara_2[speed] + $chara_2[ausdauer] + $chara_2[glueck] * ($x / 4)) / 2) * 5;
//$k_geld[0] = (getPowerLevelWithBuffs($chara_1['id']) + getPowerLevelWithBuffs($chara_2['id'])) * ($x / 6);
$k_geld[0] = 0;
}
if ($k_exp[0]) {
$s = 2;
} else {
$s++;
}
}
$dauer_Z = time();
db_query("UPDATE turnier_kampf SET art='$art_1', round='$round', exp1='$k_exp[0]', win='$sieger', lose='$verlierer', exp2='$k_exp[1]', geld1='$k_geld[0]', geld2='$k_geld[1]', dauer='$dauer_Z' WHERE id='$db_query[id]'");
?>