@ -66,33 +66,33 @@ if ($kampf1['art2'] == 'NPC') { // No Arena-Exp on NPC-Fights
}
}
$arenas_exps = explode(',', $arena[exp]);
$arenas_exps = explode(',', $arena[' exp' ]);
$starke1 = explode(',', $kampf1[starke1]);
$starke1 = explode(',', $kampf1[' starke1' ]);
$starke2 = explode(',', $kampf1[starke2]);
$starke2 = explode(',', $kampf1[' starke2' ]);
$ver1 = explode(',', $kampf1[ver1]);
$ver1 = explode(',', $kampf1[' ver1' ]);
$ver2 = explode(',', $kampf1[ver2]);
$ver2 = explode(',', $kampf1[' ver2' ]);
$speed1 = explode(',', $kampf1[speed1]);
$speed1 = explode(',', $kampf1[' speed1' ]);
$speed2 = explode(',', $kampf1[speed2]);
$speed2 = explode(',', $kampf1[' speed2' ]);
$ausdauer1 = explode(',', $kampf1[ausdauer1]);
$ausdauer1 = explode(',', $kampf1[' ausdauer1' ]);
$ausdauer2 = explode(',', $kampf1[ausdauer2]);
$ausdauer2 = explode(',', $kampf1[' ausdauer2' ]);
$glueck1 = explode(',', $kampf1['glueck1']);
$glueck1 = explode(',', $kampf1['glueck1']);
$glueck2 = explode(',', $kampf1['glueck2']);
$glueck2 = explode(',', $kampf1['glueck2']);
$schaden1 = explode(',', $kampf1[schaden1]);
$schaden1 = explode(',', $kampf1[' schaden1' ]);
$schaden2 = explode(',', $kampf1[schaden2]);
$schaden2 = explode(',', $kampf1[' schaden2' ]);
$attacke1 = explode(',', $kampf1[attacke1]);
$attacke1 = explode(',', $kampf1[' attacke1' ]);
$attacke2 = explode(',', $kampf1[attacke2]);
$attacke2 = explode(',', $kampf1[' attacke2' ]);
$hp1 = explode(',', $kampf1[hp1]);
$hp1 = explode(',', $kampf1[' hp1' ]);
$hp2 = explode(',', $kampf1[hp2]);
$hp2 = explode(',', $kampf1[' hp2' ]);
$mp1 = explode(',', $kampf1[mp1]);
$mp1 = explode(',', $kampf1[' mp1' ]);
$mp2 = explode(',', $kampf1[mp2]);
$mp2 = explode(',', $kampf1[' mp2' ]);
$a_hp1 = explode(',', $char_1[hp]);
$a_hp1 = explode(',', $char_1[' hp' ]);
$a_hp2 = explode(',', $char_2[hp]);
$a_hp2 = explode(',', $char_2[' hp' ]);
$a_mp1 = explode(',', $char_1[mp]);
$a_mp1 = explode(',', $char_1[' mp' ]);
$a_mp2 = explode(',', $char_2[mp]);
$a_mp2 = explode(',', $char_2[' mp' ]);
$runde = 1;
$runde = 1;
$a_mp1[1] = round($a_mp1[1]);
$a_mp1[1] = round($a_mp1[1]);
@ -111,7 +111,7 @@ $runde = $runde -1;
if ($kampf1['id']) {
if ($kampf1['id']) {
$char_infos = getChar($char_id);
$char_infos = getChar($char_id);
$alt_exp = explode(',', $char_infos[exp]);
$alt_exp = explode(',', $char_infos[' exp' ]);
if ($kampf1['char1'] == $char_id) {
if ($kampf1['char1'] == $char_id) {
$new_exp = $kampf1['exp1'];
$new_exp = $kampf1['exp1'];
@ -159,18 +159,18 @@ if ($kampf1['id']) {
###################################################CHARAKTER WIN
###################################################CHARAKTER WIN
if ($kampf1[win] == "$my_charakter[name]") {
if ($kampf1[' win' ] == "$my_charakter[name]") {
$new_siege = $my_charakter[siege] + 1;
$new_siege = $my_charakter[' siege' ] + 1;
////////NPC item verteilung
////////NPC item verteilung
if ($kampf1[art2] == "NPC") {
if ($kampf1[' art2' ] == "NPC") {
$item = mysql_fetch_array(mysql_query("SELECT item, mal, datensatz, wieviel, feld FROM npc_item WHERE charakter='$kampf1[char2]'" ));
$item = mysql_fetch_array(mysql_query('SELECT item, mal, datensatz, wieviel, feld FROM npc_item WHERE charakter='.$kampf1['char2'].';' ));
$schon_bekommen = mysql_num_rows(mysql_query("SELECT id FROM npc_ware WHERE charakter='$kampf1[char2]' AND user='$user_ida[id]' LIMIT 20"));
$schon_bekommen = mysql_num_rows(mysql_query("SELECT id FROM npc_ware WHERE charakter='$kampf1[char2]' AND user='$user_ida[id]' LIMIT 20"));
if ($schon_bekommen >= $item[mal]) {
if ($schon_bekommen >= $item[' mal' ]) {
/////item schon bekommen
/////item schon bekommen
//wtf?! :D wasn das für ne if-anweisung :D :D :D
} else {
} else {
if ($item['datensatz'] == "ware") {
if ($item['datensatz'] == "ware") {
@ -179,7 +179,16 @@ if ($kampf1['id']) {
}
}
elseif ($item['datensatz'] == "chars") {
elseif ($item['datensatz'] == "chars") {
$punkte_block = 1;
$punkte_block = 1;
mysql_query("UPDATE $item[datensatz] SET $item[feld]=$item[feld]+'$item[wieviel]' WHERE besitzer='$user_ida[id]' LIMIT 10");
//muss gemacht werden weil bei hp/mp ein String steht und kein int
if($item['feld'] == 'hp' || $item['feld'] == 'mp') {
$chars = getCharsOfUser($user_ida['id']);
foreach ($chars as $tmp_char) {
$values = explode(',', $tmp_char[$item['feld']]);
mysql_query('UPDATE '.$item['datensatz'].' SET '.$item['feld'].'=\''.$values[0].','.($values[1]+$item['wieviel']).'\' WHERE besitzer='.$user_ida['id'].' AND id='.$tmp_char['id']);
}
} else {
mysql_query("UPDATE $item[datensatz] SET $item[feld]=$item[feld]+'$item[wieviel]' WHERE besitzer='$user_ida[id]' LIMIT 10");
}
mysql_query("INSERT npc_ware SET user='$user_ida[id]', charakter='$kampf1[char2]'");
mysql_query("INSERT npc_ware SET user='$user_ida[id]', charakter='$kampf1[char2]'");
} else {
} else {
$satz = "item";
$satz = "item";
@ -245,12 +254,12 @@ if ($kampf1['id']) {
if($user['id'] == $char_2['besitzer']){
if($user['id'] == $char_2['besitzer']){
// $arenas_new = round($arenas_exps[0] + (50* ($char_1['level']+$char_2['level'] )));
// $arenas_new = round($arenas_exps[0] + (50* ($char_1['level']+$char_2['level'] )));
// Leveln der Arena :) (Um Rundungsfehler zu vermeiden diese umstaendliche Rechnung)
// Leveln der Arena :) (Um Rundungsfehler zu vermeiden diese umstaendliche Rechnung)
addExpToArena($char_2['besitzer'], $kampf1['arena_exp']-round($kampf1['arena_exp']*0.25));
addExpToArena($char_2['besitzer'], $kampf1['arena_exp']-round($kampf1['arena_exp']*0.25));
// Umsatz wird schon vorher ermittelt :)
// Umsatz wird schon vorher ermittelt :)
// mysql_query('UPDATE arena SET einnahmen = einnahmen + '.$kampf1['arena_geld'].' WHERE besitzer='.$char_2['besitzer']);
// mysql_query('UPDATE arena SET einnahmen = einnahmen + '.$kampf1['arena_geld'].' WHERE besitzer='.$char_2['besitzer']);
// include_once (ROOT_PATH . '/include/arena_exp.php');
// include_once (ROOT_PATH . '/include/arena_exp.php');
} else{
} else{
addExpToArena($char_1['besitzer'], round($kampf1['arena_exp']*0.25));
addExpToArena($char_1['besitzer'], round($kampf1['arena_exp']*0.25));
}
}
@ -268,9 +277,9 @@ if ($kampf1['id']) {
} else{
} else{
mysql_query('UPDATE user SET geld=' . $new_geld . ' WHERE id=' . $user['id'] . ' LIMIT 1');
mysql_query('UPDATE user SET geld=' . $new_geld . ' WHERE id=' . $user['id'] . ' LIMIT 1');
}
}
// mysql_query("DELETE FROM kampf_nachricht WHERE charakter='$char_id'");
// mysql_query("DELETE FROM kampf_nachricht WHERE charakter='$char_id'");
// include_once (ROOT_PATH . '/include/exp.php');
// include_once (ROOT_PATH . '/include/exp.php');
// Hinzufuegen der Exp und der Attacken :)
// Hinzufuegen der Exp und der Attacken :)
addExpToChar($char_id, $new_exp); // That was easy :)
addExpToChar($char_id, $new_exp); // That was easy :)