hecht 14 years ago
parent 5aede0ef6b
commit 37f49dfd36

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
<buildpathentry kind="src" path=""/>
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
</buildpath>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>cronjob</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

@ -0,0 +1,13 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include "db.php";
mysql_query("UPDATE chars SET status='Frei' WHERE status='Turnier'");
?>

@ -0,0 +1,52 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################SSJ SPIELER 1
if($technick1[type] == SSJ) {
$k_mp[0] = $k_mp[0] - $technick1[mp];
if($k_mp[0] < 0) {
$schaden_1 = "SSJ Verwandlung fehlgeschlagen";
$aktion_AV1[$x] = "nein";
$k_mp[0] = 0;
} else {
if(!$ssj_tech_1) {
$k_starke[0] = $k_starke[0] * (($technick1[starke]+1) / 2);
$k_speed[0] = $k_speed[0] * (($technick1[speed]+1) / 2);
$k_ver[0] = $k_ver[0] * (($technick1[verteidigung]+1) / 2);
$schaden_1 = "$technick1[name]!!!";
$aktion_AV1[$x] = "nein";
$ssj_tech_1=$technick1[level];
}
}}
####################SSJ SPIELER 2
if($technick2[type] == SSJ) {
$k_mp[1] = $k_mp[1] - $technick2[mp];
if($k_mp[1] < 0) {
$schaden_2 = "SSJ Verwandlung fehlgeschlagen";
$aktion_AV2[$x] = "nein";
$k_mp[1] = 0;
} else {
if(!$ssj_tech_2) {
$k_starke[1] = $k_starke[1] * (($technick2[starke]+1) / 2);
$k_speed[1] = $k_speed[1] * (($technick2[speed]+1) / 2);
$k_ver[1] = $k_ver[1] * (($technick2[verteidigung]+1) / 2);
$schaden_2 = "$technick2[name]!!!";
$aktion_AV2[$x] = "nein";
$ssj_tech_2=$technick2[level];
}}}
?>

@ -0,0 +1,149 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include "db.php";
include_once ('inclu/messagefunctions.inc.php');
include_once ('inclu/halloffame.inc.php');
include_once ('inclu/fruitdistribution.inc.php');
include_once ('inclu/exp.inc.php');
$row2 = mysql_query("SELECT c1.lernpunkte AS c1lern, c2.lernpunkte AS c2lern, u.round, u.win, u.hp1, u.hp2,c1.hp AS c1hp, c2.hp AS c2hp, c1.mp AS c1mp, c2.mp AS c2mp, u.mp1, u.mp2, c1.id AS c1id, c2.id AS c2id, c1.exp AS c1exp, c2.exp AS c2exp, i1.geld AS i1geld, i2.geld AS i2geld,
i1.id AS i1id, i2.id AS i2id FROM turnier_kampf u LEFT JOIN chars c1 ON(c1.id=u.char1) LEFT JOIN user i1 ON(i1.id=c1.besitzer) LEFT JOIN chars c2 ON(c2.id=u.char2) LEFT JOIN user i2 ON(i2.id=c2.besitzer) WHERE u.art='wochen' ORDER BY u.round ASC");
$x=0;
while($row = mysql_fetch_array($row2)) {
$new_hp = explode(",",$row[hp1]);
$or_hp1 = explode(",",$row[c1hp]);
$new_hp2 = count($new_hp) - 1;
$new_mp = explode(",",$row[mp1]);
$or_mp1 = explode(",",$row[c1mp]);
$new_mp2 = count($new_mp) - 1;
$or_exp1 = explode(",",$row[c1exp]);
$add_exp1 = ($row[round] * 3000);
$new_exp = $or_exp1[0] + ($row[round] * 3000);
$new_lernpunkte1 = $row[c1lern] + (($row[round] * $row[round] / 4));
$new_lernpunkte2 = $row[c2lern] + (($row[round] * $row[round] / 4));
$new_geld1 = $row[i1geld] + ($row[round] * 3000);
$new_geld2 = $row[i2geld] + ($row[round] * 3000);
$trainings_points1 = $row[round] * 1;
$trainings_points2 = $row[round] * 1;
if($row[round] == 6 AND $row[win] == $row[c1id]) {
$new_exp += 15000;
$add_exp1 += 15000;
$new_lernpunkte1 += 15;
$new_geld1 += 20000;
$trainings_points1 += 10;
$char_id1 = $row[win];
}
$new_hp_2 = explode(",",$row[hp2]);
$or_hp1_2 = explode(",",$row[c2hp]);
$new_hp2_2 = count($new_hp_2) - 1;
$new_mp_2 = explode(",",$row[mp2]);
$or_mp1_2 = explode(",",$row[c2mp]);
$new_mp2_2 = count($new_mp_2) - 1;
$or_exp1_2 = explode(",",$row[c2exp]);
$add_exp2 = ($row[round] * 3000);
$new_exp_2 = $or_exp1_2[0] + ($row[round] * 3000);
if($row[round] == 6 AND $row[win] == $row[c2id]) {
$new_exp_2 += 15000;
$add_exp2 += 15000;
$new_lernpunkte2 += 15;
$new_geld2 += 20000;
$trainings_points2 += 10;
$char_id1 = $row[win];
}
$old_win = $row[win];
//mysql_query("UPDATE chars SET status='Frei', training_points=training_points+'$trainings_points1', lernpunkte='$new_lernpunkte1', hp='$new_hp[$new_hp2],$or_hp1[1]', mp='$new_mp[$new_mp2],$or_mp1[1]', exp='$new_exp,$or_exp1[1]' WHERE id='$row[c1id]'");
//mysql_query("UPDATE chars SET status='Frei', training_points=training_points+'$trainings_points2', lernpunkte='$new_lernpunkte2', hp='$new_hp_2[$new_hp2_2],$or_hp1_2[1]', mp='$new_mp_2[$new_mp2_2],$or_mp1_2[1]', exp='$new_exp_2,$or_exp1_2[1]' WHERE id='$row[c2id]'");
// mysql_query("UPDATE chars SET status='Frei', exp='$new_exp,$or_exp1[1]' WHERE id='$row[c1id]'");
// mysql_query("UPDATE chars SET status='Frei', exp='$new_exp_2,$or_exp1_2[1]' WHERE id='$row[c2id]'");
addExpToChar($row['c1id'],$add_exp1);
addExpToChar($row['c2id'],$add_exp2);
mysql_query("UPDATE user SET geld='$new_geld1' WHERE id='$row[i1id]' LIMIT 1");
mysql_query("UPDATE user SET geld='$new_geld2' WHERE id='$row[i2id]' LIMIT 1");
}
$win_user = mysql_Fetch_array(mysql_Query("SELECT name, besitzer FROM chars WHERE id='$old_win' LIMIT 1"));
$win_name = mysql_fetch_Array(mysql_query("SELECT nickname FROM user WHERE id='$win_user[besitzer]' LIMIT 1"));
$win_online = mysql_fetch_array(mysql_query("SELECT turnier FROM online LIMIT 1"));
mysql_query("UPDATE online SET turnier='$win_online[turnier],$win_user[name],$win_name[nickname]' WHERE id='1'");
// insertIntoHallOfFame($title, $charid, $userid);
insertIntoHallOfFame('Wochenturnier', $old_win, $win_user['besitzer']);
mysql_query("UPDATE wochen_markt SET anzahl='1'");
$xiu=5;
if($xiu >= mt_rand(1, 100)) {
////////////////FRUCHT ARRAY
//include "array.php";
distributeFruit($win_user['besitzer']);
}
$sql5 = 'Select count(win), win from turnier_kampf where art = \'wochen\' group by win order by count(win) desc';
$qry5 = mysql_query($sql5);
$rang1 = mysql_fetch_assoc($qry5);
$rang2 = mysql_fetch_assoc($qry5);
$rang3 = mysql_fetch_assoc($qry5);
$rang4 = mysql_fetch_assoc($qry5);
$rang5 = mysql_fetch_assoc($qry5);
$rang6 = mysql_fetch_assoc($qry5);
$rang7 = mysql_fetch_assoc($qry5);
$rang8 = mysql_fetch_assoc($qry5);
$sql = 'select u.clan, c.id, u.id as userid from chars c inner join user u on c.besitzer = u.id where c.id IN ('.$rang1['win'].','.$rang2['win'].','.$rang3['win'].','.$rang4['win'].','.$rang5['win'].','.$rang6['win'].','.$rang7['win'].','.$rang8['win'].')';
echo $sql.'<br>';
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)){
switch($row['id']){
case $rang1['win']:
mysql_query('UPDATE user set pkt = pkt + 50 WHERE id = '.$row['userid']);
insertUserTickerMessage($row['userid'], '50 IP von Wochenturnier Sieg erhalten!');
break;
case $rang2['win']:
mysql_query('UPDATE user set pkt = pkt + 40 WHERE id = '.$row['userid']);
insertUserTickerMessage($row['userid'], '40 IP von Wochenturnier 2.Platz erhalten!');
break;
case $rang3['win']:
case $rang4['win']:
mysql_query('UPDATE user set pkt = pkt + 30 WHERE id = '.$row['userid']);
insertUserTickerMessage($row['userid'], '30 IP von Wochenturnier 3. oder 4. Platz erhalten!');
break;
case $rang5['win']:
case $rang6['win']:
case $rang7['win']:
case $rang8['win']:
mysql_query('UPDATE user set pkt = pkt + 20 WHERE id = '.$row['userid']);
insertUserTickerMessage($row['userid'], '20 IP von Wochenturnier 5-8. Platz erhalten!');
break;
default:
break;
}
}
?>

@ -0,0 +1,19 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$frucht_rate = mt_rand(1,$natur_frucht);
if($frucht_rate == 1) { $frucht_name = 15; } /////////15=ID fuer Sand Frucht
if($frucht_rate == 2) { $frucht_name = 8; } /////////8 = ID FueR Feuer Frucht
if($frucht_rate == 3) { $frucht_name = 23; } /////////23=ID FueR BLITZ FRUCHT
if($frucht_rate == 4) { $frucht_name = 24; } /////////24= ID FueR KaeLTE FRUCHT
if($frucht_rate == 5) { $frucht_name = 6; } /////////6= ID FueR SMOKE FRUCHT
if($frucht_rate == 6) { $frucht_name = 43; } /////////43= ID FueR candy frucht
if($frucht_rate == 7) { $frucht_name = 44; } /////////44= ID FueR fluessigkeits frucht
mysql_query("INSERT wochen_ware SET item='$frucht_name', user='$win_user[besitzer]'");
?>

@ -0,0 +1,93 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
set_time_limit(0);
function rand_array($array)
{
$maxarray=count($array)-1;
mt_srand((double)microtime()*1000000);
for($i=$maxarray; $i>=0; $i--)
{
if($i>0) $zufall=mt_rand(0,$i);
else $zufall=0;
$temp=$array[$i];
$array[$i]=$array[$zufall];
$array[$zufall]=$temp;
$newarray[]=$array[$i];
array_pop($array);
}
return $newarray;
}
include "db.php";
mysql_query("UPDATE online SET clan_tick=clan_tick+1 WHERE id='1' LIMIT 1");
$tick_zahl = mysql_fetch_array(mysql_query("SELECT clan_tick FROM online WHERE id='1' LIMIT 1"));
mysql_query("DELETE FROM clan_kampf");
$kampf_offen = mysql_query("SELECT an, besitzer, charakter1, charakter2, charakter3, charakter4, charakter5, charakter6,
gcharakter1, gcharakter2, gcharakter3, gcharakter4, gcharakter5, gcharakter6 FROM clan_k_list WHERE aktiv='1' AND tick='$tick_zahl[clan_tick]' ");
$char1_list = "0";
$char2_list = "0";
$iw=1;
while($aktive_clans = mysql_fetch_array($kampf_offen)) {
$clan1[] = $aktive_clans[besitzer];
$clan1[] = $aktive_clans[besitzer];
$clan1[] = $aktive_clans[besitzer];
$clan2[] = $aktive_clans[an];
$clan2[] = $aktive_clans[an];
$clan2[] = $aktive_clans[an];
$char1_array[0] = $aktive_clans[charakter1];
$char1_array[1] = $aktive_clans[charakter2];
$char1_array[2] = $aktive_clans[charakter3];
$char1_array[3] = $aktive_clans[charakter4];
$char1_array[4] = $aktive_clans[charakter5];
$char1_array[5] = $aktive_clans[charakter6];
$char2_array[0] = $aktive_clans[gcharakter1];
$char2_array[1] = $aktive_clans[gcharakter2];
$char2_array[2] = $aktive_clans[gcharakter3];
$char2_array[3] = $aktive_clans[gcharakter4];
$char2_array[4] = $aktive_clans[gcharakter5];
$char2_array[5] = $aktive_clans[gcharakter6];
$char1_array = rand_array($char1_array);
$char1_array = array_unique($char1_array);
$char2_array = rand_array($char2_array);
$char2_array = array_unique($char2_array);
$char1_list .= ",".$char1_array[0]."";
$char1_list .= ",".$char1_array[1]."";
$char1_list .= ",".$char1_array[2]."";
$char2_list .= ",".$char2_array[0]."";
$char2_list .= ",".$char2_array[1]."";
$char2_list .= ",".$char2_array[2]."";
}
$char1_list_exploder = explode(",", $char1_list);
$char2_list_exploder = explode(",", $char2_list);
$yt=1;
while($iw < count($char1_list_exploder)) {
$chara_1 = mysql_fetch_array(mysql_query("SELECT * FROM chars WHERE id='$char1_list_exploder[$iw]'"));
$chara_2 = mysql_fetch_array(mysql_query("SELECT * FROM chars WHERE id='$char2_list_exploder[$iw]'"));
$round = 1;
include "clan_kampf.php";
$yt++;
$iw++;
}
mysql_query("DELETE FROM clan_k_list WHERE tick='$tick_zahl[clan_tick]'");
?>

@ -0,0 +1,27 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
if($exp_rows1[level] == 1) { $new_max_exp1 = 5000; }
if($exp_rows1[level] == 2) { $new_max_exp1 = 12000; }
if($exp_rows1[level] == 3) { $new_max_exp1 = 35000; }
if($exp_rows1[level] == 4) { $new_max_exp1 = 100000; }
if($exp_rows2[level] == 1) { $new_max_exp2 = 5000; }
if($exp_rows2[level] == 2) { $new_max_exp2 = 12000; }
if($exp_rows2[level] == 3) { $new_max_exp2 = 35000; }
if($exp_rows2[level] == 4) { $new_max_exp2 = 100000; }
if($EXP_new1+$exp_rows1[min_exp] >= $exp_rows1[max_exp] AND $exp_rows1[level] != 5) {
mysql_query("UPDATE clan SET level=level+1, max_exp='$new_max_exp1', member=member+2 WHERE id='$clan1[$iws]'");
}
if($EXP_new2+$exp_rows2[min_exp] >= $exp_rows2[max_exp] AND $exp_rows2[level] != 5) {
mysql_query("UPDATE clan SET level=level+1, max_exp='$new_max_exp2', member=member+2 WHERE id='$clan2[$iws]'");
}
?>

@ -0,0 +1,214 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$uzze=0;
while($uzze < 10) {
$aktion_AV1[$uzze] = "";
$aktion_AV2[$uzze] = "";
$uzze++;
}
$ssj_tech_1="";
$ssj_tech_2="";
$play1_ausweich="";
$play2_ausweich="";
$k_exp[0] = "";
$X23 = "";
$X13 = "";
$schaden_1="";
$schaden_2="";
################## Kaempfer 1
$k_hp1 = explode(",", $chara_1[hp]);
$k_mp1 = explode(",", $chara_1[mp]);
$k_hp1[0] = $k_hp1[1];
$k_mp1[0] = $k_mp1[1];
$k_starke[0] = $chara_1[starke] + $k_rustung[ru_mal];
$k_speed[0] = $chara_1[speed];
$k_ver[0] = $chara_1[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[0] = $chara_1[ausdauer];
$k_glueck[0] = $chara_1[glueck];
$k_attacke1 = explode(",", $chara_1[attacken]);
$k_hp[0] = round($k_hp1[0]);
$k_mp[0] = round($k_mp1[0]);
$k_aufgabe_a_1 = $k_hp1[1] / 100;
$k_aufgabe[0] = $k_aufgabe_a_1 * $chara_1[aufgeben];
######################################Kaempfer2
$k_hp2 = explode(",", $chara_2[hp]);
$k_mp2 = explode(",", $chara_2[mp]);
$k_hp2[0] = $k_hp2[1];
$k_mp2[0] = $k_mp2[1];
$k_starke[1] = $chara_2[starke] + $k_rustung[ru_mal];
$k_speed[1] = $chara_2[speed];
$k_ver[1] = $chara_2[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[1] = $chara_2[ausdauer];
$k_glueck[1] = $chara_2[glueck];
$k_attacke2 = explode(",", $chara_2[attacken]);
$k_hp[1] = round($k_hp2[0]);
$k_mp[1] = round($k_mp2[0]);
$k_aufgabe_a_2 = $k_hp2[1] / 100;
$k_aufgabe[1] = $k_aufgabe_a_2 * $chara_2[aufgeben];
$x=0;
mysql_query("INSERT clan_kampf SET hp1='$k_hp[0]', hp2='$k_hp[1]', mp1='$k_mp[0]', mp2='$k_mp[1]', schaden1='$schaden_1', schaden2='$schaden_2', attacke1='$technick1[name]', attacke2='$technick2[name]', char1='$chara_1[id]', char2='$chara_2[id]', starke1='$k_starke[0]', starke2='$k_starke[1]', ver1='$k_ver[0]', ver2='$k_ver[1]', speed1='$k_speed[0]', speed2='$k_speed[1]', ausdauer1='$k_ausdauer[0]', ausdauer2='$k_ausdauer[1]'");
while($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$technick1 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$prozent_technik1 = (20*$technick1[aktiv])-20;
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick2 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2[$x]' LIMIT 10"));
$prozent_technik2 = (20*$technick2[aktiv])-20;
$technick2 = mysql_fetch_array(mysql_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 "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_rand($speeds_char1_4,$speeds_char1);
$speed_char2 = mt_rand($speeds_char2_4,$speeds_char2);
include "kampf_include.php";
#####################################KAMPF SYSTEM
include "kampf/kampf_rechnung.php";
$db_query = mysql_fetch_array(mysql_query("SELECT * FROM clan_kampf WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') AND dauer='0' order by id DESC LIMIT 1"));
mysql_query("UPDATE clan_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]' WHERE id='$db_query[id]'");
$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") {
$clan1_win = 1;
$clan2_win = 0;
$k_exp[1] = 0;
$k_geld[1] = 2000;
$k_exp[0] = 0;
$k_geld[0] = 5000;
$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];
$clan1_win= 0;
$clan2_win = 1;
$k_exp[1] = 0;
$k_geld[1] = 5000;
$k_exp[0] = 0;
$k_geld[0] = 2000;
}
if($k_exp[0]) { $s=2; } else { $s++; }
}
$iws = $iw-1;
mysql_query("UPDATE clan_kampf SET clan1_id='$clan1[$iws]', clan2_id='$clan2[$iws]', exp1='$k_exp[0]', win='$sieger', lose='$verlierer', exp2='$k_exp[1]', geld1='$k_geld[0]', geld2='$k_geld[1]', clan1_win='$clan1_win', clan2_win='$clan2_win' WHERE id='$db_query[id]'");
if($yt == 3) {
$yt=0;
$win_rows1 = mysql_num_rows(mysql_query("SELECT id FROM clan_kampf WHERE clan1_win='1' AND clan1_id='$clan1[$iws]' LIMIT 2"));
$win_rows2 = mysql_num_rows(mysql_query("SELECT id FROM clan_kampf WHERE clan2_win='1' AND clan2_id='$clan2[$iws]' LIMIT 2"));
if($win_rows1 > $win_rows2) {
////CLAN 1 WINS
$exp_rows1 = mysql_fetch_array(mysql_query("SELECT siege, level, min_exp, max_exp FROM clan WHERE id='$clan1[$iws]' LIMIT 1"));
$exp_rows2 = mysql_fetch_array(mysql_query("SELECT siege, level, min_exp, max_exp FROM clan WHERE id='$clan2[$iws]' LIMIT 1"));
$EXP_new1 = ($exp_rows2[siege]+10) * 30;
$EXP_new2 = ($exp_rows1[siege]+10) * 15;
include "clan_exp.php";
mysql_query("UPDATE clan SET geld=geld+'5000', siege=siege+1, min_exp=min_exp+'$EXP_new1' WHERE id='$clan1[$iws]'");
mysql_query("UPDATE clan SET geld=geld+'2000', niederlagen=niederlagen+1, min_exp=min_exp+'$EXP_new2' WHERE id='$clan2[$iws]'");
} else {
$exp_rows1 = mysql_fetch_array(mysql_query("SELECT siege, level, min_exp, max_exp FROM clan WHERE id='$clan1[$iws]' LIMIT 1"));
$exp_rows2 = mysql_fetch_array(mysql_query("SELECT siege, level, min_exp, max_exp FROM clan WHERE id='$clan2[$iws]' LIMIT 1"));
$EXP_new2 = ($exp_rows1[siege]+10) * 30;
$EXP_new1 = ($exp_rows2[siege]+10) * 15;
include "clan_exp.php";
////CLAN 2 WINS
mysql_query("UPDATE clan SET geld=geld+'2000', niederlagen=niederlagen+1, min_exp=min_exp+'$EXP_new1' WHERE id='$clan1[$iws]'");
mysql_query("UPDATE clan SET geld=geld+'5000', siege=siege+1, min_exp=min_exp+'$EXP_new2' WHERE id='$clan2[$iws]'");
}
}
?>

@ -0,0 +1,225 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
/* Funktionen fuer die Clanfights */
function getStatus($charid, $buffer_enabled = true) {
// Prioritaet, erst Turnier, dann Schatzsuche, dann Kampf
if ($GLOBALS['char_status'][$charid] != null && $buffer_enabled) {
return $GLOBALS['char_status'][$charid];
}
$sql = 'SELECT count(*) as anzahl FROM turnier_kampf t where art != \'gross\' and (win = ' . $charid . ' or lose = ' . $charid . ') and dauer > now()';
$row = mysql_fetch_assoc(mysql_query($sql));
if ($row['anzahl'] > 0) {
$GLOBALS['char_status'][$charid] = 'Turnier';
return 'Turnier';
}
$sql = 'SELECT count(*) as anzahl from quests where charid = ' . $charid;
$row = mysql_fetch_assoc(mysql_query($sql));
if ($row['anzahl'] > 0) {
$GLOBALS['char_status'][$charid] = 'Schatz Suche';
return 'Schatz Suche';
}
$sql = 'SELECT count(*) as anzahl from kampf where db_satz = ' . $charid;
$row = mysql_fetch_assoc(mysql_query($sql));
if ($row['anzahl'] > 0) {
$GLOBALS['char_status'][$charid] = 'Kampf';
return 'Kampf';
}
$sql = 'SELECT count(*) as anzahl FROM kampf_list where charakter = ' . $charid;
$row = mysql_fetch_assoc(mysql_query($sql));
if ($row['anzahl'] > 0) {
$GLOBALS['char_status'][$charid] = 'Kampf erstellt';
return 'Kampf erstellt';
}
$sql = 'SELECT count(*) as anzahl FROM turnier1 where charakter = ' . $charid;
$row = mysql_fetch_assoc(mysql_query($sql));
if ($row['anzahl'] > 0) {
$GLOBALS['char_status'][$charid] = 'Angemeldet';
return 'Angemeldet';
}
$GLOBALS['char_status'][$charid] = 'Frei';
return 'Frei';
}
function getPicture($char){
// Sichergehen, dass Char geladen wurde
if($char['bild'] == null || $char['bild'] == ''){
return 'design/bilder/avatare/noavart.gif';
}
return $char['bild'];
}
function getChar2($charid) {
// Fehlerkontrolle
if(!is_numeric($charid)){
return null;
} else {
$char = mysql_fetch_assoc(mysql_query('Select * from chars where id = '.$charid));
if(!$char){return null;}
// Speichere in $char['stauts'] den aktuellen Status des Chars (buffer-Strategie ist hierbei die selbe)
$char['status'] = getStatus($char['id'],$buffer_enabled);
$char['bild'] = getPicture($char);
}
return $char;
}
function starteClanFight($chara_1, $chara_2, $clanfight_id, $runde, $kampf){
global $sieger, $verlierer;
include 'kampf_clan.php';
}
function starteClanFight_survival($chara_1, $fighter_a, $chara_2, $fighter_b, $clanfight_id, $runde, $kampf){
global $sieger, $verlierer, $fighter_team_a_array, $fighter_team_b_array;
include 'kampf_clan1.php';
}
function clanFightExecute($id) {
$pkt_a_satz= 0;
$pkt_b_satz= 0;
$pkt_runde_a= 0;
$pkt_runde_b= 0;
$rundenzaehler= 1;
$kampfzaehler= 1;
$clanfight_daten= mysql_fetch_assoc(mysql_query('SELECT fighter, gfighter, numberoffighter FROM clan_fight_list WHERE id='.$id.' LIMIT 1'));
$fighter_a_array= explode(",",$clanfight_daten['fighter']);
$fighter_b_array= explode(",",$clanfight_daten['gfighter']);
for ($x=1;;$x++) {
/*if ($rundenzaehler == 7) {
break;
}*/
$fighter_a= mt_rand(0, count($fighter_a_array)-1);
$fighter_b= mt_rand(0, count($fighter_b_array)-1);
$char_a= getChar2($fighter_a_array[$fighter_a]);
$char_b= getChar2($fighter_b_array[$fighter_b]);
starteClanFight($char_a, $char_b, $id, $rundenzaehler, $kampfzaehler);
$kampfzaehler++;
if ($fighter_a_array[$fighter_a] == $sieger) {
$pkt_a_satz++;
} else {
$pkt_b_satz++;
}
unset($fighter_a_array[$fighter_a]);
unset($fighter_b_array[$fighter_b]);
sort($fighter_a_array);
sort($fighter_b_array);
#if ($pkt_a_satz == 3 OR $pkt_b_satz == 3) {
if ($pkt_a_satz + $pkt_b_satz == $clanfight_daten['numberoffighter']) {
if ($pkt_a_satz > $pkt_b_satz) {
$pkt_runde_a++;
} elseif ($pkt_a_satz < $pkt_b_satz) {
$pkt_runde_b++;
}
$fighter_a_array= explode(",",$clanfight_daten['fighter']);
$fighter_b_array= explode(",",$clanfight_daten['gfighter']);
$rundenzaehler++;
$kampfzaehler= 1;
$pkt_a_satz= 0;
$pkt_b_satz= 0;
if ($pkt_runde_a + $pkt_runde_b == 6) {
break;
}
}
}
}
function selectFighterOfTeams($fighter_team_a_array,$fighter_team_b_array,$sieger='') {
global $fighter_a, $fighter_b, $sieger;
if (empty($sieger)) {
$fighter_a= mt_rand(0, count($fighter_team_a_array)-1);
$fighter_b= mt_rand(0, count($fighter_team_b_array)-1);
} else {
for ($y=0;$y<count($fighter_team_a_array);$y++) {
if ($fighter_team_a_array[$y][id] == $sieger) {
$siegerteam= 'a';
}
}
if ($siegerteam == 'a') {
for ($y=0;$y<count($fighter_team_a_array);$y++) {
if ($fighter_team_a_array[$y][id] == $sieger) {
$fighter_a= $y;
$fighter_b= mt_rand(0, count($fighter_team_b_array)-1);
}
}
} else {
for ($y=0;$y<count($fighter_team_b_array);$y++) {
if ($fighter_team_b_array[$y][id] == $sieger) {
$fighter_b= $y;
$fighter_a= mt_rand(0, count($fighter_team_a_array)-1);
}
}
}
}
}
function clanFightExecute_survival($id) {
global $fighter_a, $fighter_b, $sieger, $fighter_team_a_array, $fighter_team_b_array;
$pkt_a_satz= 0;
$pkt_b_satz= 0;
$kampfzaehler= 1;
$rundenzaehler= 1;
$clanfight_daten= mysql_fetch_assoc(mysql_query('SELECT fighter, gfighter, numberoffighter FROM clan_fight_list WHERE id='.$id.' LIMIT 1'));
$fighter_a_array= explode(",",$clanfight_daten['fighter']);
$fighter_b_array= explode(",",$clanfight_daten['gfighter']);
for ($x=0;$x<count($fighter_a_array);$x++) {
$fighter_team_a_array[$x]= getChar2($fighter_a_array[$x]);
}
for ($x=0;$x<count($fighter_b_array);$x++) {
$fighter_team_b_array[$x]= getChar2($fighter_b_array[$x]);
}
for ($x=1;;$x++) {
selectFighterOfTeams($fighter_team_a_array,$fighter_team_b_array,$sieger);
starteClanFight_survival($fighter_team_a_array[$fighter_a], $fighter_a, $fighter_team_b_array[$fighter_b], $fighter_b, $id, $rundenzaehler, $kampfzaehler);
$kampfzaehler++;
if ($fighter_team_a_array[$fighter_a][id] == $sieger) {
/* Status des Fighters aus Teams B auf "besiegt" setzen */
unset($fighter_team_b_array[$fighter_b]);
$fighter_team_b_array= array_values($fighter_team_b_array);
/* Die Statuswerte St<53>rke, Verteidigung und Geschwindigkeit um 10% verringern */
$fighter_team_a_array[$fighter_a][starke]= round($fighter_team_a_array[$fighter_a][starke]*0.9);
$fighter_team_a_array[$fighter_a][speed]= round($fighter_team_a_array[$fighter_a][speed]*0.9);
$fighter_team_a_array[$fighter_a][verteidigung]= round($fighter_team_a_array[$fighter_a][verteidigung]*0.9);
/* Punkt f<>r Team A hinzuf<75>gen */
$pkt_a_satz++;
} else {
/* Status des Fighters aus Teams A auf "besiegt" setzen */
unset($fighter_team_a_array[$fighter_a]);
$fighter_team_a_array= array_values($fighter_team_a_array);
/* Die Statuswerte St<53>rke, Verteidigung und Geschwindigkeit um 10% verringern */
$fighter_team_b_array[$fighter_b][starke]= round($fighter_team_b_array[$fighter_b][starke]*0.9);
$fighter_team_b_array[$fighter_b][speed]= round($fighter_team_b_array[$fighter_b][speed]*0.9);
$fighter_team_b_array[$fighter_b][verteidigung]= round($fighter_team_b_array[$fighter_b][verteidigung]*0.9);
/* Punkt f<>r Team B hinzuf<75>gen */
$pkt_b_satz++;
}
if (count($fighter_team_a_array) == 0 OR count($fighter_team_b_array) == 0) {
break;
}
}
}
?>

@ -0,0 +1,29 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
# Um die Datenbank nutzen zu koennen muss eine db.php erstellt werden, bitte diese nicht in die Versionskontrolle einfügen!!
#####Online Bitte für localhost eintragen!!
$db_host = "Server";
$db_user ="username";
$db_passwort ="password";
$db_name = "databasename";
$conn = mysql_connect($db_host, $db_user, $db_passwort);
$db = mysql_select_db($db_name, $conn);
//////////////////Animegame NPC
$bebi = "2";
$mihawk = "4";
$brolly = "1";
$flamingo = "3";
?>

@ -0,0 +1,162 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include "db.php";
$mak_time = time();
$z_time = time() - 86400;
$chars_k = mysql_query("SELECT charakter FROM kampf_list WHERE zeit < '$mak_time' and rasse != 'NPC'");
while ($row4 = mysql_Fetch_array($chars_k)) {
mysql_query("UPDATE chars SET status='Frei' WHERE id='$row4[charakter]'");
}
mysql_query("DELETE FROM kampf_list WHERE zeit < '$mak_time' and rasse != 'NPC'");
//mysql_query("DELETE FROM user WHERE aktiv = 'nein' AND code_zeit < '$z_time'");
mysql_query("DELETE FROM top_kampf");
$platz1 = mysql_query("SELECT id, besitzer FROM chars WHERE level<'150' order by preis DESC LIMIT 3");
$x = 0;
$mac_geld = 3000;
while ($row = mysql_fetch_array($platz1)) {
$user = mysql_fetch_array(mysql_query("SELECT geld FROM user WHERE id='$row[besitzer]' LIMIT 3"));
$new_geld = $user[geld] + $mac_geld;
mysql_query("UPDATE user SET geld='$new_geld' WHERE id='$row[besitzer]'");
$mac_geld = $mac_geld -1000;
$x++;
}
$row = "";
$platz1 = mysql_query("SELECT id, anzahl, preis FROM item");
$x = 0;
while ($row = mysql_fetch_array($platz1)) {
if ($row[preis] >= 200000) {
$anzahl = 1;
}
if ($row[preis] < 200000) {
$anzahl = 5;
}
if ($row[preis] < 100000) {
$anzahl = 10;
}
if ($row[preis] < 50000) {
$anzahl = 20;
}
if ($row[preis] < 30000) {
$anzahl = 50;
}
if ($row[preis] < 20000) {
$anzahl = 60;
}
if ($row[preis] < 15000) {
$anzahl = 75;
}
if ($row[preis] < 10000) {
$anzahl = 100;
}
if ($row[preis] < 7000) {
$anzahl = 150;
}
if ($row[preis] < 5000) {
$anzahl = 200;
}
if ($row[preis] < 2000) {
$anzahl = 500;
}
if ($row[preis] < 1000) {
$anzahl = 1000;
}
if ($row[preis] < 500) {
$anzahl = 1500;
}
if ($row[preis] < 80) {
$anzahl = 5000;
}
mysql_query("UPDATE item SET anzahl='$anzahl' WHERE id='$row[id]'");
$x++;
}
$row = "";
mysql_query("DELETE FROM liga_kampf");
mysql_query("DELETE FROM wanted_kampf");
mysql_query("UPDATE chars SET status='Frei' WHERE status='Tod'");
mysql_query("UPDATE user SET pw_fight='4'");
//mysql_query("UPDATE user SET ks_points=ks_points+'1' WHERE ks_points < 30");
//////////////////////////////////NPCS!!!!
$wahl = "starke+verteidigung+speed+ausdauer+glueck";
$row = mysql_fetch_array(mysql_query("SELECT name, level, starke, speed, verteidigung, ausdauer, glueck, hp, mp FROM chars WHERE level<'150' AND rasse!='NPC' ORDER BY ($wahl) DESC LIMIT 1"));
$new_hp = explode(",", $row[hp]);
$new_mp = explode(",", $row[mp]);
$beste_mp = (($new_mp[1] / 100) * mt_rand(75, 130)) + 1000;
$beste_hp = (($new_hp[1] / 100) * mt_rand(80, 150)) + 3000;
$beste_starke = ($row[starke] / 100) * mt_rand(75, 130);
$beste_speed = ($row[speed] / 100) * mt_rand(75, 110);
$beste_verteidigung = ($row[verteidigung] / 100) * mt_rand(75, 110);
$beste_ausdauer = ($row[ausdauer] / 100) * mt_rand(75, 130);
$beste_glueck = ($row[glueck] / 100) * mt_rand(75, 130);
mysql_query("UPDATE chars SET hp='$beste_hp,$beste_hp', mp='$beste_mp,$beste_mp', starke='$beste_starke', speed='$beste_speed', verteidigung='$beste_verteidigung', ausdauer='$beste_ausdauer', glueck='$beste_glueck' WHERE id='$brolly' LIMIT 1");
//////////////////////////////////NPCS!!!!
$row = mysql_fetch_array(mysql_query("SELECT name, level, starke, speed, verteidigung, ausdauer, glueck, hp, mp FROM chars WHERE level<'150' AND rasse!='NPC' ORDER BY starke DESC LIMIT 1"));
$new_hp = explode(",", $row[hp]);
$new_mp = explode(",", $row[mp]);
$beste_mp = (($new_mp[1] / 100) * mt_rand(100, 150)) + 1000;
$beste_hp = (($new_hp[1] / 100) * mt_rand(120, 220)) + 3000;
$beste_starke = ($row[starke] / 100) * mt_rand(60, 110);
$beste_speed = ($row[speed] / 100) * mt_rand(60, 100);
$beste_verteidigung = ($row[verteidigung] / 100) * mt_rand(100, 150);
$beste_ausdauer = ($row[ausdauer] / 100) * mt_rand(100, 200);
$beste_glueck = ($row[glueck] / 100) * mt_rand(80, 100);
mysql_query("UPDATE chars SET hp='$beste_hp,$beste_hp', mp='$beste_mp,$beste_mp', starke='$beste_starke', speed='$beste_speed', verteidigung='$beste_verteidigung', ausdauer='$beste_ausdauer', glueck='$beste_glueck' WHERE id='$bebi' LIMIT 1");
//////////////////NPC
$wahl = "starke+verteidigung+speed+ausdauer+glueck";
$row = mysql_fetch_array(mysql_query("SELECT hp, mp, name, level, starke, speed, verteidigung, ausdauer, glueck FROM chars WHERE level<'150' AND rasse!='NPC' ORDER BY level DESC LIMIT 1"));
$new_hp = explode(",", $row[hp]);
$new_mp = explode(",", $row[mp]);
$beste_mp = (($new_mp[1] / 100) * mt_rand(150, 200)) + 1000;
$beste_hp = (($new_hp[1] / 100) * mt_rand(100, 200)) + 3000;
$beste_starke = ($row[starke] / 100) * mt_rand(75, 120);
$beste_speed = ($row[speed] / 100) * mt_rand(75, 120);
$beste_verteidigung = ($row[verteidigung] / 100) * mt_rand(80, 100);
$beste_ausdauer = ($row[ausdauer] / 100) * mt_rand(60, 120);
$beste_glueck = ($row[glueck] / 100) * mt_rand(60, 200);
mysql_query("UPDATE chars SET hp='$beste_hp,$beste_hp', mp='$beste_mp,$beste_mp', starke='$beste_starke', speed='$beste_speed', verteidigung='$beste_verteidigung', ausdauer='$beste_ausdauer', glueck='$beste_glueck' WHERE id='$flamingo' LIMIT 1");
//////////////////NPC
$row = mysql_fetch_array(mysql_query("SELECT hp, mp, name, level, starke, speed, verteidigung, ausdauer, glueck FROM chars WHERE level<'150' AND rasse!='NPC' ORDER BY speed DESC LIMIT 1"));
$new_hp = explode(",", $row[hp]);
$new_mp = explode(",", $row[mp]);
$beste_mp = (($new_mp[1] / 100) * mt_rand(80, 110)) + 1000;
$beste_hp = (($new_hp[1] / 100) * mt_rand(80, 250)) + 3000;
$beste_starke = ($row[starke] / 100) * mt_rand(80, 120);
$beste_speed = ($row[speed] / 100) * mt_rand(80, 130);
$beste_verteidigung = ($row[verteidigung] / 100) * mt_rand(80, 120);
$beste_ausdauer = ($row[ausdauer] / 100) * mt_rand(80, 150);
$beste_glueck = ($row[glueck] / 100) * mt_rand(90, 100);
mysql_query("UPDATE chars SET hp='$beste_hp,$beste_hp', mp='$beste_mp,$beste_mp', starke='$beste_starke', speed='$beste_speed', verteidigung='$beste_verteidigung', ausdauer='$beste_ausdauer', glueck='$beste_glueck' WHERE id='$mihawk' LIMIT 1");
?>

@ -0,0 +1,48 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAIOKEN SPIELER 1
if($technick1[type] == "frucht") {
$frucht_stats1 = mysql_fetch_array(mysql_query("SELECT starke, ver, speed, ausdauer, glueck FROM wochen_markt WHERE item='$chara_1[frucht]' LIMIT 1"));
$k_mp[0] = $k_mp[0] - $technick1[mp];
$k_hp[0] = $k_hp[0] - $technick1[hp];
if($k_mp[0] < 0) {
$schaden_1 = "Technik fehlgeschlagen";
$aktion_AV1[$x] = "nein";
$k_mp[0] = 0;
} else {
$schaden_1 = "Zauber Frucht";
$k_ausdauer[0] = $k_ausdauer[0] + $frucht_stats1[ausdauer];
$k_starke[0] = $k_starke[0] + $frucht_stats1[starke];
$k_speed[0] = $k_speed[0] + $frucht_stats1[speed];
$k_ver[0] = $k_ver[0] + $frucht_stats1[ver];
$k_glueck[0] = $k_glueck[0] + $frucht_stats1[glueck];
$aktion_AV1[$x] = "nein";
}}
####################KAIOKEN SPIELER 2
if($technick2[type] == "frucht") {
$frucht_stats2 = mysql_fetch_array(mysql_query("SELECT starke, ver, speed, ausdauer, glueck FROM wochen_markt WHERE item='$chara_2[frucht]' LIMIT 1"));
$k_mp[1] = $k_mp[1] - $technick2[mp];
$k_hp[1] = $k_hp[1] - $technick2[hp];
if($k_mp[1] < 0) {
$schaden_2 = "Technik fehlgeschlagen";
$aktion_AV2[$x] = "nein";
$k_mp[1] = 0;
} else {
$schaden_2 = "Zauber Frucht";
$k_ausdauer[1] = $k_ausdauer[1] + $frucht_stats2[ausdauer];
$k_starke[1] = $k_starke[1] + $frucht_stats2[starke];
$k_speed[1] = $k_speed[1] + $frucht_stats2[speed];
$k_ver[1] = $k_ver[1] + $frucht_stats2[ver];
$k_glueck[1] = $k_glueck[1] + $frucht_stats2[glueck];
$aktion_AV2[$x] = "nein";
}}
?>

@ -0,0 +1,215 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
/************************************************************************
* Dieses Tunier soll die verschiedenen Turnierberechnungsseiten
* ersetzen. Durch Übergabe der Parameter beim starten des Cronjobs
* lässt sich das Turnier konfigurieren.
* @author Hecht
*
* TODO: Gruppenphase implementieren
* TODO: Parameter (bis auf Name) sollten aus Datenbank geladen werden
* damit die GM direkt einfluss darauf nehmen können
* TODO: Die Funktion turnierfight nutzt die komplexe Datei
* "turnier_kampf.php". Es wäre sinnvoll dies zu ersetzen.
* TODO: Die Datenbankstruktur ist mehr als grauenvoll. Umsetzung wie
* bei der Schatzsuche gewünscht ^^
************************************************************************/
// Put args into get
// Neccessary for cronjob execution
if ($argv) {
foreach ($argv as $k=>$v){
if ($k==0) continue;
$it = explode("=",$argv[$k]);
// echo $it[0].'='.$it[1].'('.$argv[$k].')'."\n";
if (isset($it[1])) $_GET[$it[0]] = $it[1];
}
}
//set_time_limit(0);
include "db.php";
include "inclu/char.inc.php";
$name = $_GET['name']; // Name des Turniers (benötigt)
$anzahl = $_GET['anzahl']; // Anzahl (benötigt)
if(is_null($name)){
echo 'Kein Name für Turnier angegeben!<br>';
exit;
}
// Auswahlkriterien
$fusion = $_GET['fusion']; // 1 für erlaubt
$special = $_GET['special']; // Spezialchars 1 für erlaubt
$minlevel = $_GET['minlevel']; // selbsterklärend
$maxlevel = $_GET['maxlevel']; // selbsterklärend
$gain = $_GET['gain']; // ('Anmeldung', 'PL', 'Level')
$randomize = $_GET['randomize']; // 1 für nach jeder Runde die reihenfolge setzen
// Turniereigenschaften
$gruppenphase = $_GET['gruppenphase']; // Flag für Gruppenphase (1 für aktiv)
$grp_size = $_GET['grp_size']; // Anzahl der Teilnehmer in einer Gruppe
$grp_proceed = $_GET['grp_proceed']; // Anzahl der Teilnehmer die Gruppenphase verlassen (1 nur Sieger, 2 Sieger und Zweiter ..)
/**
* Berechnet ein Kampf zwischen zwei chars
* @param int $char1_id die id des ersten chars
* @param int $char2_id die id des zweiten chars
* @param String $art der name des turniers (für die sql-Anfrage wichtig)
* @param int $round rundennummer (0,1,2...)
* @return int die id des siegenden chars
*/
function turnierfight($char1_id, $char2_id, $art_1, $round){
// Gotta replace this later -.-
echo 'Fight between '.$char1_id.' und '.$char2_id;
$chara_1 = getChar($char1_id); // ohne Equip für Turniere!!
$chara_2 = getChar($char2_id); // ohne Equip für Turniere!!
//$chara_1 = getCharWithBuffs($char1_id); // Equip für Turniere!!
//$chara_2 = getCharWithBuffs($char2_id); // Equip für Turniere!!
include "turnier_kampf.php";
echo ', Sieger '.$sieger.'<br>';
// in $sieger steht die id des gewinners
if($char1_id == $sieger){
return $char1_id;
}
return $char2_id;
}
// Auswerten der Eingaben
if($gruppenphase == 1){
if(is_null($grp_size)){ // Wenn es nicht gesetzt ist
$grp_size = 4; // Default: 4 in einer Gruppe
}
if(is_null($grp_proceed)){ // Wenn es nicht gesetzt ist
$grp_proceed = 1; // Default: Nur Sieger kommt weiter
}
// Berechne ob die Angegebene Anzahl passt (Anzahl muss durch grp_size teilbar und Ergebnis eine 2er Potenz sein)
$count_groups = round($anzahl / $grp_size);
$loga = log($count_groups * $grp_proceed, 2) ;
if($anzahl % $grp_size != 0 || $loga != round($loga)){
echo 'Parameter der Gruppenphasen sind ungültig!<br>';
}
echo 'Gruppenphasen werden leider noch nicht unterstützt<br>';
exit;
} else{
$loga = log($anzahl, 2) ;
if($loga != round($loga)){
echo 'Die Anzahl der Teilnehmer ist ungültig (Muss eine 2er Potenz sein)!<br>';
exit;
}
}
mysql_query('DELETE FROM turnier_kampf WHERE art=\''.$name.'\'');
// Es sollen keine NPC mitmachen :) und nicht die Spezial Wanted NPCs
$auswahl_kriteria = ' rasse != \'NPC\' ';
$auswahl_kriteria .= ' AND besitzer!=2 ';
if($fusion != 1){
$auswahl_kriteria .= ' AND fusion=\'nein\' ';
}
if($special != 1){
$auswahl_kriteria .= ' AND char_type = \'\' ';
}
if(is_numeric($minlevel)){
$auswahl_kriteria .= ' AND level >= '.$minlevel.' ';
}
if(is_numeric($maxlevel)){
$auswahl_kriteria .= ' AND level <= '.$maxlevel.' ';
}
// Erstma checken ob es überhaupt genug chars gibt ;)
$sql = 'SELECT count(*) as anzahl from chars where '.$auswahl_kriteria;
echo $sql.'<br>';
$qry = mysql_query($sql);
$row = mysql_fetch_assoc($qry);
if($row['anzahl'] < $anzahl){
echo $name.' konnte nicht gestartet werden, da es nur '.$row['anzahl'].' von '.$anzahl.' nötigen Chars gibt!<br>';
exit;
}
// Erstma nur die id auslesen (danach wird eh nochmal gemischt ;))
$cid = array();
if($gain == 'Anmeldung'){
$sql = 'SELECT charakter as id FROM turnier1 t WHERE art = \''.$name.'\'';
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)){
$cid[] = $row['id'];
}
mysql_query('DELETE FROM turnier1 WHERE art = \''.$name.'\''); // Lösche die Anmeldungsliste
if(count($cid) > 0){
$sql = 'SELECT id FROM chars where '.$auswahl_kriteria.' and id NOT IN('.join(',',$cid).') ORDER BY RAND()';
} else {
// Turnier is voll!
$sql = 'SELECT id FROM chars where '.$auswahl_kriteria.' ORDER BY RAND()';
}
} else if($gain == 'PL'){
// Die Buffs werden nicht zur PL gezählt ;)
$sql = 'SELECT id FROM chars where '.$auswahl_kriteria.' ORDER BY starke+verteidigung+speed+ausdauer+glueck desc';
} else if($gain == 'Level'){
$sql = 'SELECT id FROM chars where '.$auswahl_kriteria.' ORDER BY level desc';
} else{
echo 'Parameter gain war weder Anmeldung, PL noch Level<br>';
exit;
}
echo $sql.'<br>';
$qry = mysql_query($sql);
while(($row = mysql_fetch_assoc($qry)) && count($cid) < $anzahl){
// echo $row['id'].'<br>';
$cid[] = $row['id'];
}
//print_r($cid);
$sql = 'SELECT id FROM chars WHERE id IN('.join(', ',$cid).') ORDER BY RAND()'; // Mischen der Teilnehmer
//echo $sql.'<br>';
$qry = mysql_query($sql);
$char_array = array();
while($row = mysql_fetch_assoc($qry)){
$char_array[] = $row['id'];
}
// So alle chars sind jetzt in den Arrays
$round = 1;
//print_r($chars);
echo '<br>';
// Hier Gruppenphase berechnen und die Chars für die Endrunde in $chars speichern
// Beginn der Endrunde
while(count($char_array) > 1){ // Solange bis nur ein Char übrig bleibt
$n_chars = array();
for($i=0;$i<count($char_array);$i+=2){
// echo 'Berechne fight zwischen '.$char_array[$i].'und '.$char_array[$i+1].'('.$i.'/'.count($char_array).')<br>';
$n_chars[] = turnierfight($char_array[$i], $char_array[$i+1], $name, $round);
}
// echo 'nxt round<br>';
$round++;
if($randomize == 1) {
$char_array = shuffle($n_chars);
} else {
$char_array = $n_chars;
}
}
?>

@ -0,0 +1,203 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include "db.php";
include_once ('inclu/messagefunctions.inc.php');
include_once ('inclu/halloffame.inc.php');
include_once ('inclu/fruitdistribution.inc.php');
include_once ('inclu/exp.inc.php');
$sql1 = 'select distinct(char1) from turnier_kampf where art = \'gross\' order by char1';
$sql2 = 'select distinct(char2) from turnier_kampf where art = \'gross\' order by char1';
$charids = array();
$qry1 = mysql_query($sql1);
while($row = mysql_fetch_assoc($qry1)){
$charids[] = $row['char1'];
}
$qry2 = mysql_query($sql2);
while($row = mysql_fetch_assoc($qry2)){
$charids[] = $row['char2'];
}
$sql3 = 'Select avg(level) as dlevel from chars where id in ('.join(',', $charids).')';
$row = mysql_fetch_assoc(mysql_query($sql3));
$dlevel = ceil($row['dlevel']);
echo 'Das Durchschnittslevel betraegt: '.$dlevel.'<br>';
$row2 = mysql_query("SELECT c1.lernpunkte AS c1lern, c2.lernpunkte AS c2lern, u.round, u.win, u.hp1, u.hp2,c1.hp AS c1hp, c2.hp AS c2hp, c1.mp AS c1mp, c2.mp AS c2mp, u.mp1, u.mp2, c1.id AS c1id, c2.id AS c2id, c1.exp AS c1exp, c2.exp AS c2exp, i1.geld AS i1geld, i2.geld AS i2geld,
i1.id AS i1id, i2.id AS i2id FROM turnier_kampf u LEFT JOIN chars c1 ON(c1.id=u.char1) LEFT JOIN user i1 ON(i1.id=c1.besitzer) LEFT JOIN chars c2 ON(c2.id=u.char2) LEFT JOIN user i2 ON(i2.id=c2.besitzer) WHERE u.art='gross' ORDER BY u.round ASC");
$x=0;
while($row = mysql_fetch_array($row2)) {
$new_hp = explode(",",$row[hp1]);
$or_hp1 = explode(",",$row[c1hp]);
$new_hp2 = count($new_hp) - 1;
$new_mp = explode(",",$row[mp1]);
$or_mp1 = explode(",",$row[c1mp]);
$new_mp2 = count($new_mp) - 1;
$or_exp1 = explode(",",$row[c1exp]);
$new_exp = $or_exp1[0] + ($row[round] * 10000);
$add_exp1 = ($row[round] * 10000);
$new_lernpunkte1 = $row[c1lern] + (($row[round] * $row[round] / 2));
$new_lernpunkte2 = $row[c2lern] + (($row[round] * $row[round] / 2));
$new_geld1 = $row[i1geld] + ($row[round] * 10000);
$new_geld2 = $row[i2geld] + ($row[round] * 10000);
$trainings_points1 = $row[round] * 2;
$trainings_points2 = $row[round] * 2;
if($row[round] == 9 AND $row[win] == $row[c1id]) {
$new_exp += 250000;
$add_exp1 += 250000;
$new_lernpunkte1 += 30;
$trainings_points1 += 50;
$new_geld1 += 2000000;
}
$new_hp_2 = explode(",",$row[hp2]);
$or_hp1_2 = explode(",",$row[c2hp]);
$new_hp2_2 = count($new_hp_2) - 1;
$new_mp_2 = explode(",",$row[mp2]);
$or_mp1_2 = explode(",",$row[c2mp]);
$new_mp2_2 = count($new_mp_2) - 1;
$or_exp1_2 = explode(",",$row[c2exp]);
$new_exp_2 = $or_exp1_2[0] + ($row[round] * 3000);
$add_exp2 = ($row[round] * 10000);
if($row[round] == 9 AND $row[win] == $row[c2id]) {
$new_exp_2 += 250000;
$add_exp2 += 250000;
$new_lernpunkte2 += 30;
$trainings_points2 += 50;
$new_geld2 += 2000000;
}
$old_win = $row[win];
//mysql_query("UPDATE chars SET training_points=training_points+'$trainings_points1', lernpunkte='$new_lernpunkte1', hp='$new_hp[$new_hp2],$or_hp1[1]', mp='$new_mp[$new_mp2],$or_mp1[1]', exp='$new_exp,$or_exp1[1]' WHERE id='$row[c1id]'");
//mysql_query("UPDATE chars SET training_points=training_points+'$trainings_points2',lernpunkte='$new_lernpunkte2', hp='$new_hp_2[$new_hp2_2],$or_hp1_2[1]', mp='$new_mp_2[$new_mp2_2],$or_mp1_2[1]', exp='$new_exp_2,$or_exp1_2[1]' WHERE id='$row[c2id]'");
//mysql_query("UPDATE chars SET exp='$new_exp,$or_exp1[1]' WHERE id='$row[c1id]'");
//mysql_query("UPDATE chars SET exp='$new_exp_2,$or_exp1_2[1]' WHERE id='$row[c2id]'");
addExpToChar($row['c1id'],$add_exp1);
addExpToChar($row['c2id'],$add_exp2);
mysql_query("UPDATE user SET geld='$new_geld1' WHERE id='$row[i1id]' LIMIT 1");
mysql_query("UPDATE user SET geld='$new_geld2' WHERE id='$row[i2id]' LIMIT 1");
}
$win_user = mysql_Fetch_array(mysql_Query("SELECT id, name, besitzer FROM chars WHERE id='$old_win' LIMIT 1"));
$win_name = mysql_fetch_Array(mysql_query("SELECT id, nickname, clan FROM user WHERE id='$win_user[besitzer]' LIMIT 1"));
$win_online = mysql_fetch_array(mysql_query("SELECT turnier_gross FROM online LIMIT 1"));
mysql_query("UPDATE online SET turnier_gross='$win_online[turnier_gross],$win_user[name],$win_name[nickname]' WHERE id='1'");
// insertIntoHallOfFame($title, $charid, $userid);
insertIntoHallOfFame('Weltturnier', $old_win, $win_user['besitzer']);
$natur_frucht = mysql_num_rows(mysql_query("SELECT id FROM wochen_markt WHERE art='natur'")); ///wieviel TF gibt es?.
////////////////FRUCHT ARRAY
//include "array.php";
distributeFruit($win_user['besitzer']);
// Durchschnittslevel
$sql5 = 'Select count(win), win from turnier_kampf where art = \'gross\' group by win order by count(win) desc';
$qry5 = mysql_query($sql5);
$rang1 = mysql_fetch_assoc($qry5);
$rang2 = mysql_fetch_assoc($qry5);
$rang3 = mysql_fetch_assoc($qry5);
$rang4 = mysql_fetch_assoc($qry5);
$rang5 = mysql_fetch_assoc($qry5);
$rang6 = mysql_fetch_assoc($qry5);
$rang7 = mysql_fetch_assoc($qry5);
$rang8 = mysql_fetch_assoc($qry5);
$rang9 = mysql_fetch_assoc($qry5);
$rang10 = mysql_fetch_assoc($qry5);
$rang11 = mysql_fetch_assoc($qry5);
$rang12 = mysql_fetch_assoc($qry5);
$rang13 = mysql_fetch_assoc($qry5);
$rang14 = mysql_fetch_assoc($qry5);
$rang15 = mysql_fetch_assoc($qry5);
$rang16 = mysql_fetch_assoc($qry5);
$summe = 20000000/(1+exp(5-$dlevel/14));
$sql = 'select u.clan, c.id, u.id as userid from chars c inner join user u on c.besitzer = u.id where c.id IN ('.$rang1['win'].','.$rang2['win'].','.$rang3['win'].','.$rang4['win'].','.$rang5['win'].','.$rang6['win'].','.$rang7['win'].','.$rang8['win'].','.$rang9['win'].','.$rang10['win'].','.$rang11['win'].','.$rang12['win'].','.$rang13['win'].','.$rang14['win'].','.$rang15['win'].','.$rang16['win'].')';
echo $sql.'<br>';
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)){
switch($row['id']){
case $rang1['win']:
$sql = 'UPDATE clan SET geld=geld+'.ceil($summe/2).' WHERE id='.$row['clan'];
echo $sql.'<br>';
mysql_query($sql);
insertClanTickerMessage($row['clan'], 'Das Preisgeld von '.ceil($summe/2).' f&uuml;r den 1. Platz im Welttunier erhalten!');
mysql_query('UPDATE user set pkt = pkt + 100 WHERE id = '.$row['userid']);
insertUserTickerMessage($row['userid'], '100 IP von Welttunier Sieg erhalten!');
break;
case $rang2['win']:
$sql = 'UPDATE clan SET geld=geld+'.ceil($summe/4).' WHERE id='.$row['clan'];
echo $sql.'<br>';
mysql_query($sql);
insertClanTickerMessage($row['clan'], 'Das Preisgeld von '.ceil($summe/4).' f&uuml;r den 2. Platz im Welttunier erhalten!');
mysql_query('UPDATE user set pkt = pkt + 90 WHERE id = '.$row['userid']);
insertUserTickerMessage($row['userid'], '90 IP von Welttunier 2.Platz erhalten!');
break;
case $rang3['win']:
case $rang4['win']:
$sql = 'UPDATE clan SET geld=geld+'.ceil($summe/8).' WHERE id='.$row['clan'];
echo $sql.'<br>';
mysql_query($sql);
mysql_query('UPDATE user set pkt = pkt + 75 WHERE id = '.$row['userid']);
insertClanTickerMessage($row['clan'], 'Das Preisgeld von '.ceil($summe/8).' f&uuml;r den 3-4. Platz im Welttunier erhalten!');
insertUserTickerMessage($row['userid'], '75 IP von Welttunier 3. oder 4. Platz erhalten!');
break;
case $rang5['win']:
case $rang6['win']:
case $rang7['win']:
case $rang8['win']:
mysql_query('UPDATE user set pkt = pkt + 50 WHERE id = '.$row['userid']);
insertUserTickerMessage($row['userid'], '50 IP von Welttunier 5-8. Platz erhalten!');
break;
case $rang9['win']:
case $rang10['win']:
case $rang11['win']:
case $rang12['win']:
case $rang13['win']:
case $rang14['win']:
case $rang15['win']:
case $rang16['win']:
mysql_query('UPDATE user set pkt = pkt + 25 WHERE id = '.$row['userid']);
insertUserTickerMessage($row['userid'], '25 IP von Welttunier 9-16. Platz erhalten!');
break;
default:
break;
}
}
//mysql_query('UPDATE clan SET geld=geld+\'20000000\' WHERE id='$win_name[clan]' LIMIT 1');
?>

@ -0,0 +1,114 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
//set_time_limit(0);
$art_1 ="gross";
function rand_array($array)
{
$maxarray=count($array)-1;
mt_srand((double)microtime()*1000000);
for($i=$maxarray; $i>=0; $i--)
{
if($i>0) $zufall=mt_rand(0,$i);
else $zufall=0;
$temp=$array[$i];
$array[$i]=$array[$zufall];
$array[$zufall]=$temp;
$newarray[]=$array[$i];
array_pop($array);
}
return $newarray;
}
include "db.php";
$chars_max = mysql_num_rows(mysql_query("SELECT id FROM chars WHERE rasse !='NPC' ORDER BY level DESC LIMIT 512"));
if($chars_max<512) {
echo "keine 512 spieler.";
exit;
}
mysql_query("DELETE FROM turnier_kampf WHERE art='$art_1'");
$char1 = mysql_query("SELECT id FROM chars WHERE rasse !='NPC' ORDER BY level DESC LIMIT 512");
while($row=mysql_fetch_array($char1))
{
$test2[]=$row['id'];
}
do
{
$test2 = rand_array($test2);
$test2 = array_unique($test2);
}
while(count($test2)<512);
$test3=$test2;
reset($test3);
while(current($test3)!=end($test2))
{
if(empty($list)) $list=current($test3);
else $list.=','.next($test3);
}
$result=mysql_query("SELECT * FROM chars WHERE id IN(".$list.") LIMIT 512");
while($row=mysql_fetch_array($result))
{
$charas[$row['id']]=$row;
}
$a8=0;
$b8=1;
$round = 1;
while($a8 < 512)
{
$chara_1 = $charas[$test2[$a8]];
$chara_2 = $charas[$test2[$b8]];
include "turnier_kampf.php";
$a8+=2;
$b8+=2;
}
while($round < 9)
{
unset($test9);
$chars_win = mysql_Query("SELECT win FROM turnier_kampf WHERE round='$round' AND art='$art_1'");
while($row9 = mysql_fetch_array($chars_win))
{
$test9[]=$row9['win'];
}
$round++;
$k9=0;
$l9=1;
while($k9 < count($test9))
{
$chara_1 = $charas[$test9[$k9]];
$chara_2 = $charas[$test9[$l9]];
include "turnier_kampf.php";
$k9+=2;
$l9+=2;
}
}
mysql_query("DELETE FROM turnier1 WHERE art='$art_1'");
?>

@ -0,0 +1,277 @@
<?php
/*
* Created on 07.08.2008
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
/*
*
* Alle Hilfsfunktionen fuer Chars sollen hier rein!
*
* Die Funktionen der char_profil wären sehr geeignet hierfür
*
*/
/*
* Char Status
*/
// Dieses Array ist dafuer da, dass nicht unnötig viele SQL-Abfragen gemacht werden!
// Fehlgriff im Design, aber solange wir nichts Klassenbasiert machen, gehts nicht anders
$GLOBALS['char_buffered_statuses'] = array ();
/* Diese Funktion gibt den Status des Chars wieder, kann ohne probleme mehrfach aufgerufen
* werden da die Anfragen gepuffert werden!
* returns Status des Charakters mit der id = $charid
*/
function getStatus($charid, $buffer_enabled = true) {
// Prioritaet, erst Turnier, dann Schatzsuche, dann Kampf
if ($GLOBALS['char_buffered_statuses'][$charid] != null && $buffer_enabled) {
return $GLOBALS['char_buffered_statuses'][$charid];
}
$sql = 'SELECT count(*) as anzahl FROM turnier_kampf t where art != \'gross\' and (win = ' . $charid . ' or lose = ' . $charid . ') and dauer > now()';
$row = mysql_fetch_assoc(mysql_query($sql));
if ($row['anzahl'] > 0) {
$GLOBALS['char_buffered_statuses'][$charid] = 'Turnier';
return 'Turnier';
}
$sql = 'SELECT count(*) as anzahl from quests where charid = ' . $charid;
$row = mysql_fetch_assoc(mysql_query($sql));
if ($row['anzahl'] > 0) {
$GLOBALS['char_buffered_statuses'][$charid] = 'Schatz Suche';
return 'Schatz Suche';
}
$sql = 'SELECT count(*) as anzahl from kampf where db_satz = ' . $charid;
$row = mysql_fetch_assoc(mysql_query($sql));
if ($row['anzahl'] > 0) {
$GLOBALS['char_buffered_statuses'][$charid] = 'Kampf';
return 'Kampf';
}
$sql = 'SELECT count(*) as anzahl FROM kampf_list where charakter = ' . $charid;
$row = mysql_fetch_assoc(mysql_query($sql));
if ($row['anzahl'] > 0) {
$GLOBALS['char_buffered_statuses'][$charid] = 'Kampf erstellt';
return 'Kampf erstellt';
}
$sql = 'SELECT count(*) as anzahl FROM turnier1 where charakter = ' . $charid;
$row = mysql_fetch_assoc(mysql_query($sql));
if ($row['anzahl'] > 0) {
$GLOBALS['char_buffered_statuses'][$charid] = 'Angemeldet';
return 'Angemeldet';
}
$GLOBALS['char_buffered_statuses'][$charid] = 'Frei';
return 'Frei';
}
/*
* Char generell!
*/
// Initialisierung des Puffers
$GLOBALS['char_buffered_instances'] = array ();
$GLOBALS['chars_read_out_user'] = array ();
// Uebergabe der Charid, und optional ob gepuffert werden darf
// returns: Char als Array
function getChar($charid, $buffer_enabled = true) {
// Fehlerkontrolle
if(!is_numeric($charid)){
return null;
}
// Wenn Char nicht im Puffer ist, oder nicht gepuffert werden soll
if ($GLOBALS['char_buffered_instances'][$charid] == null || !$buffer_enabled) {
// Lese das Charfeld aus der Datenbank aus
$char = mysql_fetch_assoc(mysql_query('Select * from chars where id = '.$charid));
if(!$char){return null;}
// Speichere in $char['stauts'] den aktuellen Status des Chars (buffer-Strategie ist hierbei die selbe)
$char['status'] = getStatus($char['id'],$buffer_enabled);
$char['bild'] = getPicture($char);
$GLOBALS['char_buffered_instances'][$charid] = &$char; // Speichern des Chars in den Puffer
}
// Gebe Char zurueck
return $GLOBALS['char_buffered_instances'][$charid];
}
function getChar2($charid) {
// Fehlerkontrolle
if(!is_numeric($charid)){
return null;
} else {
$char = mysql_fetch_assoc(mysql_query('Select * from chars where id = '.$charid));
if(!$char){return null;}
// Speichere in $char['stauts'] den aktuellen Status des Chars (buffer-Strategie ist hierbei die selbe)
$char['status'] = getStatus($char['id'],$buffer_enabled);
$char['bild'] = getPicture($char);
}
return $char;
}
function getCharWithBuffs($charid, $buffer_enabled = true){
$char = getChar($charid, $buffer_enabled);
if($char['kampf_item'] != NULL && $char['kampf_item'] != ',,,,'){
$char_buffs = mysql_fetch_assoc(mysql_query('SELECT sum(i.hp) as hp, sum(i.mp) as mp, sum(i.starke) as starke, sum(i.verteidigung) as verteidigung, sum(i.speed) as speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id IN (' . $char['kampf_item'] . ')'));
}
$char['starke'] += $char_buffs['starke'];
$char['verteidigung'] += $char_buffs['verteidigung'];
$char['speed'] += $char_buffs['speed'];
$char['ausdauer'] += $char_buffs['ausdauer'];
$char['glueck'] += $char_buffs['glueck'];
return $char;
}
// Uebergabe der Userid (Nachteil ist, dass Puffer von getChar mit $charid nicht moeglich ist, weil information fehlt, ob alle Chars im Buffer sind
/*
* Liefert die Url zum Avatarbild (Falls Char keinen Avatar hat gibt es die
* noavatar.gif zurueck!)
* returns Url of Avatar-Picture
* */
function getPicture($char){
// Sichergehen, dass Char geladen wurde
if($char['bild'] == null || $char['bild'] == ''){
return 'design/bilder/avatare/noavart.gif';
}
return $char['bild'];
}
// returns Array von Char-Arrays
function getCharsOfUser($userid, $buffer_enabled = true) {
// Fehlerkontrolle
if(!is_numeric($userid)){
return null;
}
if ($GLOBALS['chars_read_out_user'][$userid] == null || !$buffer_enabled) {
$GLOBALS['chars_read_out_user'][$userid] = array();
$qry = mysql_query('Select * from chars where besitzer = '.$userid.' order by id');
while($char = mysql_fetch_assoc($qry)){
// Speichere in $char['stauts'] den aktuellen Status des Chars (buffer-Strategie ist hierbei die selbe)
$char['status'] = getStatus($char['id'],$buffer_enabled);
$char['bild'] = getPicture($char);
// Speichere den Char in das Globale-Pufferfeld
$GLOBALS['char_buffered_instances'][$char['id']] = $char;
// Gebe dem User eine Referenz auf die globale chars-Variable
$GLOBALS['chars_read_out_user'][$userid][] = &$GLOBALS['char_buffered_instances'][$char['id']];
}
}
return $GLOBALS['chars_read_out_user'][$userid]; // Gebe das globale Userfeld zurück.
}
function deleteChar($userid, $charid){
$char = getChar($charid);
if($char['besitzer'] != $userid){
return 'Char gehoert nicht dir!';
} else if($char['status'] != 'Frei'){
return 'Char ist nicht Frei!';
}
mysql_query('Delete from lernen where besitzer = '.$charid);
mysql_query('Delete from chars where id = '.$charid);
return true;
}
/*
* Funktionen die durch Puffern profitieren würden oder um einfach Code einzusparen und um flexibel zu bleiben
*
*/
// Ermittelt den Besitzer
// Returns true = Ja, False = Nein, NULL = Error
function isUserOwnerOf($userid, $charid, $buffer_enabled = true){
// Fehlerkontrolle
if(!is_numeric($userid) || !is_numeric($charid)){
return null;
}
$char = getChar($charid, $buffer_enabled);
if($char == null){
return null;
}
return $char['besitzer'] == $userid;
}
// Funktion um das Powerlevel zu Berechnen (Kann ja durchaus sein, dass sich mal was dran ändert!)
// Returns Powerlevel als Integer, NULL = Error
function getPowerLevel($charid, $buffer_enabled = true){
$char = getChar($charid, $buffer_enabled);
if($char == null){
return null;
}
return $char['starke']+$char['verteidigung']+$char['speed']+$char['ausdauer']+$char['glueck'];
}
function getPowerLevelWithBuffs($charid, $buffer_enabled = true){
$char = getChar($charid, $buffer_enabled);
if($char == null){
return null;
}
if($char['kampf_item'] != NULL && $char['kampf_item'] != ',,,,'){
$char_buffs = mysql_fetch_assoc(mysql_query('SELECT sum(i.hp) as hp, sum(i.mp) as mp, sum(i.starke) as starke, sum(i.verteidigung) as verteidigung, sum(i.speed) as speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id IN (' . $char['kampf_item'] . ')'));
}
return $char_buffs['starke']+$char_buffs['verteidigung']+$char_buffs['speed']+$char_buffs['ausdauer']+$char_buffs['glueck']+$char['starke']+$char['verteidigung']+$char['speed']+$char['ausdauer']+$char['glueck'];
}
/*
* Auslesen der Attacken, die der Char beherrscht
*/
function getCharAttacks($charid){
}
// Auslesen der Kampfeinstellungen
function getChoosenAttacks($charid){
}
function getCharRaceId($charid){
$char = getChar($charid);
$rassen_werte = array(
'Mensch' => 1, ///0
'Saiyajin' => 2, ///1
'Dämon' => 3, ///2
'Mutant' => 4, ///3
'Cyborg' => 5, ///4
'Namekianer' => 6, ///5
'Pirat' => 7, ///6
'Shichibukai' => 8, ///7
'Kaioshin' => 9, ///8
'Schwertkämpfer' => 10,///9
'Grandline Maschine'=> 11,///10
'01' => 12,///11
'Leaf Dorf' => 13,///12
'Sand Dorf' => 14,///13
'Sound Dorf' => 15///14
);
return $rassen_werte[$char['rasse']];
}
function getFusionRaceId($charid){
$char = getChar($charid);
$rassen_werte = array(
'Mensch' => 1, ///0
'Saiyajin' => 2, ///1
'Dämon' => 3, ///2
'Mutant' => 4, ///3
'Cyborg' => 5, ///4
'Namekianer' => 6, ///5
'Pirat' => 7, ///6
'Shichibukai' => 8, ///7
'Kaioshin' => 9, ///8
'Schwertkämpfer' => 10,///9
'Grandline Maschine'=> 11,///10
'01' => 12,///11
'Leaf Dorf' => 13,///12
'Sand Dorf' => 14,///13
'Sound Dorf' => 15///14
);
return $rassen_werte[$char['fusion_rasse']];
}
?>

@ -0,0 +1,184 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
?>
<html>
<body>
<?php
if(!$chars_bilds[0]) { $chars_bilds[0] = "bilder/Char.gif"; }
if(!$chars_bilds[1]) { $chars_bilds[1] = "bilder/Char.gif"; }
if(!$chars_bilds[2]) { $chars_bilds[2] = "bilder/Char.gif"; }
if(!$chars_bilds[3]) { $chars_bilds[3] = "bilder/Char.gif"; }
if($chars_status[0] == "Frei") { $chars_status1[0] = "Frei"; }
else {
$chars_status1[0] = "<a href='index.php?as=abholen&ab=$chars_status[0]&char_id=$chars_ids[0]'>Angucken</a>";
}
if($chars_status[1] == "Frei") { $chars_status1[1] = "Frei"; }
else {
$chars_status1[1] = "<a href='index.php?as=abholen&ab=$chars_status[1]&char_id=$chars_ids[1]'>Angucken</a>";
}
if($chars_status[2] == "Frei") { $chars_status1[2] = "Frei"; }
else {
$chars_status1[2] = "<a href='index.php?as=abholen&ab=$chars_status[2]&char_id=$chars_ids[2]'>Angucken</a>";
}
if($chars_status[3] == "Frei") { $chars_status1[3] = "Frei"; }
else {
$chars_status1[3] = "<a href='index.php?as=abholen&ab=$chars_status[3]&char_id=$chars_ids[3]'>Angucken</a>";
}
if($chars_status[4] == "Frei") { $chars_status1[4] = "Frei"; }
else {
$chars_status1[4] = "<a href='index.php?as=abholen&ab=$chars_status[4]&char_id=$chars_ids[4]'>Angucken</a>";
}
if($chars_status[5] == "Frei") { $chars_status1[5] = "Frei"; }
else {
$chars_status1[5] = "<a href='index.php?as=abholen&ab=$chars_status[5]&char_id=$chars_ids[5]'>Angucken</a>";
}
if($chars_status[6] == "Frei") { $chars_status1[6] = "Frei"; }
else {
$chars_status1[6] = "<a href='index.php?as=abholen&ab=$chars_status[6]&char_id=$chars_ids[6]'>Angucken</a>";
}
if($chars_status[7] == "Frei") { $chars_status1[7] = "Frei"; }
else {
$chars_status1[7] = "<a href='index.php?as=abholen&ab=$chars_status[7]&char_id=$chars_ids[7]'>Angucken</a>";
}
?>
<table cellpadding="0" cellspacing="0" width="480" height="0">
<!-- MSTableType="layout" -->
<tr>
<td valign="middle">
<p align="center"><?php echo $chars_names[0]; ?></td>
<td valign="middle">
<p align="center"><?php echo $chars_names[1]; ?></td>
<td valign="middle">
<p align="center"><?php echo $chars_names[2]; ?></td>
<td height="23" valign="middle">
<p align="center"><?php echo $chars_names[3]; ?></td>
</tr>
<tr>
<td valign="top">
<p align="center">
<img border="0" src="<?php echo $chars_bilds[0]; ?>" width="79" height="78"></td>
<td valign="top">
<p align="center">
<img border="0" src="<?php echo $chars_bilds[1]; ?>" width="79" height="78"></td>
<td valign="top">
<p align="center">
<img border="0" src="<?php echo $chars_bilds[2]; ?>" width="79" height="78"></td>
<td height="95" valign="top">
<p align="center">
<img border="0" src="<?php echo $chars_bilds[3]; ?>" width="79" height="78"></td>
</tr>
<tr>
<td width="120" valign="top">
&nbsp;&nbsp;
<?php if($chars_hp[0]) {
echo "
HP: $chars_hp[0] <br>&nbsp;&nbsp;
MP: $chars_mp[0]<br>&nbsp;&nbsp;
Status: <b>$chars_status1[0]</b> </td>";
} ?>
<td width="120" valign="top">
&nbsp;&nbsp;
<?php if($chars_hp[1]) {
echo "
HP: $chars_hp[1] <br>&nbsp;&nbsp;
MP: $chars_mp[1]<br>&nbsp;&nbsp;
Status: <b>$chars_status1[1]</b> </td>";
} ?>
<td width="120" valign="top">
&nbsp;&nbsp;
<?php if($chars_hp[2]) {
echo "
HP: $chars_hp[2] <br>&nbsp;&nbsp;
MP: $chars_mp[2]<br>&nbsp;&nbsp;
Status: <b>$chars_status1[2]</b> </td>";
} ?>
<td height="47" width="120" valign="top">
&nbsp;&nbsp;
<?php if($chars_hp[3]) {
echo "
HP: $chars_hp[3] <br>&nbsp;&nbsp;
MP: $chars_mp[3]<br>&nbsp;&nbsp;
Status: <b>$chars_status1[3]</b> </td>";
} ?>
</tr>
<tr>
<td valign="middle">
<p align="center"><?php echo $chars_names[4]; ?></td>
<td valign="middle">
<p align="center"><?php echo $chars_names[5]; ?></td>
<td valign="middle">
<p align="center"><?php echo $chars_names[6]; ?></td>
<td height="23" valign="middle">
<p align="center"><?php echo $chars_names[7]; ?></td>
</tr>
<tr>
<td width="120" valign="top">
&nbsp;&nbsp;
<?php if($chars_hp[4]) {
echo "
HP: $chars_hp[4] <br>&nbsp;&nbsp;
MP: $chars_mp[4]<br>&nbsp;&nbsp;
Status: <b>$chars_status1[4]</b> </td>";
} ?>
<td width="120" valign="top">
&nbsp;&nbsp;
<?php if($chars_hp[5]) {
echo "
HP: $chars_hp[5] <br>&nbsp;&nbsp;
MP: $chars_mp[5]<br>&nbsp;&nbsp;
Status: <b>$chars_status1[5]</b> </td>";
} ?>
<td width="120" valign="top">
&nbsp;&nbsp;
<?php if($chars_hp[6]) {
echo "
HP: $chars_hp[6] <br>&nbsp;&nbsp;
MP: $chars_mp[6]<br>&nbsp;&nbsp;
Status: <b>$chars_status1[6]</b> </td>";
} ?>
<td height="25" width="120" valign="top">
&nbsp;&nbsp;
<?php if($chars_hp[7]) {
echo "
HP: $chars_hp[7] <br>&nbsp;&nbsp;
MP: $chars_mp[7]<br>&nbsp;&nbsp;
Status: <b>$chars_status1[7]</b> </td>";
} ?>
</tr>
</table>
</body>
</html>

@ -0,0 +1,23 @@
<script type="text/javascript">
function admin()
{
var Info = window.open("admin/index.php","","status=no,hotkeys=no,Height=600,Width=820,scrollbars=yes");
}
</script>
<a href='http://by.onlineplayers.de/boards/forumdisplay.php?s=&forumid=254' target="_blank" title="Brand neue News auf dem Animegame.de Board"> Forum</a><br>
<a href="<?php $PHP_SELF ?>?as=info/help">FAQ</a><br>
<?php
if($name == "Vegeta") {
?>
<a href='javascript:admin()'>Admin System</a>
<?
}
?>
</ul>

@ -0,0 +1,196 @@
<?php
/*
*
* @copyright (c) 2009 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include_once ('char.inc.php');
function beautifyNumericValue($value, $step){
// RUNDEN(POTENZ(10;ABRUNDEN(MAX(LOG(I3;10);2)))/4;0)
$tmp = round(pow(10,floor(max(log($value,10),2)))/$step);
return round($value / $tmp) * $tmp;
}
function calculateRequiredExpChars($level){
// We have a polynom with grade 10
$g01 = $level * 1000;
$g02 = pow($level,2) * 17;
$g03 = pow($level,3) * 0.01;
$g04 = pow($level,4) * 0.04;
// No need for 5
$g06 = pow($level*$level,6) * pow(10,-18);
$g07 = pow($level*$level,7) * pow(10,-22);
$g08 = pow($level*$level,8) * pow(10,-26);
$g09 = pow($level*$level,9) * pow(10,-30);
$g10 = pow($level*$level,10) * pow(10,-33);
return beautifyNumericValue($g01 + $g02 + $g03 + $g04 + $g06 + $g07 + $g08 + $g09 + $g10, 8);
// return $g01 + $g02 + $g03 + $g04 + $g06 + $g07 + $g08 + $g09 + $g10;
}
function calculateTrainingPoints($level){
return round(400/(1+ exp($level *-1/15+3))/2) ;
}
function calculateRequiredExpArena($level){
$g00 = 250;
$g01 = 2500 * $level;
$g02 = 250 * pow($level, 2);
$g03 = 250 * pow($level, 3);
$g04 = 750 * pow($level, 4);
return beautifyNumericValue($g00 + $g01 + $g02 + $g03 + $g04, 8);
}
/**
*
* @param $attacken array of 10 arrays with entry (anzahl and a_name)
* @return unknown_type
*/
function addAttackUsageToChar($char_id, $attacken){
$char = getChar($char_id, false); // We really want the actual char!!
// Erstmal die Attacken vermerken!
for($i=0;$i<count($attacken);$i++){
// So jetzt nur noch die reqs einpflegen
$sql = 'Update lernen set benutzt = benutzt + '.$attacken[$i]['anzahl'].' where name = \''.$attacken[$i]['a_name'].'\' and besitzer = '.$char_id;
// echo $sql.'<br>';
mysql_query($sql);
}
// Sooo und nun gehts darum ob wir neue Attacken lernen können
// Ersma die ganzen Infos laden
$sql = 'SELECT * FROM lernen where besitzer = '.$char_id;
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)){
$lern[$row['at_id']] = $row; // Zum späteren Check ob die Reqs erfüllt sind
$atkid[] = $row['at_id']; // Zum ausschliessen der Attacken
}
// Wir können jetzt schon die Attacken ausschließen, die wir schon können!!
if(count($atkid) > 0){
$zusatz = ' AND id NOT IN('.join($atkid,',').')';
}
// Lernbare Attacken auswählen
if(!is_null($char['frucht'])){
$sql = 'select * from attacken where (Frucht is NULL or Frucht = (Select id from wochen_markt where item = \''.$char['frucht'].'\')) and (rassen != \'\' and rassen != \'0\') and level <= '.$char['level'].$zusatz;
} else {
$sql = 'select * from attacken where (Frucht is NULL) and (rassen != \'\' and rassen != \'0\') and level <= '.$char['level'].$zusatz;
}
// echo $sql.'<br>';
$qry = mysql_query($sql);
// Das geht leider nicht mit dieser Datenstruktur direkt auszuwählen
$raceid[] = getCharRaceId($char_id);
if(!is_null(getFusionRaceId($char_id))){
$raceid[] = getFusionRaceId($char_id);
}
// So und nun arbeite jede Attacke durch die nur im geringsten Lernbar sein könnte ...
while($row = mysql_fetch_assoc($qry)) {
// Erstmal checken ob es eine Fruchtattacke ist (durch die SQL-Anweisung werden alle nicht zutreffenden Früchte ausgeblockt)
$learnable = false;
if(!is_null($row['Frucht'])){
// Ok es is ne Frucht-attacke :) Also können wir sie lernen :)
$learnable = true;
} else {
// Ok, dann müssen wir die Rasse checken :)
$races = preg_split('#,#', $row['rassen']);
for($i=0;$i<count($races);$i++){
for($t=0;$t<count($raceid);$t++){ // Walk through own races (remember: when fused we have two)
if($races[$i] == $raceid[$t]){
// Die Rasse passt schonmal!!
$learnable = true; // Gehen wir mal vom besten Fall aus
// Da die Rasse gepasst hat können wir uns aus der Schleife verabschieden
break;
}
}
}
}
if($learnable){
// Haben wir die benötigten Attacken auch oft genug genutzt??
$r_atck = preg_split('#,#', $row['req_atk']);
for($u = 0;$u < count($r_atck); $u++){
if($r_atck[$u] != '0' && $lern[$r_atck[$u]]['benutzt'] < $row['geld']){
// Passt nicht? dann brauchen wir garnich weiter machen
// echo 'Der Char kann '.$row['name'].' nicht lernen, weil er die Attacke '.$lern[$r_atck[$u]]['name'].' nur '.$lern[$r_atck[$u]]['benutzt'].' mal eingesetzt hat und nicht '.$row['geld'].'<br>';
$learnable = false;
break;
}
}
}
if($learnable){
mysql_query('INSERT lernen SET name=\''.$row['name'].'\', at_id=\''.$row['id'].'\', besitzer=\''.$char_id.'\', aktiv=\'1\'');
echo '<script language="JavaScript">alert(\''.$char['name'].' hat die Technik '.$row['name'].' gelernt!\');</script>';
}
}
}
function addExpToChar($char_id, $n_exp){
$char = getChar($char_id, false); // We really want the actual char!!
$char_exp = explode(',', $char['exp']);
$char_exp[0] += $n_exp;
$lvls = 0;
$tp = 0;
$lp = 0;
while($char_exp[0] >= $char_exp[1]){
// Level UP!!
$lvls++;
$char['level']++;
$char_exp[0] -= $char_exp[1];
$char_exp[1] = calculateRequiredExpChars($char['level']);
$tp += calculateTrainingPoints($char['level']);
$lp += 10;
}
if($lvls > 0){ // Ist Char um mindestens ein Level gestiegen?
echo '<script language="JavaScript">alert(\''.$char['name'].' ist um '.$lvls.' Level gestiegen!\');</script>';
$sql = 'Update chars set exp = \''.$char_exp[0].','.$char_exp[1].'\', lernpunkte = lernpunkte +'.$lp.', training_points = training_points + '.$tp.', level = level + '.$lvls.' where id = '.$char_id;
} else {
$sql = 'Update chars set exp = \''.$char_exp[0].','.$char_exp[1].'\' where id = '.$char_id;
}
// echo $sql.'<br>';
mysql_query($sql);
$char = getChar($char_id, false); // We really want the actual char!!
if($char['level'] > 25) {
// remove this char out of the registration of the beginners tournament
mysql_query('Delete from turnier1 where art = \'klein\' and charakter = \''.$char_id.'\'');
}
}
function addExpToArena($user_id, $n_exp){
$sql = 'SELECT * from arena where besitzer = '.$user_id;
$qry = mysql_query($sql);
$arena = mysql_fetch_assoc($qry);
$arena_exp = explode(',', $arena['exp']);
$arena_exp[0] += $n_exp;
$lvls = 0;
while($arena_exp[0] >= $arena_exp[1]){
// Level UP!!
$lvls++;
$arena['level']++;
$arena_exp[0] -= $arena_exp[1];
$arena_exp[1] = calculateRequiredExpArena($arena['level']);
}
if($lvls > 0){
// mysql_query("UPDATE arena SET exp='$ne_exp1,$new_exp', level='$level1', skill='$skill_points' WHERE besitzer='$user_ida[id]' LIMIT 1");
echo '<script language="JavaScript">alert(\'Arena ist um '.$lvls.' Level gestiegen!\');</script>';
mysql_query('Update arena set exp=\''.$arena_exp[0].','.$arena_exp[1].'\', level='.$arena['level'].', skill=skill+'.$lvls.' WHERE besitzer='.$user_id);
} else{
mysql_query('Update arena set exp=\''.$arena_exp[0].','.$arena_exp[1].'\' WHERE besitzer='.$user_id);
}
}
?>

@ -0,0 +1,22 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
function distributeFruit($user_id) {
$sql = 'SELECT id FROM wochen_markt WHERE art=\'natur\'';
$qry = mysql_query($sql);
$amount = mysql_affected_rows($qry);
while($fruit = mysql_fetch_assoc($qry)) {
$fruits[] = $fruit;
}
$choice = mt_rand(0,$amount-1);
$sql = 'INSERT wochen_ware SET item='.$fruits[$choice].', user='.$user_id;
echo $sql;
mysql_query($sql);
}
?>

@ -0,0 +1,64 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include_once('char.inc.php');
/**
*
* @param unknown_type $title
* @param unknown_type $charid
* @param unknown_type $userid
* @return boolean if the insert was successful
*/
function insertIntoHallOfFame($title, $charid, $userid){
$row = mysql_fetch_assoc(mysql_query('Select max(id) as round from online'));
$char = getChar($charid);
$user = mysql_fetch_assoc(mysql_query('Select * from user where id = '.$userid));
if(!$row || is_null($char) || is_null($user)){
return false;
}
return insertIntoHallOfFameFull($row['round'], $title, $charid, $char['name'], $userid, $user['nickname'], 'CURRENT_DATE');
}
function insertIntoHallOfFameFull($round = '', $title = '', $charid = '', $charname = '', $userid = '', $username = '', $date = ''){
// These Entries may not be ''
if(!is_numeric($round) || $date == '' || $title == ''){
return false;
}
$columns = 'art, runde, datum, charname, username';
$values = '\''.$title.'\','.$round.','.$date.',\''.$charname.'\',\''.$username.'\'';
if(is_numeric($charid)){
$columns .= ',charid';
$values .= ','.$charid;
}
if(is_numeric($userid)){
$columns .= ',userid';
$values .= ','.$userid;
}
$sql = 'INSERT INTO highscore('.$columns.') values('.$values.')';
// echo $sql.'<br>';
$qry = mysql_query($sql);
return mysql_affected_rows() > 0;
}
function getHallOfFame($title, $userid) {
$row = mysql_fetch_assoc(mysql_query('Select max(id) as round from online'));
return getHallOfFameFull($row['round'],$title, $userid);
}
function getHallOfFameFull($round = '', $title = '', $userid = '') {
$sql = 'select count(*) from highscore where runde='.$round.' and userid='.$userid;
$row = mysql_fetch_row($sql);
return $row[0];
}
?>

@ -0,0 +1,50 @@
<?php
/*
* Created on 08.03.2009
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
// + offset in Minuten
function insertUserTickerMessage($userid, $message, $offset = 0){
if($offset == 0){
$timestamp = 'now()';
} else{
$timestamp = '\''.date('Y-m-d H:i:s', time() + $offset * 60).'\'';
}
for($msgid = 0; $msgid < 100000; $msgid += mt_rand(1,1000)){
$sql = 'INSERT INTO user_ticker(userid, date, msgid, text) values('.$userid.', '.$timestamp.', '.$msgid.', \''.$message.'\')';
mysql_query($sql);
if(mysql_affected_rows() == 1){
// echo 'MYSQL success: '.$sql;
return;
}
}
// echo 'MYSQL-Error: '.$sql;
}
function insertClanTickerMessage($clanid, $message, $offset = 0){
if($offset == 0){
$timestamp = 'now()';
} else{
$timestamp = '\''.date('Y-m-d H:i:s', time() + $offset * 60).'\'';
}
for($msgid = 0; $msgid < 100000; $msgid += mt_rand(1,1000)){
$sql = 'INSERT INTO clan_ticker(clanid, date, msgid, text) values('.$clanid.', now(), '.$msgid.', \''.$message.'\')';
mysql_query($sql);
if(mysql_affected_rows() == 1){
// echo 'MYSQL success: '.$sql;
return;
}
}
// echo 'MYSQL-Error: '.$sql;
}
function displayMoney($value){
return number_format($value,0,'','.').' &#165;';
}
?>

@ -0,0 +1,52 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################SSJ SPIELER 1
if($technick1[type] == SSJ) {
$k_mp[0] = $k_mp[0] - $technick1[mp];
if($k_mp[0] < 0) {
$schaden_1 = "SSJ Verwandlung fehlgeschlagen";
$aktion_AV1[$x] = "nein";
$k_mp[0] = 0;
} else {
if(!$ssj_tech_1) {
$k_starke[0] = $k_starke[0] * (($technick1[starke]+1) / 2);
$k_speed[0] = $k_speed[0] * (($technick1[speed]+1) / 2);
$k_ver[0] = $k_ver[0] * (($technick1[verteidigung]+1) / 2);
$schaden_1 = "$technick1[name]!!!";
$aktion_AV1[$x] = "nein";
$ssj_tech_1=$technick1[level];
}
}}
####################SSJ SPIELER 2
if($technick2[type] == SSJ) {
$k_mp[1] = $k_mp[1] - $technick2[mp];
if($k_mp[1] < 0) {
$schaden_2 = "SSJ Verwandlung fehlgeschlagen";
$aktion_AV2[$x] = "nein";
$k_mp[1] = 0;
} else {
if(!$ssj_tech_2) {
$k_starke[1] = $k_starke[1] * (($technick2[starke]+1) / 2);
$k_speed[1] = $k_speed[1] * (($technick2[speed]+1) / 2);
$k_ver[1] = $k_ver[1] * (($technick2[verteidigung]+1) / 2);
$schaden_2 = "$technick2[name]!!!";
$aktion_AV2[$x] = "nein";
$ssj_tech_2=$technick2[level];
}}}
?>

@ -0,0 +1,7 @@
runde: HP = Wieviel runden;
kaioken2: Stärke,def,speed = wieviel % du Stärke bekommst, HP,MP =wieviel % du verlierst davon.
lose: Wert=xx% seiner HP verliert der Gegner.
copy: wert=1 für copy (z.b Stärke 1 = er kopiert Stärke vom Gegner)
majin: wert = x-0.5 damit der gegner es + bekommt dafür schlägt er sich selba.
lose2: Stärke= chance
tausch: stärke=chance

@ -0,0 +1,89 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
if($k_attacke1_2[$x]) {
if($k_select1_1[$x] == 1) { $wert_select1 = $k_hp[0]; $k_auswahl1 = $k_hp1[1]; }
elseif($k_select1_1[$x] == 2) { $wert_select1 = $k_mp[0]; $k_auswahl1 = $k_mp1[1]; }
elseif($k_select1_1[$x] == 3) { $wert_select1 = $k_starke[0]+$k_ver[0]+$k_speed[0]+$k_ausdauer[0]+$k_glueck[0]; $k_auswahl1=$wert_select1;
}
if($k_select1_3[$x] == 1) { $wert_select1_3 = $k_hp[1]; }
elseif($k_select1_3[$x] == 2) { $wert_select1_3 = $k_mp[1]; }
elseif($k_select1_3[$x] == 3) { $wert_select1_3 = $k_starke[1]+$k_ver[1]+$k_speed[1]+$k_ausdauer[1]+$k_glueck[1]; }
elseif($k_select1_3[$x] == 5) { $wert_select1_3 = ($k_auswahl1/100) * 5; } ////////5%
elseif($k_select1_3[$x] == 10) { $wert_select1_3 = ($k_auswahl1/100) * 10; } ////////10%
elseif($k_select1_3[$x] == 20) { $wert_select1_3 = ($k_auswahl1/100) * 20; } ////////20%
elseif($k_select1_3[$x] == 50) { $wert_select1_3 = ($k_auswahl1/100) * 50; ////////50%
}
if($k_select1_2[$x] == 1) {
if($wert_select1 > $wert_select1_3) {
$new_tech1 = 0;
} else {
$new_tech1 = 1;
}
}
if($k_select1_2[$x] == 2) {
if($wert_select1 < $wert_select1_3) {
$new_tech1 = 0;
} else {
$new_tech1 = 1;
}
}
if($new_tech1 == 1) {
$technick1 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1_2[$x]' LIMIT 10"));
$prozent_technik1 = (20*$technick1[aktiv])-20;
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
}
}
///////////// Technik spieler 2
if($k_attacke2_2[$x]) {
if($k_select2_1[$x] == 1) { $wert_select2 = $k_hp[1]; $k_auswahl2 = $k_hp2[1]; }
elseif($k_select2_1[$x] == 2) { $wert_select2 = $k_mp[1]; $k_auswahl2 = $k_mp2[1]; }
elseif($k_select2_1[$x] == 3) { $wert_select2 = $k_starke[1]+$k_ver[1]+$k_speed[1]+$k_ausdauer[1]+$k_glueck[1]; $k_auswahl2 = $wert_select2;
}
if($k_select2_3[$x] == 1) { $wert_select2_3 = $k_hp[0]; }
elseif($k_select2_3[$x] == 2) { $wert_select2_3 = $k_mp[0]; }
elseif($k_select2_3[$x] == 3) { $wert_select2_3 = $k_starke[0]+$k_ver[0]+$k_speed[0]+$k_ausdauer[0]+$k_glueck[0]; }
elseif($k_select2_3[$x] == 5) { $wert_select2_3 = ($k_auswahl2/100) * 5; } ////////5%
elseif($k_select2_3[$x] == 10) { $wert_select2_3 = ($k_auswahl2/100) * 10; } ////////10%
elseif($k_select2_3[$x] == 20) { $wert_select2_3 = ($k_auswahl2/100) * 20; } ////////20%
elseif($k_select2_3[$x] == 50) { $wert_select2_3 = ($k_auswahl2/100) * 50; ////////50%
}
if($k_select2_2[$x] == 1) {
if($wert_select2 > $wert_select2_3) {
$new_tech2 = 0;
} else {
$new_tech2 = 1;
}
}
if($k_select2_2[$x] == 2) {
if($wert_select2 < $wert_select2_3) {
$new_tech2 = 0;
} else {
$new_tech2 = 1;
}
}
if($new_tech2 == 1) {
$technick2 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2_2[$x]' LIMIT 10"));
$prozent_technik2 = (20*$technick2[aktiv])-20;
$technick2 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick2[at_id]' LIMIT 10"));
}
}
?>

@ -0,0 +1,44 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
#####################################KAMPF SYSTEM
// $zufall_pl1 = Attacke p1
// $zufall_pl2 = Attacke p2
// $play1_ausweich = Parade p1
// $play2_ausweich = Parade p2
// A1 (Attacke Spieler1) = 0.7 * S1 / SA + 0.3 * L1 / LA
// P2 (Parade Spieler2) = 0.6 * S2 / SA + 0.4 * L2 / LA
$lucka1 = mt_rand(0,$k_glueck[0]);
$luckp1 = mt_rand(0,$k_glueck[0]);
$lucka2 = mt_rand(0,$k_glueck[1]);
$luckp2 = mt_rand(0,$k_glueck[1]);
$speedsum = $speed_char1 + $speed_char2;
$lucksum1 = $lucka1 + $luckp2;
$lucksum2 = $lucka2 + $luckp1;
if($lucksum1 == 0){ $lucksum1 = 2; $lucka1 = 1; $luckp2 = 1; }
if($lucksum2 == 0){ $lucksum2 = 2; $lucka2 = 1; $luckp1 = 1; }
$zufall_pl1 = 0.7 * $speed_char1 / $speedsum + 0.3 * $lucka1 / $lucksum1;
$zufall_pl2 = 0.7 * $speed_char2 / $speedsum + 0.3 * $lucka2 / $lucksum2;
$play1_ausweich = 0.6 * $speed_char1 / $speedsum + 0.4 * $luckp1 / $lucksum2;
$play2_ausweich = 0.6 * $speed_char2 / $speedsum + 0.4 * $luckp2 / $lucksum1;
//echo '<br>DEBUG (NICHT ALS BUG MELDEN!!): Speed Char1 '.$speed_char1.', Glueck Char1 = '.$k_glueck[0].', Att-Luck Char1 '.$lucka1.', Par-Luck Char1 '.$luckp1.'<br>';
//echo '<br>DEBUG (NICHT ALS BUG MELDEN!!): ATTACK Char1 '.$zufall_pl1.', PARADE Char1 '.$play1_ausweich.'<br><br>';
//echo '<br>DEBUG (NICHT ALS BUG MELDEN!!): Speed Char2 '.$speed_char2.', Glueck Char2 = '.$k_glueck[1].', Att-Luck Char2 '.$lucka2.', Par-Luck Char1 '.$luckp2.'<br>';
//echo '<br>DEBUG (NICHT ALS BUG MELDEN!!): ATTACK Char2 '.$zufall_pl2.', PARADE Char2 '.$play2_ausweich.'<br><br>';
?>

@ -0,0 +1,28 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
if($x > 0) {
################### PLAYER 1
$k_starke[0] = round($k_starke[0] + (($k_ausdauer[0] / 20))-($k_starke[0]/50));
$k_speed[0] = round($k_speed[0] + ($k_ausdauer[0] / 10));
$k_ver[0] = round($k_ver[0] + ($k_ausdauer[0] / 10));
$k_ausdauer[0] = round($k_ausdauer[0] - ($k_ausdauer[0] /20));
################### PLAYER 2
$k_starke[1] = round($k_starke[1] + (($k_ausdauer[1] / 20))-($k_starke[1]/50));
$k_speed[1] = round($k_speed[1] + ($k_ausdauer[1] / 10));
$k_ver[1] = round($k_ver[1] + ($k_ausdauer[1] / 10));
$k_ausdauer[1] = round($k_ausdauer[1] - ($k_ausdauer[1] /20));
}
?>

@ -0,0 +1,107 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/config.inc.php');
$user1 = mysql_Fetch_array(mysql_query("SELECT id, nickname FROM user WHERE nickname='$name' LIMIT 1"));
$kampf_a = mysql_fetch_array(mysql_query("SELECT char1, char2, id, dauer FROM kampf WHERE db_satz='$char_id' LIMIT 1"));
$kampf_a1 = mysql_fetch_array(mysql_query("SELECT name, besitzer, id FROM chars WHERE id='$kampf_a[char1]' LIMIT 1"));
$kampf_a2 = mysql_fetch_array(mysql_query("SELECT name, besitzer, id FROM chars WHERE id='$kampf_a[char2]' LIMIT 1"));
if($kampf_a1[besitzer] == $user1[id]) {
$user2 = mysql_Fetch_array(mysql_query("SELECT id, nickname FROM user WHERE id='$kampf_a2[besitzer]' LIMIT 1"));
} else {
$user2 = mysql_Fetch_array(mysql_query("SELECT id, nickname FROM user WHERE id='$kampf_a1[besitzer]' LIMIT 1"));
}
if(!$user1 OR !$user2) {
echo "Fehler User wurde nicht gefunden oder der kampf Existiert nicht mehr";
exit;
}
if($chat_nachricht) {
mysql_query("INSERT kampf_nachricht SET nachricht='$_POST[chat_nachricht]', user='$user1[id]', charakter='$char_id'");
?>
<meta http-equiv="refresh" content="0.5; URL=<?php echo $PHPSELF; ?>?char_id=<?php echo $char_id; ?>">
<?php
}
$zeit_in_sek = $kampf_a[dauer] - time();
?>
<table cellpadding="0" cellspacing="0" width="400" height="150">
<!-- MSTableType="layout" -->
<tr>
<td height="27" valign="top">
<p align="center"><?php echo "$kampf_a1[name] vs. $kampf_a2[name]";
echo "<SCRIPT language='JavaScript'>";
?>
function showfight1(){
var Info = window.open("../kampf4.php?char_id=<?php echo $char_id; ?>","","status=no,hotkeys=no,Height=600,Width=820,scrollbars=yes");
}
<?php
echo "</SCRIPT>";
?>
<div align='center' id='timer'>
<script type='text/javascript'>v=new Date();var ht=document.getElementById('timer');function t(){n=new Date();s=<?php echo $zeit_in_sek; ?>-Math.round((n.getTime()-v.getTime())/1000.);m=0;h=0;if(s<0){ht.innerHTML="<?php echo "<a href='javascript:showfight1()'>Ergebnis zeigen</a>"; ?>"}else{if(s>59){m=Math.floor(s/60);s=s-m*60}if(m>59){h=Math.floor(m/60);m=m-h*60}if(s<10){s='0'+s}if(m<10){m='0'+m}ht.innerHTML=h+':'+m+':'+s}window.setTimeout('t();',950);}window.onload=t;</script>
</div>
</td>
</tr>
<tr>
<td height="100" valign="top">
<?php
$all_mess = mysql_query("SELECT n.nachricht, w.nickname FROM kampf_nachricht n LEFT JOIN user w ON(n.user=w.id) WHERE (n.user='$user1[id]' OR n.user='$user2[id]') AND (n.charakter='$kampf_a1[id]' OR n.charakter='$kampf_a2[id]') ORDER BY n.id ASC");
?>
<form action=<?php echo $PHPSELF; ?>?char_id=<?php echo $char_id; ?> method=post>
<SCRIPT Language="JavaScript">
<!--
function scrolldown()
{
text = document.forms[0].elements["ScrollDown"].createTextRange();
text.scrollIntoView(false);
}
//-->
</SCRIPT>
<head>
<BODY onMousemove="scrolldown()">
<meta http-equiv="refresh" content="15; URL=<?php echo $PHPSELF; ?>?char_id=<?php echo $char_id; ?>">
<textarea rows="6" cols="42" readonly name="ScrollDown">
<?php
while($row = mysql_fetch_array($all_mess)) {
echo "$row[nickname]: $row[nachricht] \n";
}
?>
</textarea>
</td>
</tr>
<tr>
<td height="23" width="400"><input name="chat_nachricht" size="50"> <input type="submit" value="GO"></td>
</tr>
<tr>
<td height="23" width="400">
</td>
</tr>
</table>
</body>
</html>

@ -0,0 +1,26 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
if($exp_rows1[level] == 1) { $new_max_exp1 = 2500; }
if($exp_rows1[level] == 2) { $new_max_exp1 = 7500; }
if($exp_rows1[level] == 3) { $new_max_exp1 = 30000; }
if($exp_rows1[level] == 4) { $new_max_exp1 = 100000; }
if($exp_rows2[level] == 1) { $new_max_exp2 = 2500; }
if($exp_rows2[level] == 2) { $new_max_exp2 = 7500; }
if($exp_rows2[level] == 3) { $new_max_exp2 = 30000; }
if($exp_rows2[level] == 4) { $new_max_exp2 = 100000; }
if($EXP_new1+$exp_rows1[min_exp] >= $exp_rows1[max_exp] AND $exp_rows1[level] != 5) {
mysql_query("UPDATE clan SET level=level+1, max_exp='$new_max_exp1', member=member+2 WHERE id='$clan1[$iws]'");
}
if($EXP_new2+$exp_rows2[min_exp] >= $exp_rows2[max_exp] AND $exp_rows2[level] != 5) {
mysql_query("UPDATE clan SET level=level+1, max_exp='$new_max_exp2', member=member+2 WHERE id='$clan2[$iws]'");
}
?>

@ -0,0 +1,224 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$uzze=0;
while($uzze < 10) {
$aktion_AV1[$uzze] = "";
$aktion_AV2[$uzze] = "";
$uzze++;
}
$ssj_tech_1="";
$ssj_tech_2="";
$play1_ausweich="";
$play2_ausweich="";
$k_exp[0] = "";
$X23 = "";
$X13 = "";
$schaden_1="";
$schaden_2="";
################## Kaempfer 1
$k_hp1 = explode(",", $chara_1[hp]);
$k_mp1 = explode(",", $chara_1[mp]);
$k_hp1[0] = $k_hp1[1];
$k_mp1[0] = $k_mp1[1];
$k_starke[0] = $chara_1[starke] + $k_rustung[ru_mal];
$k_speed[0] = $chara_1[speed];
$k_ver[0] = $chara_1[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[0] = $chara_1[ausdauer];
$k_glueck[0] = $chara_1[glueck];
$k_attacke1 = explode(",", $chara_1[attacken]);
$k_hp[0] = round($k_hp1[0]);
$k_mp[0] = round($k_mp1[0]);
$k_aufgabe_a_1 = $k_hp1[1] / 100;
$k_aufgabe[0] = $k_aufgabe_a_1 * $chara_1[aufgeben];
######################################Kaempfer2
$k_hp2 = explode(",", $chara_2[hp]);
$k_mp2 = explode(",", $chara_2[mp]);
$k_hp2[0] = $k_hp2[1];
$k_mp2[0] = $k_mp2[1];
$k_starke[1] = $chara_2[starke] + $k_rustung[ru_mal];
$k_speed[1] = $chara_2[speed];
$k_ver[1] = $chara_2[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[1] = $chara_2[ausdauer];
$k_glueck[1] = $chara_2[glueck];
$k_attacke2 = explode(",", $chara_2[attacken]);
$k_hp[1] = round($k_hp2[0]);
$k_mp[1] = round($k_mp2[0]);
$k_aufgabe_a_2 = $k_hp2[1] / 100;
$k_aufgabe[1] = $k_aufgabe_a_2 * $chara_2[aufgeben];
$x=0;
mysql_query("INSERT clan_kampf SET hp1='$k_hp[0]', hp2='$k_hp[1]', mp1='$k_mp[0]', mp2='$k_mp[1]', schaden1='$schaden_1', schaden2='$schaden_2', attacke1='$technick1[name]', attacke2='$technick2[name]', char1='$chara_1[id]', char2='$chara_2[id]', starke1='$k_starke[0]', starke2='$k_starke[1]', ver1='$k_ver[0]', ver2='$k_ver[1]', speed1='$k_speed[0]', speed2='$k_speed[1]', ausdauer1='$k_ausdauer[0]', ausdauer2='$k_ausdauer[1]'");
while($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$technick1 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$prozent_technik1 = (20*$technick1[aktiv])-20;
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick2 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2[$x]' LIMIT 10"));
$prozent_technik2 = (20*$technick2[aktiv])-20;
$technick2 = mysql_fetch_array(mysql_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($_SERVER['DOCUMENT_ROOT'].'ag/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_rand($speeds_char1_4,$speeds_char1);
$speed_char2 = mt_rand($speeds_char2_4,$speeds_char2);
$aussetzten_runde = ""; ////// MUSS SO BLEIBEN WICHTIG
##################################MP, SSJ Verwandlungen, HP, Koerper Tausch Technicken
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/majin.php');
if(!$aussetzten_runde) {
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/tausch2.php'); //////////////////Muss ganz oben sein wegen technik Tauschen
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/gift.php');
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/frucht.php');
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/mp.php');
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/hp.php');
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/hp2.php');
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/SSJ.php');
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/kaioken.php');
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/kaioken2.php');
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/copy.php');
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/lose.php');
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/lose2.php');
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/ausdauer.php');
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/mpv.php');
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/tausch.php');
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/hpmp.php');
}
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/atk_wert.php');
#####################################KAMPF SYSTEM
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/kampf_rechnung.php');
$db_query = mysql_fetch_array(mysql_query("SELECT * FROM clan_kampf WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') AND dauer='0' order by id DESC LIMIT 1"));
mysql_query("UPDATE clan_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]' WHERE id='$db_query[id]'");
$x++;
}
###########################EXP VERTEILUNG
$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") {
$clan1_win = 1;
$clan2_win = 0;
$k_exp[1] = 0;
$k_geld[1] = 2000;
$k_exp[0] = 0;
$k_geld[0] = 5000;
$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];
$clan1_win= 0;
$clan2_win = 1;
$k_exp[1] = 0;
$k_geld[1] = 5000;
$k_exp[0] = 0;
$k_geld[0] = 2000;
}
if($k_exp[0]) { $s=2; } else { $s++; }
}
$iws = $iw-1;
mysql_query("UPDATE clan_kampf SET clan1_id='$clan1[$iws]', clan2_id='$clan2[$iws]', exp1='$k_exp[0]', win='$sieger', lose='$verlierer', exp2='$k_exp[1]', geld1='$k_geld[0]', geld2='$k_geld[1]', clan1_win='$clan1_win', clan2_win='$clan2_win' WHERE id='$db_query[id]'");
if($yt == 3) {
$yt=0;
$win_rows1 = mysql_num_rows(mysql_query("SELECT id FROM clan_kampf WHERE clan1_win='1' AND clan1_id='$clan1[$iws]' LIMIT 2"));
$win_rows2 = mysql_num_rows(mysql_query("SELECT id FROM clan_kampf WHERE clan2_win='1' AND clan2_id='$clan2[$iws]' LIMIT 2"));
if($win_rows1 > $win_rows2) {
////CLAN 1 WINS
$exp_rows1 = mysql_fetch_array(mysql_query("SELECT siege, level, min_exp, max_exp FROM clan WHERE id='$clan1[$iws]' LIMIT 1"));
$exp_rows2 = mysql_fetch_array(mysql_query("SELECT siege, level, min_exp, max_exp FROM clan WHERE id='$clan2[$iws]' LIMIT 1"));
$EXP_new1 = ($exp_rows2[siege]+1) * 10;
$EXP_new2 = ($exp_rows1[siege]+1) * 5;
include "clan_exp.php";
include($_SERVER['DOCUMENT_ROOT'].'ag/include/kampf/kampf_rechnung.php');
mysql_query("UPDATE clan SET geld=geld+'5000', siege=siege+1, min_exp=min_exp+'$EXP1_new1' WHERE id='$clan1[$iws]'");
mysql_query("UPDATE clan SET geld=geld+'2000', niederlagen=niederlagen+1, min_exp=min_exp+'$EXP1_new2' WHERE id='$clan2[$iws]'");
} else {
$exp_rows1 = mysql_fetch_array(mysql_query("SELECT siege, level, min_exp, max_exp FROM clan WHERE id='$clan1[$iws]' LIMIT 1"));
$exp_rows2 = mysql_fetch_array(mysql_query("SELECT siege, level, min_exp, max_exp FROM clan WHERE id='$clan2[$iws]' LIMIT 1"));
$EXP_new2 = ($exp_rows1[siege]+1) * 10;
$EXP_new1 = ($exp_rows2[siege]+1) * 5;
include "clan_exp.php";
////CLAN 2 WINS
mysql_query("UPDATE clan SET geld=geld+'2000', niederlagen=niederlagen+1, min_exp=min_exp+'$EXP1_new1' WHERE id='$clan1[$iws]'");
mysql_query("UPDATE clan SET geld=geld+'5000', siege=siege+1, min_exp=min_exp+'$EXP1_new2' WHERE id='$clan2[$iws]'");
}
}
?>

@ -0,0 +1,56 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
################### Spieler 1
if ($technick1[type] == copy) {
$k_mp[0] = $k_mp[0] - $technick1[mp];
if ($k_mp[0] >= 0) {
if ($technick1[starke] == 1) { /////Staerke wird kopiert
$k_starke[0] = $k_starke[0] + $k_starke[1];
}
if ($technick1[speed] == 1) { /////Staerke wird kopiert
$k_speed[0] = $k_speed[0] + $k_speed[1];
}
if ($technick1[verteidigung] == 1) { /////Staerke wird kopiert
$k_ver[0] = $k_ver[0] + $k_ver[1];
}
$schaden_1 = "Power Kopiern!";
} else {
$schaden_1 = "Kopiern Fehlgeschlagen";
$k_mp[0] = 0;
}
$aktion_AV1[$x] = "nein";
}
################### Spieler 2
if ($technick2[type] == copy) {
$k_mp[1] = $k_mp[1] - $technick2[mp];
if ($k_mp[1] >= 0) {
if ($technick2[starke] == 1) { /////Staerke wird kopiert
$k_starke[1] = $k_starke[0] + $k_starke[1];
}
if ($technick2[speed] == 1) { /////Staerke wird kopiert
$k_speed[1] = $k_speed[0] + $k_speed[1];
}
if ($technick2[verteidigung] == 1) { /////Staerke wird kopiert
$k_ver[1] = $k_ver[0] + $k_ver[1];
}
$schaden_2 = "Power Kopiern!";
} else {
$schaden_2 = "Kopiern Fehlgeschlagen";
$k_mp[1] = 0;
}
$aktion_AV2[$x] = "nein";
}

@ -0,0 +1,98 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/designfunctions.inc.php');
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/fehlerausgabe.inc.php');
$daten_ende = mysql_Fetch_array(mysql_query("SELECT * FROM kampf_new WHERE char1='$char_id' OR char2='$char_id' LIMIT 1"));
$daten_satz = mysql_fetch_array(mysql_query("SELECT id FROM kampf WHERE db_satz='$char_id' LIMIT 1"));
if($daten_satz[id]) {
displayErrorMessage(NULL,'Sie k&ouml;nnen ihren Charakter nun abholen!', displayHistoryBackLink());
exit;
}
$chara_1x = mysql_fetch_array(mysql_query("SELECT verteidigung, speed, ausdauer, glueck, starke FROM chars WHERE id='$daten_ende[char1]' LIMIT 1"));
$chara_2x = mysql_fetch_array(mysql_query("SELECT verteidigung, speed, ausdauer, glueck, starke FROM chars WHERE id='$daten_ende[char2]' LIMIT 1"));
//##################################### EXP!!!!!!!!!
if($daten_ende[lose1] != $daten_ende[char1]) {
//////////Sieger ist Char 1 (heisst doppelte Exp fuer ihn)
$new_exp1 = round(((($chara_1x[starke] + $chara_1x[verteidigung] + $chara_1x[speed] + $chara_1x[ausdauer] + $chara_1x[glueck] + $chara_2x[starke] + $chara_2x[verteidigung] + $chara_2x[speed] + $chara_2x[ausdauer] + $chara_2x[glueck]) * 2) ) * 2);
$new_geld1 = ((($chara_1x[starke] + $chara_1x[verteidigung] + $chara_1x[speed] + $chara_1x[ausdauer] + $chara_1x[glueck] + $chara_2x[starke] + $chara_2x[verteidigung] + $chara_2x[speed] + $chara_2x[ausdauer] + $chara_2x[glueck]) / 2) ) * 2;
$new_geld1 = round($new_geld1);
$char_win = $daten_ende[char1];
$char_lose = $daten_ende[char2];
//////////Verlierer ist Char 2
$new_exp2 = round(((($chara_1x[starke] + $chara_1x[verteidigung] + $chara_1x[speed] + $chara_1x[ausdauer] + $chara_1x[glueck] + $chara_2x[starke] + $chara_2x[verteidigung] + $chara_2x[speed] + $chara_2x[ausdauer] + $chara_2x[glueck]) * 2) ));
$new_geld2 = ((($chara_1x[starke] + $chara_1x[verteidigung] + $chara_1x[speed] + $chara_1x[ausdauer] + $chara_1x[glueck] + $chara_2x[starke] + $chara_2x[verteidigung] + $chara_2x[speed] + $chara_2x[ausdauer] + $chara_2x[glueck]) / 2) );
$new_geld2 = round($new_geld2);
} else {
//////////Sieger ist Char 2 (heisst doppelte Exp fuer ihn)
$new_exp2 = round(((($chara_1x[starke] + $chara_1x[verteidigung] + $chara_1x[speed] + $chara_1x[ausdauer] + $chara_1x[glueck] + $chara_2x[starke] + $chara_2x[verteidigung] + $chara_2x[speed] + $chara_2x[ausdauer] + $chara_2x[glueck]) * 2) ) * 2);
$new_geld2 = ((($chara_1x[starke] + $chara_1x[verteidigung] + $chara_1x[speed] + $chara_1x[ausdauer] + $chara_1x[glueck] + $chara_2x[starke] + $chara_2x[verteidigung] + $chara_2x[speed] + $chara_2x[ausdauer] + $chara_2x[glueck]) / 2) ) * 2;
$new_geld2 = round($new_geld2);
$char_win = $daten_ende[char2];
$char_lose = $daten_ende[char1];
//////////Verlierer ist Char 2
$new_exp1 = round(((($chara_1x[starke] + $chara_1x[verteidigung] + $chara_1x[speed] + $chara_1x[ausdauer] + $chara_1x[glueck] + $chara_2x[starke] + $chara_2x[verteidigung] + $chara_2x[speed] + $chara_2x[ausdauer] + $chara_2x[glueck]) * 2) ));
$new_geld1 = ((($chara_1x[starke] + $chara_1x[verteidigung] + $chara_1x[speed] + $chara_1x[ausdauer] + $chara_1x[glueck] + $chara_2x[starke] + $chara_2x[verteidigung] + $chara_2x[speed] + $chara_2x[ausdauer] + $chara_2x[glueck]) / 2) );
$new_geld1 = round($new_geld1);
}
include($_SERVER['DOCUMENT_ROOT'].'ag/include/arena.php');
//######################EXP ENDE
$ze = 0;
$new_atks1 = explode(",", $daten_ende[atk1]);
$new_atks2 = explode(",", $daten_ende[atk2]);
while($ze < count($new_atks1)) {
$atks = mysql_fetch_array(mysql_query("SELECT name FROM lernen WHERE id='$new_atks1[$ze]' LIMIT 1"));
$new_atku .=$atks[name];
if($ze<count($new_atks1)) {
$new_atku .=",";
}
$ze++;
}
$ze = 0;
while($ze < count($new_atks2)) {
$atks = mysql_fetch_array(mysql_query("SELECT name FROM lernen WHERE id='$new_atks2[$ze]' LIMIT 1"));
$new_atku .=$atks[name];
if($ze<count($new_atks2)) {
$new_atku .=",";
}
$ze++;
}
mysql_query("INSERT kampf SET hp1='$daten_ende[hp1]', hp2='$daten_ende[hp2]', mp1='$daten_ende[mp1]', mp2='$daten_ende[mp2]',
attacke1='$daten_ende[atk1]', attacke2='$daten_ende[atk2]', schaden1='$daten_ende[schaden1]', schaden2='$daten_ende[schaden2]', char1='$daten_ende[char1]', char2='$daten_ende[char2]', starke1='$daten_ende[starke1]', starke2='$daten_ende[starke2]', ver1='$daten_ende[ver1]', ver2='$daten_ende[ver2]', speed1='$daten_ende[speed1]',speed2='$daten_ende[speed2]', ausdauer1='$daten_ende[ausdauer1]', ausdauer2='$daten_ende[ausdauer2]'
,exp1='$new_exp1', exp2='$new_exp2', geld1='$new_geld1', geld2='$new_geld2', arena_geld='$arena_einkommen', besucher='$arena_besucher', win='$char_win', lose='$char_lose', arena_name='$arena[name]', dauer='0', db_satz ='$daten_ende[char1]'");
mysql_query("INSERT kampf SET hp1='$daten_ende[hp1]', hp2='$daten_ende[hp2]', mp1='$daten_ende[mp1]', mp2='$daten_ende[mp2]',
attacke1='$daten_ende[atk1]', attacke2='$daten_ende[atk2]', schaden1='$daten_ende[schaden1]', schaden2='$daten_ende[schaden2]', char1='$daten_ende[char1]', char2='$daten_ende[char2]', starke1='$daten_ende[starke1]', starke2='$daten_ende[starke2]', ver1='$daten_ende[ver1]', ver2='$daten_ende[ver2]', speed1='$daten_ende[speed1]',speed2='$daten_ende[speed2]', ausdauer1='$daten_ende[ausdauer1]', ausdauer2='$daten_ende[ausdauer2]'
,exp1='$new_exp1', exp2='$new_exp2', geld1='$new_geld1', geld2='$new_geld2', arena_geld='$arena_einkommen', besucher='$arena_besucher', win='$char_win', lose='$char_lose', arena_name='$arena[name]', dauer='0', db_satz ='$daten_ende[char2]'");
mysql_query("DELETE FROM kampf_new1 WHERE char1='$daten_ende[char1]' AND char2='$daten_ende[char2]' LIMIT 1");
mysql_query("DELETE FROM kampf_new WHERE char1='$daten_ende[char1]' AND char2='$daten_ende[char2]' LIMIT 1");
mysql_query("UPDATE chars SET status='Kampf' WHERE id='$daten_ende[char1]' OR id='$daten_ende[char2]' LIMIT 2");
if($daten_satz['id']) {
displayErrorMessage(NULL,'Sie k&ouml;nnen ihren Charakter nun abholen!', displayHistoryBackLink());
exit;
}
?>

@ -0,0 +1,49 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAIOKEN SPIELER 1
if($technick1[type] == "frucht") {
$frucht_stats1 = mysql_fetch_array(mysql_query("SELECT starke, ver, speed, ausdauer, glueck FROM wochen_markt WHERE item='$chara_1[frucht]' LIMIT 1"));
$k_mp[0] = $k_mp[0] - $technick1[mp];
$k_hp[0] = $k_hp[0] - $technick1[hp];
if($k_mp[0] < 0) {
$schaden_1 = "Technik fehlgeschlagen";
$aktion_AV1[$x] = "nein";
$k_mp[0] = 0;
} else {
$schaden_1 = "Zauber Frucht";
$k_ausdauer[0] = $k_ausdauer[0] + $frucht_stats1[ausdauer];
$k_starke[0] = $k_starke[0] + ($frucht_stats1[starke]*$technick1[starke]);
$k_speed[0] = $k_speed[0] + ($frucht_stats1[speed]*$technick1[speed]);
$k_ver[0] = $k_ver[0] + ($frucht_stats1[ver]*$technick1[verteidigung]);
$k_glueck[0] = $k_glueck[0] + $frucht_stats1[glueck];
$aktion_AV1[$x] = "nein";
}}
####################KAIOKEN SPIELER 2
if($technick2[type] == "frucht") {
$frucht_stats2 = mysql_fetch_array(mysql_query("SELECT starke, ver, speed, ausdauer, glueck FROM wochen_markt WHERE item='$chara_2[frucht]' LIMIT 1"));
$k_mp[1] = $k_mp[1] - $technick2[mp];
$k_hp[1] = $k_hp[1] - $technick2[hp];
if($k_mp[1] < 0) {
$schaden_2 = "Technik fehlgeschlagen";
$aktion_AV2[$x] = "nein";
$k_mp[1] = 0;
} else {
$schaden_2 = "Zauber Frucht";
$k_ausdauer[1] = $k_ausdauer[1] + $frucht_stats2[ausdauer];
$k_starke[1] = $k_starke[1] + ($frucht_stats2[starke]*$technick2[starke]);
$k_speed[1] = $k_speed[1] + ($frucht_stats2[speed]*$technick2[speed]);
$k_ver[1] = $k_ver[1] + ($frucht_stats2[ver]*$technick2[verteidigung]);
$k_glueck[1] = $k_glueck[1] + $frucht_stats2[glueck];
$aktion_AV2[$x] = "nein";
}}
?>

@ -0,0 +1,100 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################GIFT SPIELER 1
if($runden_gif1) {
if($runden_gif1 > $x) {
$technick1_old = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$attacken_list[$runden_gif_technik1]' LIMIT 1"));
$k_starke[1] = $k_starke[1] - $technick1_old[starke];
$k_speed[1] = $k_speed[1] - $technick1_old[speed];
$k_ver[1] = $k_ver[1] - $technick1_old[verteidigung];
$k_hp[1] = $k_hp[1] - $technick1_old[hp];
} else {
$runden_gif1 = "";
$runden_gif_technik1 = "";
}
}
if($technick1[type] == "gift") {
$k_mp[0] = $k_mp[0] - $technick1[mp];
if($k_mp[0] < 0) {
$schaden_2 = "Keinen Schaden";
$schaden_1 = "Sch&auml;digen fehlgeschlagen";
$aktion_AV1[$x] = "nein";
$k_mp[0] = 0;
} else {
$schaden_1 = "Sch&auml;digen";
$runden_gif1 = $x+$technick1[runden];
$runden_gif_technik1 = $x;
$k_starke[1] = $k_starke[1] - $technick1[starke];
$k_speed[1] = $k_speed[1] - $technick1[speed];
$k_ver[1] = $k_ver[1] - $technick1[verteidigung];
$k_hp[1] = $k_hp[1] - $technick1[hp];
$aktion_AV1[$x] = "nein";
}}
####################GIFT SPIELER 2
if($runden_gif2) {
if($runden_gif2 > $x) {
$technick2_old = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$attacken_list[$runden_gif_technik2]' LIMIT 1"));
$k_starke[0] = $k_starke[0] - $technick2_old[starke];
$k_speed[0] = $k_speed[0] - $technick2_old[speed];
$k_ver[0] = $k_ver[0] - $technick2_old[verteidigung];
$k_hp[0] = $k_hp[0] - $technick2_old[hp];
} else {
$runden_gif2 = "";
$runden_gif_technik2 = "";
}
}
if($technick2[type] == "gift") {
$k_mp[1] = $k_mp[1] - $technick2[mp];
if($k_mp[1] < 0) {
$schaden_1 = "Keinen Schaden";
$schaden_2 = "Sch&auml;digen fehlgeschlagen";
$aktion_AV2[$x] = "nein";
$k_mp[1] = 0;
} else {
$schaden_2 = "Sch&auml;digen";
$runden_gif2 = $x+$technick2[runden];
$runden_gif_technik2 = $x;
$k_starke[0] = $k_starke[0] - $technick2[starke];
$k_speed[0] = $k_speed[0] - $technick2[speed];
$k_ver[0] = $k_ver[0] - $technick2[verteidigung];
$k_hp[0] = $k_hp[0] - $technick2[hp];
$aktion_AV2[$x] = "nein";
}}
?>

@ -0,0 +1,19 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAMPF HP SPIELER 1
if($technick1[type] == normal AND $technick1[hp] > 0) {
$k_hp[0] = $k_hp[0] - $technick1[hp];
}
####################KAMPF HP SPIELER 2
if($technick2[type] == normal AND $technick2[hp] > 0) {
$k_hp[1] = $k_hp[1] - $technick2[hp];
}
?>

@ -0,0 +1,43 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAMPF HP SPIELER 1
if($technick1[type] == hp) {
$k_mp[0] = $k_mp[0] - $technick1[mp];
if($k_mp[0] < 0) {
$k_mp[0] = 0;
$schaden_1 = "Keine MP";
$aktion_AV1[$x] = "nein";
} else {
$k_hp[0] = $k_hp[0] + (($k_hp1[1] / 100) * $technick1[hp]);
if($k_hp1[1] < $k_hp[0]) { $k_hp[0] = $k_hp1[1]; }
$schaden_1 = "+ $technick1[hp]% HP";
$aktion_AV1[$x] = "nein";
}}
####################KAMPF HP SPIELER 2
if($technick2[type] == hp) {
$k_mp[1] = $k_mp[1] - $technick2[mp];
if($k_mp[1] < 0) {
$k_mp[1] = 0;
$schaden_2 = "Keine MP";
$aktion_AV2[$x] = "nein";
} else {
$k_hp[1] = $k_hp[1] + (($k_hp2[1] / 100) * $technick2[hp]);
if($k_hp2[1] < $k_hp[1]) { $k_hp[1] = $k_hp2[1]; }
$schaden_2 = "+ $technick2[hp]% HP";
$aktion_AV2[$x] = "nein";
}}
?>

@ -0,0 +1,36 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAMPF HPMP SPIELER 1
if($technick1[type] == hpmp) {
$k_hp[0] = $k_hp[0] + (($k_hp1[1] / 100) * $technick1[hp]);
$k_mp[0] = $k_mp[0] + (($k_mp1[1] / 100) * $technick1[mp]);
if($k_hp1[1] < $k_hp[0]) { $k_hp[0] = $k_hp1[1]; }
if($k_mp1[1] < $k_mp[0]) { $k_mp[0] = $k_mp1[1]; }
$schaden_1 = "+ $technick1[hp]% HP/ $technick1[mp]% MP";
$aktion_AV1[$x] = "nein";
}
####################KAMPF HPMP SPIELER 2
if($technick2[type] == hpmp) {
$k_hp[1] = $k_hp[1] + (($k_hp2[1] / 100) * $technick2[hp]);
$k_mp[1] = $k_mp[1] + (($k_mp2[1] / 100) * $technick2[mp]);
if($k_hp2[1] < $k_hp[1]) { $k_hp[1] = $k_hp2[1]; }
if($k_mp2[1] < $k_mp[1]) { $k_mp[1] = $k_mp2[1]; }
$schaden_2 = "+ $technick2[hp]% HP/ $technick2[mp]% MP";
$aktion_AV2[$x] = "nein";
}
?>

@ -0,0 +1,45 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAIOKEN SPIELER 1
if($technick1[type] == kaioken) {
$k_mp[0] = $k_mp[0] - $technick1[mp];
$k_hp[0] = $k_hp[0] - $technick1[hp];
if($k_mp[0] < 0) {
$schaden_2 = "Keinen Schaden";
$schaden_1 = "kaioken fehlgeschlagen";
$aktion_AV1[$x] = "nein";
$k_mp[0] = 0;
} else {
$schaden_1 = "Kaioken";
$k_starke[0] = $k_starke[0] + $technick1[starke];
$k_speed[0] = $k_speed[0] + $technick1[speed];
$k_ver[0] = $k_ver[0] + $technick1[verteidigung];
$aktion_AV1[$x] = "nein";
}}
####################KAIOKEN SPIELER 2
if($technick2[type] == kaioken) {
$k_mp[1] = $k_mp[1] - $technick2[mp];
$k_hp[1] = $k_hp[1] - $technick2[hp];
if($k_mp[1] < 0) {
$schaden_1 = "Keinen Schaden";
$schaden_2 = "kaioken fehlgeschlagen";
$aktion_AV2[$x] = "nein";
$k_mp[1] = 0;
} else {
$k_starke[1] = $k_starke[1] + $technick2[starke];
$k_speed[1] = $k_speed[1] + $technick2[speed];
$k_ver[1] = $k_ver[1] + $technick2[verteidigung];
$aktion_AV2[$x] = "nein";
$schaden_2 = "kaioken";
}}
?>

@ -0,0 +1,35 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAIOKEN SPIELER 1
if($technick1[type] == "kaioken2") {
$k_mp[0] = ($k_mp1[1] / 100) * (100-$technick1[mp]);
$k_hp[0] = ($k_hp1[1] / 100) * (100-$technick1[hp]);
$schaden_1 = "Super Kaioken";
$k_starke[0] = $k_starke[0] + (($k_starke[0] / 100) * $technick1[starke]);
$k_speed[0] = $k_speed[0] + (($k_speed[0] / 100) * $technick1[speed]);
$k_ver[0] = $k_ver[0] + (($k_ver[0] / 100) * $technick1[verteidigung]);
$aktion_AV1[$x] = "nein";
}
####################KAIOKEN SPIELER 2
if($technick2[type] == "kaioken2") {
$k_mp[1] = ($k_mp2[1] / 100) * (100-$technick2[mp]);
$k_hp[1] = ($k_hp2[1] / 100) * (100-$technick2[hp]);
$schaden_2 = "Super Kaioken";
$k_starke[1] = $k_starke[1] + (($k_starke[1] / 100) * $technick2[starke]);
$k_speed[1] = $k_speed[1] + (($k_speed[1] / 100) * $technick2[speed]);
$k_ver[1] = $k_ver[1] + (($k_ver[1] / 100) * $technick2[verteidigung]);
$aktion_AV2[$x] = "nein";
}
?>

@ -0,0 +1,24 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include "kampf/tausch2.php"; //////////////////Muss ganz oben sein wegen technik Tauschen
include "kampf/frucht.php";
include "kampf/runde.php";
include "kampf/mp.php";
include "kampf/hp.php";
include "kampf/hp2.php";
include "kampf/SSJ.php";
include "kampf/kaioken.php";
include "kampf/kaioken2.php";
include "kampf/copy.php";
include "kampf/lose.php";
include "kampf/lose2.php";
include "kampf/ausdauer.php";
include "kampf/mpv.php";
include "kampf/tausch.php";
include "kampf/hpmp.php";
?>

@ -0,0 +1,74 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
if(!$aktion_AV1[$x]) {
if($zufall_pl1 > $play2_ausweich) {
$alt_hp = $k_hp[1];
$charsa1_def = $k_ver[1]+$technick2[verteidigung];
$charsa1_4_def = ($k_ver[1]+$technick2[verteidigung]) / 1.1;
if($charsa1_def <= 2) { $charsa1_def = 2; }
if($charsa1_4_def < 1) { $charsa1_4_def = 1; }
$charsa1_def = mt_rand($charsa1_4_def,$charsa1_def);
$charsa1_str = $k_starke[0]*1.2+$technick1[starke];
$charsa1_4_str = ($k_starke[0]*1.2+$technick1[starke])+1;
if($charsa1_str <= 2) { $charsa1_str = 2; }
if($charsa1_4_str < 1) { $charsa1_4_str = 1; }
$charsa1_str = mt_rand($charsa1_4_str,$charsa1_str);
$k_hp[1] = round(($k_hp[1] + $charsa1_def - $charsa1_str + mt_rand(1,20)));
$schaden_1 = $alt_hp - $k_hp[1];
if($alt_hp < $k_hp[1]) { $k_hp[1] = $alt_hp; $schaden_1 = 0; }
} else {
$schaden_1 = "Keinen Schaden";
}
}
if(!$aktion_AV2[$x]) {
if($zufall_pl2 > $play1_ausweich) {
$alt_hp = $k_hp[0];
$charsa2_def = $k_ver[0]+$technick1[verteidigung];
$charsa2_4_def = ($k_ver[0]+$technick1[verteidigung]) / 1.1;
if($charsa2_def <= 2) { $charsa2_def = 2; }
if($charsa2_4_def < 1) { $charsa2_4_def = 1; }
$charsa2_def = mt_rand($charsa2_4_def,$charsa2_def);
$charsa2_str = $k_starke[1]*1.2+$technick2[starke];
$charsa2_4_str = ($k_starke[1] *1.2 +$technick2[starke]) +1;
if($charsa1_str <= 2) { $charsa1_str = 2; }
if($charsa2_4_str < 1) { $charsa2_4_str = 1; }
$charsa2_str = mt_rand($charsa2_4_str,$charsa2_str);
$k_hp[0] = round(($k_hp[0] + $charsa2_def - $charsa2_str + mt_rand(1,20)));
$schaden_2 = $alt_hp - $k_hp[0];
if($alt_hp < $k_hp[0]) { $k_hp[0] = $alt_hp; $schaden_2 = 0; }
} else {
$schaden_2 = "Keinen Schaden";
}}
if(!$technick1[name]) { $technick1[name] = "Normaler Kick"; }
if(!$technick2[name]) { $technick2[name] = "Normaler Kick"; }
if($k_hp[0]<0) { $k_hp7[0] = 0; } else { $k_hp7[0] = $k_hp[0]; }
if($k_mp[0]<0) { $k_mp7[0] = 0; } else { $k_mp7[0] = $k_mp[0]; }
if($k_hp[1]<0) { $k_hp7[1] = 0; } else { $k_hp7[1] = $k_hp[1]; }
if($k_mp[1]<0) { $k_mp7[1] = 0; } else { $k_mp7[1] = $k_mp[1]; }
?>

@ -0,0 +1,193 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$uzze=0;
while($uzze < 10) {
$aktion_AV1[$uzze] = "";
$aktion_AV2[$uzze] = "";
$uzze++;
}
$ssj_tech_1="";
$ssj_tech_2="";
$play1_ausweich="";
$play2_ausweich="";
$k_exp[0] = "";
$X23 = "";
$X13 = "";
$schaden_1="";
$schaden_2="";
################## Kaempfer 1
$k_hp1 = explode(",", $chara_1[hp]);
$k_mp1 = explode(",", $chara_1[mp]);
$k_hp1[0] = $k_hp1[1];
$k_mp1[0] = $k_mp1[1];
$k_starke[0] = $chara_1[starke] + $k_rustung[ru_mal];
$k_speed[0] = $chara_1[speed];
$k_ver[0] = $chara_1[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[0] = $chara_1[ausdauer];
$k_glueck[0] = $chara_1[glueck];
$k_attacke1 = explode(",", $chara_1[attacken]);
$k_hp[0] = round($k_hp1[0]);
$k_mp[0] = round($k_mp1[0]);
$k_aufgabe_a_1 = $k_hp1[1] / 100;
$k_aufgabe[0] = $k_aufgabe_a_1 * $chara_1[aufgeben];
######################################Kaempfer2
$k_hp2 = explode(",", $chara_2[hp]);
$k_mp2 = explode(",", $chara_2[mp]);
$k_hp2[0] = $k_hp2[1];
$k_mp2[0] = $k_mp2[1];
$k_starke[1] = $chara_2[starke] + $k_rustung[ru_mal];
$k_speed[1] = $chara_2[speed];
$k_ver[1] = $chara_2[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[1] = $chara_2[ausdauer];
$k_glueck[1] = $chara_2[glueck];
$k_attacke2 = explode(",", $chara_2[attacken]);
$k_hp[1] = round($k_hp2[0]);
$k_mp[1] = round($k_mp2[0]);
$k_aufgabe_a_2 = $k_hp2[1] / 100;
$k_aufgabe[1] = $k_aufgabe_a_2 * $chara_2[aufgeben];
$x=0;
mysql_query("INSERT liga_kampf SET hp1='$k_hp[0]', hp2='$k_hp[1]', mp1='$k_mp[0]', mp2='$k_mp[1]', schaden1='$schaden_1', schaden2='$schaden_2', attacke1='$technick1[name]', attacke2='$technick2[name]', char1='$chara_1[id]', char2='$chara_2[id]', starke1='$k_starke[0]', starke2='$k_starke[1]', ver1='$k_ver[0]', ver2='$k_ver[1]', speed1='$k_speed[0]', speed2='$k_speed[1]', ausdauer1='$k_ausdauer[0]', ausdauer2='$k_ausdauer[1]'");
while($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$technick1 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$prozent_technik1 = (20*$technick1[aktiv])-20;
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick2 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2[$x]' LIMIT 10"));
$prozent_technik2 = (20*$technick2[aktiv])-20;
$technick2 = mysql_fetch_array(mysql_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 "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 = $speeds_char1;
$speed_char2 = $speeds_char2;
$aussetzten_runde = ""; ////// MUSS SO BLEIBEN WICHTIG
##################################MP, SSJ Verwandlungen, HP, Koerper Tausch Technicken
include "kampf/majin.php";
if(!$aussetzten_runde) {
include "kampf/atk_wert.php";
include "kampf/tausch2.php"; //////////////////Muss ganz oben sein wegen technik Tauschen
include "kampf/frucht.php";
include "kampf/runde.php";
include "kampf/mp.php";
include "kampf/hp.php";
include "kampf/hp2.php";
include "kampf/SSJ.php";
include "kampf/kaioken.php";
include "kampf/kaioken2.php";
include "kampf/copy.php";
include "kampf/lose.php";
include "kampf/lose2.php";
include "kampf/ausdauer.php";
include "kampf/mpv.php";
include "kampf/tausch.php";
include "kampf/hpmp.php";
}
include "kampf/atk_wert.php";
#####################################KAMPF SYSTEM
include "kampf/kampf_rechnung.php";
$db_query = mysql_fetch_array(mysql_query("SELECT * FROM liga_kampf WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') AND dauer='0' order by id DESC LIMIT 1"));
mysql_query("UPDATE liga_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]' WHERE id='$db_query[id]'");
$x++;
}
###########################EXP VERTEILUNG
$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] = 0;
$k_geld[1] = 0;
$k_exp[0] = 0;
$k_geld[0] = 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] = 0;
$k_geld[1] = 0;
$k_exp[0] = 0;
$k_geld[0] = 0;
}
if($k_exp[0]) { $s=2; } else { $s++; }
}
$punkt_sieger = (11-$x) + 500;
$punkt_verlierer = 0;
$dauer_Z = time();
mysql_query("UPDATE chars SET liga_siege=liga_siege+1, liga_punkte=liga_punkte+'$punkt_sieger' WHERE id='$sieger' LIMIT 1");
mysql_query("UPDATE chars SET liga_niederlagen=liga_niederlagen+1, liga_punkte=liga_punkte+'$punkt_verlierer' WHERE id='$verlierer' LIMIT 1");
mysql_query("UPDATE liga_kampf SET 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]'");
?>

@ -0,0 +1,49 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAIOKEN-LOSE SPIELER 1
if($technick1[type] == lose) {
$k_mp[0] = $k_mp[0] - $technick1[mp];
if($k_mp[0] < 0) {
$schaden_2 = "Keinen Schaden";
$schaden_1 = "Schw&auml;chen fehlgeschlagen";
$aktion_AV1[$x] = "nein";
$k_mp[0] = 0;
} else {
$schaden_1 = "Schw&auml;chen";
$k_hp[0] = $k_hp[0] - (($k_hp1[1] / 100) * $technick1[hp]);
if($k_hp[0]< 1) { $k_hp[0] = 0; }
$k_starke[1] = $k_starke[1] - (($k_starke[1] / 100) * $technick1[starke]);
$k_speed[1] = $k_speed[1] - (($k_speed[1] / 100) * $technick1[speed]);
$k_ver[1] = $k_ver[1] - (($k_ver[1] / 100) * $technick1[verteidigung]);
$aktion_AV1[$x] = "nein";
}}
####################KAIOKEN-LOSE SPIELER 2
if($technick2[type] == lose) {
$k_mp[1] = $k_mp[1] - $technick2[mp];
if($k_mp[1] < 0) {
$schaden_1 = "Keinen Schaden";
$schaden_2 = "Schw&auml;chen fehlgeschlagen";
$aktion_AV2[$x] = "nein";
$k_mp[1] = 0;
} else {
$k_starke[0] = $k_starke[0] - (($k_starke[0] / 100) * $technick2[starke]);
$k_speed[0] = $k_speed[0] - (($k_speed[0] / 100) * $technick2[speed]);
$k_ver[0] = $k_ver[0] - (($k_ver[0] / 100) * $technick2[verteidigung]);
$k_hp[1] = $k_hp[1] - (($k_hp2[1] / 100) * $technick2[hp]);
if($k_hp[0]< 1) { $k_hp[0] = 0; }
$aktion_AV2[$x] = "nein";
$schaden_2 = "Schw&auml;chen";
}}
?>

@ -0,0 +1,44 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAIOKEN-LOSE SPIELER 1
if($technick1[type] == "lose2") {
$k_mp[0] = $k_mp[0] - $technick1[mp];
if($k_mp[0] < 0) {
$schaden_1 = "Schw&auml;chen fehlgeschlagen";
$k_mp[0] = 0;
} else {
if($technick1[starke] >= mt_rand(1,100)) {
$schaden_1 = "Schw&auml;chen";
$k_mp[1] = ($k_mp2[1] / 100) * 20;
} else {
$schaden_1 = "Schw&auml;chen fehlgeschlagen";
}
}
$aktion_AV1[$x] = "nein";
}
####################KAIOKEN-LOSE SPIELER 2
if($technick2[type] == "lose2") {
$k_mp[1] = $k_mp[1] - $technick2[mp];
if($k_mp[1] < 0) {
$schaden_2 = "Schw&auml;chen fehlgeschlagen";
$k_mp[1] = 0;
} else {
if($technick2[starke] >= mt_rand(1,100)) {
$schaden_2 = "Schw&auml;chen";
$k_mp[0] = ($k_mp1[1] / 100) * 20;
} else {
$schaden_2 = "Schw&auml;chen fehlgeschlagen";
}
}
$aktion_AV2[$x] = "nein";
}
?>

@ -0,0 +1,62 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################Majin SPIELER 1
if($technick1[type] == "majin") {
$k_mp[0] = $k_mp[0] - $technick1[mp];
if($k_mp[0] < 0) {
$schaden_1 = "Majin Verwandlung fehlgeschlagen";
$aktion_AV1[$x] = "nein";
$k_mp[0] = 0;
} else {
$k_starke[1] = $k_starke[1] * ($technick1[starke]-0.5);
$k_speed[1] = $k_speed[1] * ($technick1[speed]-0.5);
$k_ver[1] = $k_ver[1] * ($technick1[verteidigung]-0.5);
$alt_hp = $k_hp[1];
$k_hp[1] = round($k_hp[1] - ($k_starke[1] / 2));
$schaden_1 = "$technick1[name]";
$schaden_2 = $alt_hp - $k_hp[1];
if($alt_hp < $k_hp[1]) { $k_hp[1] = $alt_hp; $schaden_2 = 0; }
$aktion_AV1[$x] = "nein";
$aktion_AV2[$x] = "nein";
$aussetzten_runde = 1;
}}
####################Majin SPIELER 2
if($technick2[type] == "majin") {
$k_mp[1] = $k_mp[1] - $technick2[mp];
if($k_mp[1] < 0) {
$schaden_2 = "Majin Verwandlung fehlgeschlagen";
$aktion_AV2[$x] = "nein";
$k_mp[1] = 0;
} else {
$k_starke[0] = $k_starke[0] * ($technick2[starke]-0.5);
$k_speed[0] = $k_speed[0] * ($technick2[speed]-0.5);
$k_ver[0] = $k_ver[0] * ($technick2[verteidigung]-0.5);
$alt_hp = $k_hp[0];
$k_hp[0] = round($k_hp[0] - ($k_starke[0] / 2));
$schaden_2 = "$technick2[name]";
$schaden_1 = $alt_hp - $k_hp[0];
if($alt_hp < $k_hp[0]) { $k_hp[0] = $alt_hp; $schaden_1 = 0; }
$aktion_AV1[$x] = "nein";
$aktion_AV2[$x] = "nein";
$aussetzten_runde = 1;
}}
?>

@ -0,0 +1,28 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAMPF MP SPIELER 1
if($technick1[type] == normal AND $technick1[mp] > 0) {
$k_mp[0] = $k_mp[0] - $technick1[mp];
if($k_mp[0] < 0) {
$k_hp[0] = $k_hp[0] + ($k_mp[0] * 10);
$k_mp[0] = 0;
}
}
####################KAMPF MP SPIELER 2
if($technick2[type] == normal AND $technick2[mp] > 0) {
$k_mp[1] = $k_mp[1] - $technick2[mp];
if($k_mp[1] < 0) {
$k_hp[1] = $k_hp[1] + ($k_mp[1] * 10);
$k_mp[1] = 0;
}
}
?>

@ -0,0 +1,24 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAMPF MPV SPIELER 1
if($technick1[type] == mpv) {
$k_mp[1] = $k_mp[1] - $technick1[mp];
if($k_mp[1] < 0) {
$k_mp[1] = 0;
}
$aktion_AV1[$x] = "nein";
}
if($technick2[type] == mpv) {
$k_mp[0] = $k_mp[0] - $technick2[mp];
if($k_mp[0] < 0) {
$k_mp[0] = 0;
}
$aktion_AV2[$x] = "nein";
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

@ -0,0 +1,50 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
if($technick1[type] == "runde") {
$k_mp[0] = $k_mp[0] - $technick1[mp];
if($k_mp[0] < 0) {
$schaden_1 = "$technick1[name] fehlgeschlagen";
$aktion_AV1[$x] = "nein";
$k_mp[0] = 0;
} else {
if($runden_type1 < $technick1[hp]-1) { /////////HP wert sagt an wieviel runden die technik dauert
$schaden_1 = "Energie Sammeln";
$play1_ausweich = 0;
$aktion_AV1[$x] = "nein";
$runden_type1++;
} else {
$aktion_AV1[$x] = "";
$runden_type1=0;
}
}
}
if($technick2[type] == "runde") {
$k_mp[1] = $k_mp[1] - $technick2[mp];
if($k_mp[1] < 0) {
$schaden_2 = "$technick2[name] fehlgeschlagen";
$aktion_AV2[$x] = "nein";
$k_mp[1] = 0;
} else {
if($runden_type2 < $technick2[hp]-1) { /////////HP wert sagt an wieviel runden die technik dauert
$schaden_2 = "Energie Sammeln";
$play2_ausweich = 0;
$aktion_AV2[$x] = "nein";
$runden_type2++;
} else {
$aktion_AV2[$x] = "";
$runden_type2=0;
}
}
}
?>

@ -0,0 +1,78 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################KAIOKEN SPIELER 1
///////////////Damit es fuer xxx runden bleibt!
if($old_ausweich_wert) {
if($schatten_runde > $x) {
$play1_ausweich=$old_ausweich_wert;
} else {
$old_ausweich_wert = "";
$schatten_runden = "";
}
}
///////////////ENDE
if($technick1[type] == "schatten") {
$k_mp[0] = $k_mp[0] - $technick1[mp];
$k_hp[0] = $k_hp[0] - $technick1[hp];
if($k_mp[0] < 0) {
$schaden_2 = "Keinen Schaden";
$schaden_1 = "Keine Kraft";
$aktion_AV1[$x] = "nein";
$k_mp[0] = 0;
} else {
///////////////////die rechnung sozusagen.
if(!$old_ausweich_wert) {
$old_ausweich_wert = $technick1[speed];
$schatten_runden = $x+$technick1[starke];
}
$play1_ausweich=$old_ausweich_wert;
}}
####################KAIOKEN SPIELER 2
///////////////Damit es fuer xxx runden bleibt!
if($old_ausweich_wert2) {
if($schatten_runde2 > $x) {
$play2_ausweich=$old_ausweich_wert2;
} else {
$old_ausweich_wert2 = "";
$schatten_runden2 = "";
}
}
///////////////ENDE
if($technick2[type] == "schatten") {
$k_mp[1] = $k_mp[1] - $technick2[mp];
$k_hp[1] = $k_hp[1] - $technick2[hp];
if($k_mp[1] < 0) {
$schaden_1 = "Keinen Schaden";
$schaden_2 = "Keine Kraft";
$aktion_AV2[$x] = "nein";
$k_mp[1] = 0;
} else {
if(!$old_ausweich_wert2) {
$old_ausweich_wert2 = $technick2[speed];
$schatten_runden2 = $x+$technick2[starke];
}
$play2_ausweich=$old_ausweich_wert2;
}}
?>

@ -0,0 +1,117 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
####################SUMMON SPIELER 1
if($runden_summon1) {
if($runden_summon1 == $x) {
$user_summon_id = mysql_fetch_array(mysql_query("SELECT f.starke, f.speed, f.verteidigung, f.ausdauer, f.hp, f.mp, f.level, m.name FROM user u LEFT JOIN quest_fang f ON(f.id=u.summon) LEFT JOIN quest_monster m ON(m.id=f.monster) WHERE u.id='$chara_1[besitzer]' LIMIT 1"));
$k_starke[0] = $k_starke[0] - $user_summon_id[starke];
$k_speed[0] = $k_speed[0] - $user_summon_id[speed];
$k_ver[0] = $k_ver[0] - $user_summon_id[verteidigung];
$k_ausdauer[0] = $k_ausdauer[0] - $user_summon_id[ausdauer];
$k_hp[0] = $k_hp[0] - $user_summon_id[hp];
$k_mp[0] = $k_mp[0] - $user_summon_id[mp];
$runden_summon1 = 0;
}
}
if($technick1[type] == "summon") {
$k_mp[0] = $k_mp[0] - $technick1[mp];
$k_hp[0] = $k_hp[0] - $technick1[hp];
if($k_mp[0] < 0) {
$schaden_1 = "Summon fehlgeschlagen";
$aktion_AV1[$x] = "nein";
$k_mp[0] = 0;
} else {
if(!$chara_1[besitzer]) { $chara_1[besitzer] = $charakter[besitzer]; }
$user_summon_id = mysql_fetch_array(mysql_query("SELECT f.starke, f.speed, f.verteidigung, f.ausdauer, f.hp, f.mp, m.level, m.name FROM user u LEFT JOIN quest_fang f ON(f.id=u.summon) LEFT JOIN quest_monster m ON(m.id=f.monster) WHERE u.id='$chara_1[besitzer]' LIMIT 1"));
if($user_summon_id[level]>$technick1[maxlvl]) {
$schaden_1 = "$user_summon_id[name] ist zu Stark";
$aktion_AV1[$x] = "nein";
} else {
$schaden_1 = "$user_summon_id[name]";
$runden_summon1 = $x+$technick1[starke];
$k_starke[0] = $k_starke[0] + $user_summon_id[starke];
$k_speed[0] = $k_speed[0] + $user_summon_id[speed];
$k_ver[0] = $k_ver[0] + $user_summon_id[verteidigung];
$k_ausdauer[0] = $k_ausdauer[0] + $user_summon_id[ausdauer];
$k_hp[0] = $k_hp[0] + $user_summon_id[hp];
$k_mp[0] = $k_mp[0] + $user_summon_id[mp];
$aktion_AV1[$x] = "nein";
}
}
}
####################KAIOKEN SPIELER 2
if($runden_summon2) {
if($runden_summon2 == $x) {
$user_summon_id = mysql_fetch_array(mysql_query("SELECT f.starke, f.speed, f.verteidigung, f.ausdauer, f.hp, f.mp, f.level, m.name FROM user u LEFT JOIN quest_fang f ON(f.id=u.summon) LEFT JOIN quest_monster m ON(m.id=f.monster) WHERE u.id='$chara_2[besitzer]' LIMIT 1"));
$k_starke[1] = $k_starke[1] - $user_summon_id[starke];
$k_speed[1] = $k_speed[1] - $user_summon_id[speed];
$k_ver[1] = $k_ver[1] - $user_summon_id[verteidigung];
$k_ausdauer[1] = $k_ausdauer[1] - $user_summon_id[ausdauer];
$k_hp[1] = $k_hp[1] - $user_summon_id[hp];
$k_mp[1] = $k_mp[1] - $user_summon_id[mp];
$runden_summon2 = 0;
}
}
if($technick2[type] == "summon") {
$k_mp[1] = $k_mp[1] - $technick2[mp];
$k_hp[1] = $k_hp[1] - $technick2[hp];
if($k_mp[1] < 0) {
$schaden_1 = "Keinen Schaden";
$schaden_2 = "Summon fehlgeschlagen";
$aktion_AV2[$x] = "nein";
$k_mp[1] = 0;
} else {
$user_summon_id = mysql_fetch_array(mysql_query("SELECT f.starke, f.speed, f.verteidigung, f.ausdauer, f.hp, f.mp, m.level, m.name FROM user u LEFT JOIN quest_fang f ON(f.id=u.summon) LEFT JOIN quest_monster m ON(m.id=f.monster) WHERE u.id='$chara_2[besitzer]' LIMIT 1"));
if($user_summon_id[level]>$technick2[maxlvl]) {
$schaden_2 = "$user_summon_id[name] ist zu Stark";
$aktion_AV2[$x] = "nein";
} else {
$schaden_2 = "$user_summon_id[name]";
$runden_summon2 = $x+$technick2[starke];
$k_starke[1] = $k_starke[1] + $user_summon_id[starke];
$k_speed[1] = $k_speed[1] + $user_summon_id[speed];
$k_ver[1] = $k_ver[1] + $user_summon_id[verteidigung];
$k_ausdauer[1] = $k_ausdauer[1] + $user_summon_id[ausdauer];
$k_hp[1] = $k_hp[1] + $user_summon_id[hp];
$k_mp[1] = $k_mp[1] + $user_summon_id[mp];
$aktion_AV2[$x] = "nein";
}
}
}
?>

@ -0,0 +1,124 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
if (!function_exists('getKTChance')) {
function getKTChance($ktuser_luck, $ktvictim_luck) {
$chance = 50;
$ktvictim_luck= mt_rand(0, $ktvictim_luck);
$ktuser_luck = mt_rand(0, $ktuser_luck);
if($ktvictim_luck < ($ktuser_luck*0.25)) {
$chance = 75;
}
if($ktvictim_luck > ($ktuser_luck*1.75)) {
$chance = 25;
}
return $chance;
}
}
################### Spieler 1
$chance = getKTChance($k_glueck[0], $k_glueck[1]);
$random = mt_rand(0,100);
if ($technick1['type'] == tausch) {
if ($k_mp[0] >= $technick1['mp']) {
if($random <= $chance) { //Trefferchance abhängig vom ausgewürfeltem Glück
if ($kampf_info['rasse'] != "NPC") { ///BEI NPCS WIRD KOERPER TAUSCH GEBLOCKT
$k_starke_alt[0] = $k_starke[0];
$k_speed_alt[0] = $k_speed[0];
$k_ver_alt[0] = $k_ver[0];
$k_ausdauer_alt[0] = $k_ausdauer[0];
$k_hp_alt[0] = $k_hp[0];
$k_starke_alt[1] = $k_starke[1];
$k_speed_alt[1] = $k_speed[1];
$k_ver_alt[1] = $k_ver[1];
$k_ausdauer_alt[1] = $k_ausdauer[1];
$k_hp_alt[1] = $k_hp[1];
$k_starke[0] = $k_starke_alt[1];
$k_speed[0] = $k_speed_alt[1];
$k_ver[0] = $k_ver_alt[1];
$k_ausdauer[0] = $k_ausdauer_alt[1];
$k_hp[0] = $k_hp_alt[1];
$k_starke[1] = $k_starke_alt[0];
$k_speed[1] = $k_speed_alt[0];
$k_ver[1] = $k_ver_alt[0];
$k_ausdauer[1] = $k_ausdauer_alt[0];
$k_hp[1] = $k_hp_alt[0];
$k_mp[0] = $k_mp[0] - $technick1['mp'];
$schaden_1 = "K&ouml;rpertausch";
}
} else {
$k_mp[0] = $k_mp[0] - $technick1['mp'];
if ($k_mp[0] < 0) {
$k_mp[0] = 0;
}
$schaden_1 = "K&ouml;rpertausch fehlgeschlagen";
}
}
else {
$schaden_1 = "K&ouml;rpertausch fehlgeschlagen";
}
$aktion_AV1[$x] = "nein";
}
################### Spieler 2
$chance = getKTChance($k_glueck[1], $k_glueck[0]);
$random = mt_rand(0,100);
if ($technick2['type'] == tausch) {
if ($k_mp[1] >= $technick2['mp']) {
if($random <= $chance) { //Trefferchance abhängig vom ausgewürfeltem Glück
$k_starke_alt[0] = $k_starke[0];
$k_speed_alt[0] = $k_speed[0];
$k_ver_alt[0] = $k_ver[0];
$k_ausdauer_alt[0] = $k_ausdauer[0];
$k_hp_alt[0] = $k_hp[0];
$k_starke_alt[1] = $k_starke[1];
$k_speed_alt[1] = $k_speed[1];
$k_ver_alt[1] = $k_ver[1];
$k_ausdauer_alt[1] = $k_ausdauer[1];
$k_hp_alt[1] = $k_hp[1];
$k_starke[0] = $k_starke_alt[1];
$k_speed[0] = $k_speed_alt[1];
$k_ver[0] = $k_ver_alt[1];
$k_ausdauer[0] = $k_ausdauer_alt[1];
$k_hp[0] = $k_hp_alt[1];
$k_starke[1] = $k_starke_alt[0];
$k_speed[1] = $k_speed_alt[0];
$k_ver[1] = $k_ver_alt[0];
$k_ausdauer[1] = $k_ausdauer_alt[0];
$k_hp[1] = $k_hp_alt[0];
$k_mp[1] = $k_mp[1] - $technick2['mp'];
$schaden_2 = "K&ouml;rpertausch";
} else {
$k_mp[1] = $k_mp[1] - $technick2['mp'];
if ($k_mp[1] < 0) {
$k_mp[1] = 0;
}
$schaden_1 = "K&ouml;rpertausch fehlgeschlagen";
}
}
else {
$schaden_2 = "K&ouml;rpertausch fehlgeschlagen";
}
$aktion_AV2[$x] = "nein";
}
?>

@ -0,0 +1,59 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
################### Spieler 1
if($technick1[type] == "tausch2") {
$k_mp[0] = $k_mp[0] - $technick1[mp];
if($k_mp[0] >= 0) {
$prozent_technik1 = 0;
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick2[id]' LIMIT 10"));
$technick1[speed]=$technick1[speed]+(($technick1[speed]/100)*$prozent_technik1);
$technick1[verteidigung]=$technick1[verteidigung]+(($technick1[verteidigung]/100)*$prozent_technik1);
$technick1[starke]=$technick1[starke]+(($technick1[starke]/100)*$prozent_technik1);
$speeds_char1 = ($k_speed[0] + $technick1[speed]);
$speeds_char1_4 = ($k_speed[0] + $technick1[speed]) / 1.5;
if($speeds_char1_4 < 1) { $speeds_char1_4 = 1; }
$speed_char1 = mt_rand($speeds_char1_4,$speeds_char1);
} else {
$k_mp[0] = $k_mp[0] - $technick1[mp];
$schaden_1 = "Techniktausch Fehlgeschlagen";
$aktion_AV1[$x] = "nein";
}
}
################### Spieler 2
if($technick2[type] == "tausch2") {
$k_mp[1] = $k_mp[1] - $technick2[mp];
if($k_mp[1] >= 0) {
$prozent_technik2 = 0;
$technick2 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[id]' LIMIT 10"));
$technick2[speed]=$technick2[speed]+(($technick2[speed]/100)*$prozent_technik2);
$technick2[verteidigung]=$technick2[verteidigung]+(($technick2[verteidigung]/100)*$prozent_technik2);
$technick2[starke]=$technick2[starke]+(($technick2[starke]/100)*$prozent_technik2);
$speeds_char2 = ($k_speed[1] + $technick2[speed]);
$speeds_char2_4 = ($k_speed[1] + $technick2[speed]) / 1.5;
if($speeds_char2_4 < 1) { $speeds_char2_4 = 1; }
$speed_char2 = mt_rand($speeds_char2_4,$speeds_char2);
} else {
$k_mp[0] = $k_mp[0] - $technick1[mp];
$schaden_2 = "Techniktausch Fehlgeschlagen";
$aktion_AV2[$x] = "nein";
}
}

@ -0,0 +1,193 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$uzze=0;
while($uzze < 10) {
$aktion_AV1[$uzze] = "";
$aktion_AV2[$uzze] = "";
$uzze++;
}
$ssj_tech_1="";
$ssj_tech_2="";
$play1_ausweich="";
$play2_ausweich="";
$k_exp[0] = "";
$X23 = "";
$X13 = "";
$schaden_1="";
$schaden_2="";
################## Kaempfer 1
$k_hp1 = explode(",", $chara_1[hp]);
$k_mp1 = explode(",", $chara_1[mp]);
$k_hp1[0] = $k_hp1[1];
$k_mp1[0] = $k_mp1[1];
$k_starke[0] = $chara_1[starke] + $k_rustung[ru_mal];
$k_speed[0] = $chara_1[speed];
$k_ver[0] = $chara_1[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[0] = $chara_1[ausdauer];
$k_glueck[0] = $chara_1[glueck];
$k_attacke1 = explode(",", $chara_1[attacken]);
$k_hp[0] = round($k_hp1[0]);
$k_mp[0] = round($k_mp1[0]);
$k_aufgabe_a_1 = $k_hp1[1] / 100;
$k_aufgabe[0] = $k_aufgabe_a_1 * $chara_1[aufgeben];
######################################Kaempfer2
$k_hp2 = explode(",", $chara_2[hp]);
$k_mp2 = explode(",", $chara_2[mp]);
$k_hp2[0] = $k_hp2[1];
$k_mp2[0] = $k_mp2[1];
$k_starke[1] = $chara_2[starke] + $k_rustung[ru_mal];
$k_speed[1] = $chara_2[speed];
$k_ver[1] = $chara_2[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[1] = $chara_2[ausdauer];
$k_glueck[1] = $chara_2[glueck];
$k_attacke2 = explode(",", $chara_2[attacken]);
$k_hp[1] = round($k_hp2[0]);
$k_mp[1] = round($k_mp2[0]);
$k_aufgabe_a_2 = $k_hp2[1] / 100;
$k_aufgabe[1] = $k_aufgabe_a_2 * $chara_2[aufgeben];
$x=0;
mysql_query("INSERT turnier_kampf SET hp1='$k_hp[0]', hp2='$k_hp[1]', mp1='$k_mp[0]', mp2='$k_mp[1]', schaden1='$schaden_1', schaden2='$schaden_2', attacke1='$technick1[name]', attacke2='$technick2[name]', char1='$chara_1[id]', char2='$chara_2[id]', starke1='$k_starke[0]', starke2='$k_starke[1]', ver1='$k_ver[0]', ver2='$k_ver[1]', speed1='$k_speed[0]', speed2='$k_speed[1]', ausdauer1='$k_ausdauer[0]', ausdauer2='$k_ausdauer[1]'");
while($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$technick1 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$prozent_technik1 = (20*$technick1[aktiv])-20;
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick2 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2[$x]' LIMIT 10"));
$prozent_technik2 = (20*$technick2[aktiv])-20;
$technick2 = mysql_fetch_array(mysql_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 "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 = $speeds_char1;
$speed_char2 = $speeds_char2;
$aussetzten_runde = ""; ////// MUSS SO BLEIBEN WICHTIG
##################################MP, SSJ Verwandlungen, HP, Koerper Tausch Technicken
include "kampf/majin.php";
if(!$aussetzten_runde) {
include "kampf/atk_wert.php";
include "kampf/tausch2.php"; //////////////////Muss ganz oben sein wegen technik Tauschen
include "kampf/frucht.php";
include "kampf/runde.php";
include "kampf/mp.php";
include "kampf/hp.php";
include "kampf/hp2.php";
include "kampf/SSJ.php";
include "kampf/kaioken.php";
include "kampf/kaioken2.php";
include "kampf/copy.php";
include "kampf/lose.php";
include "kampf/lose2.php";
include "kampf/ausdauer.php";
include "kampf/mpv.php";
include "kampf/tausch.php";
include "kampf/hpmp.php";
}
include "kampf/atk_wert.php";
#####################################KAMPF SYSTEM
include "kampf/kampf_rechnung.php";
$db_query = mysql_fetch_array(mysql_query("SELECT * FROM turnier_kampf WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') AND dauer='0' order by id DESC LIMIT 1"));
mysql_query("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]' WHERE id='$db_query[id]'");
$x++;
}
###########################EXP VERTEILUNG
$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] = (($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] = (($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 / 6)) / 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] = ($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 / 6)) * 2;
$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] = ($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] = ($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 / 6)) * 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)) / 2) * 5;
$k_geld[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 / 6)) / 2) * 2;
}
if($k_exp[0]) { $s=2; } else { $s++; }
}
$dauer_Z = time();
mysql_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]'");
?>

@ -0,0 +1,207 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$uzze=0;
while($uzze < 10) {
$aktion_AV1[$uzze] = "";
$aktion_AV2[$uzze] = "";
$uzze++;
}
$ssj_tech_1="";
$ssj_tech_2="";
$play1_ausweich="";
$play2_ausweich="";
$k_exp[0] = "";
$X23 = "";
$X13 = "";
$schaden_1="";
$schaden_2="";
################## Kaempfer 1
$k_hp1 = explode(",", $chara_1[hp]);
$k_mp1 = explode(",", $chara_1[mp]);
$k_hp1[0] = $k_hp1[1];
$k_mp1[0] = $k_mp1[1];
$k_starke[0] = $chara_1[starke] + $k_rustung[ru_mal];
$k_speed[0] = $chara_1[speed];
$k_ver[0] = $chara_1[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[0] = $chara_1[ausdauer];
$k_glueck[0] = $chara_1[glueck];
$k_attacke1 = explode(",", $chara_1[attacken]);
$k_hp[0] = round($k_hp1[0]);
$k_mp[0] = round($k_mp1[0]);
$k_aufgabe_a_1 = $k_hp1[1] / 100;
$k_aufgabe[0] = $k_aufgabe_a_1 * $chara_1[aufgeben];
######################################Kaempfer2
$k_hp2 = explode(",", $chara_2[hp]);
$k_mp2 = explode(",", $chara_2[mp]);
$k_hp2[0] = $k_hp2[1];
$k_mp2[0] = $k_mp2[1];
$k_starke[1] = $chara_2[starke] + $k_rustung[ru_mal];
$k_speed[1] = $chara_2[speed];
$k_ver[1] = $chara_2[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[1] = $chara_2[ausdauer];
$k_glueck[1] = $chara_2[glueck];
$k_attacke2 = explode(",", $chara_2[attacken]);
$k_hp[1] = round($k_hp2[0]);
$k_mp[1] = round($k_mp2[0]);
$k_aufgabe_a_2 = $k_hp2[1] / 100;
$k_aufgabe[1] = $k_aufgabe_a_2 * $chara_2[aufgeben];
$x=0;
mysql_query("INSERT wanted_kampf SET hp1='$k_hp[0]', hp2='$k_hp[1]', mp1='$k_mp[0]', mp2='$k_mp[1]', schaden1='$schaden_1', schaden2='$schaden_2', attacke1='$technick1[name]', attacke2='$technick2[name]', char1='$chara_1[id]', char2='$chara_2[id]', starke1='$k_starke[0]', starke2='$k_starke[1]', ver1='$k_ver[0]', ver2='$k_ver[1]', speed1='$k_speed[0]', speed2='$k_speed[1]', ausdauer1='$k_ausdauer[0]', ausdauer2='$k_ausdauer[1]'");
while($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$technick1 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$prozent_technik1 = (20*$technick1[aktiv])-20;
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick2 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2[$x]' LIMIT 10"));
$prozent_technik2 = (20*$technick2[aktiv])-20;
$technick2 = mysql_fetch_array(mysql_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 "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 = $speeds_char1;
$speed_char2 = $speeds_char2;
$aussetzten_runde = ""; ////// MUSS SO BLEIBEN WICHTIG
##################################MP, SSJ Verwandlungen, HP, Koerper Tausch Technicken
include "kampf/majin.php";
if(!$aussetzten_runde) {
include "kampf/atk_wert.php";
include "kampf/tausch2.php"; //////////////////Muss ganz oben sein wegen technik Tauschen
include "kampf/frucht.php";
include "kampf/runde.php";
include "kampf/mp.php";
include "kampf/hp.php";
include "kampf/hp2.php";
include "kampf/SSJ.php";
include "kampf/kaioken.php";
include "kampf/kaioken2.php";
include "kampf/copy.php";
include "kampf/lose.php";
include "kampf/lose2.php";
include "kampf/ausdauer.php";
include "kampf/mpv.php";
include "kampf/tausch.php";
include "kampf/hpmp.php";
}
include "kampf/atk_wert.php";
#####################################KAMPF SYSTEM
include "kampf/kampf_rechnung.php";
$db_query = mysql_fetch_array(mysql_query("SELECT * FROM wanted_kampf WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') AND dauer='0' order by id DESC LIMIT 1"));
mysql_query("UPDATE wanted_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]' WHERE id='$db_query[id]'");
$x++;
}
###########################EXP VERTEILUNG
$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] = 0;
$k_geld[1] = 0;
$k_exp[0] = 0;
$k_geld[0] = 0;
$new_dead_list1 = "$chara_1[dead_list],$chara_2[name]";
$new_dead_list2 = "";
$new_preis1 = $chara_1[preis] + (($chara_2[preis] / 100) * 10);
$new_preis2 = $chara_2[preis] - (($chara_2[preis] / 100) * 10);
$sieger = $chara_1[id];
$verlierer = $chara_2[id];
}
if($k_hp[0] < $k_aufgabe[0] OR $X23 == "HALLO") {
$new_dead_list2 = "$chara_2[dead_list],$chara_1[name]";
$new_dead_list1 = "";
$new_preis2 = $chara_2[preis] + (($chara_1[preis] / 100) * 10);
$new_preis1 = $chara_1[preis] - (($chara_1[preis] / 100) * 10);
$sieger = $chara_2[id];
$verlierer = $chara_1[id];
$k_exp[1] = 0;
$k_geld[1] = 0;
$k_exp[0] = 0;
$k_geld[0] = 0;
}
if($k_exp[0]) { $s=2; } else { $s++; }
}
$dauer_Z = time();
mysql_query("UPDATE chars SET preis='$new_preis1', dead_list='$new_dead_list1' WHERE id='$chara_1[id]' LIMIT 1");
mysql_query("UPDATE chars SET preis='$new_preis2', dead_list='$new_dead_list2' WHERE id='$chara_2[id]' LIMIT 1");
mysql_query("UPDATE wanted_kampf SET 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]'");
?>

@ -0,0 +1,183 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$k_exp[0] = "";
$X23 = "";
$X13 = "";
if (!$chara_1['id'] OR !$chara_2['id']) {
echo "Unbekannter B.U.G";
echo '<br />Bug 1';
exit;
}
################## Kaempfer 1
$char1_quis_item = explode(",", $chara_1[kampf_item]);
$char1_item_helm = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[0]' LIMIT 1"));
$char1_item_rustung = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[1]' LIMIT 1"));
$char1_item_schild = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[2]' LIMIT 1"));
$char1_item_schwert = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[3]' LIMIT 1"));
$char1_item_schuhe = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[4]' LIMIT 1"));
$k_hp1 = explode(",", $chara_1[hp]);
$k_mp1 = explode(",", $chara_1[mp]);
$k_starke[0] = $chara_1[starke] + $char1_item_helm[starke] + $char1_item_rustung[starke] + $char1_item_schild[starke] + $char1_item_schwert[starke] + $char1_item_schuhe[starke];
$k_speed[0] = $chara_1[speed] + $char1_item_helm[speed] + $char1_item_rustung[speed] + $char1_item_schild[speed] + $char1_item_schwert[speed] + $char1_item_schuhe[speed];
$k_ver[0] = $chara_1[verteidigung] + $char1_item_helm[verteidigung] + $char1_item_rustung[verteidigung] + $char1_item_schild[verteidigung] + $char1_item_schwert[verteidigung] + $char1_item_schuhe[verteidigung];
$k_hp1[0] += $char1_item_helm[hp] + $char1_item_rustung[hp] + $char1_item_schild[hp] + $char1_item_schwert[hp] + $char1_item_schuhe[hp];
$k_hp1[1] += $char1_item_helm[hp] + $char1_item_rustung[hp] + $char1_item_schild[hp] + $char1_item_schwert[hp] + $char1_item_schuhe[hp];
$k_mp1[0] += $char1_item_helm[mp] + $char1_item_rustung[mp] + $char1_item_schild[mp] + $char1_item_schwert[mp] + $char1_item_schuhe[mp];
$k_mp1[1] += $char1_item_helm[mp] + $char1_item_rustung[mp] + $char1_item_schild[mp] + $char1_item_schwert[mp] + $char1_item_schuhe[mp];
$k_ausdauer[0] = $chara_1[ausdauer];
$k_glueck[0] = $chara_1[glueck];
$k_attacke1 = explode(",", $chara_1[attacken]);
$k_select1_1 = explode(",", $chara_1[auswahl1]);
$k_select1_2 = explode(",", $chara_1[auswahl2]);
$k_select1_3 = explode(",", $chara_1[auswahl3]);
$k_attacke1_2 = explode(",", $chara_1[attacken2]);
$k_hp[0] = round($k_hp1[0]);
$k_mp[0] = round($k_mp1[0]);
$k_aufgabe_a_1 = $k_hp1[1] / 100;
$k_aufgabe[0] = $k_aufgabe_a_1 * $chara_1[aufgeben];
################## Kaempfer 2
$char2_quis_item = explode(",", $chara_2[kampf_item]);
$char2_item_helm = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[0]' LIMIT 1"));
$char2_item_rustung = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[1]' LIMIT 1"));
$char2_item_schild = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[2]' LIMIT 1"));
$char2_item_schwert = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[3]' LIMIT 1"));
$char2_item_schuhe = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[4]' LIMIT 1"));
$k_hp2 = explode(",", $chara_2[hp]);
$k_mp2 = explode(",", $chara_2[mp]);
$k_starke[1] = $chara_2[starke] + $char2_item_helm[starke] + $char2_item_rustung[starke] + $char2_item_schild[starke] + $char2_item_schwert[starke] + $char2_item_schuhe[starke];
$k_speed[1] = $chara_2[speed] + $char2_item_helm[speed] + $char2_item_rustung[speed] + $char2_item_schild[speed] + $char2_item_schwert[speed] + $char2_item_schuhe[speed];
$k_ver[1] = $chara_2[verteidigung] + $char2_item_helm[verteidigung] + $char2_item_rustung[verteidigung] + $char2_item_schild[verteidigung] + $char2_item_schwert[verteidigung] + $char2_item_schuhe[verteidigung];
$k_hp2[0] += $char2_item_helm[hp] + $char2_item_rustung[hp] + $char2_item_schild[hp] + $char2_item_schwert[hp] + $char2_item_schuhe[hp];
$k_hp2[1] += $char2_item_helm[hp] + $char2_item_rustung[hp] + $char2_item_schild[hp] + $char2_item_schwert[hp] + $char2_item_schuhe[hp];
$k_mp2[0] += $char2_item_helm[mp] + $char2_item_rustung[mp] + $char2_item_schild[mp] + $char2_item_schwert[mp] + $char2_item_schuhe[mp];
$k_mp2[1] += $char2_item_helm[mp] + $char2_item_rustung[mp] + $char2_item_schild[mp] + $char2_item_schwert[mp] + $char2_item_schuhe[mp];
$k_ausdauer[1] = $chara_2[ausdauer];
$k_glueck[1] = $chara_2[glueck];
$k_attacke2 = explode(",", $chara_2[attacken]);
$k_select2_1 = explode(",", $chara_2[auswahl1]);
$k_select2_2 = explode(",", $chara_2[auswahl2]);
$k_select2_3 = explode(",", $chara_2[auswahl3]);
$k_attacke2_2 = explode(",", $chara_2[attacken2]);
$k_hp[1] = round($k_hp2[0]);
$k_mp[1] = round($k_mp2[0]);
$k_aufgabe_a_2 = $k_hp2[1] / 100;
$k_aufgabe[1] = $k_aufgabe_a_2 * $chara_2[aufgeben];
$runden_type1 = 0;
$runden_type2 = 0;
$x = 0;
$runden_summon1 = "";
$runden_summon2 = "";
$runden_gif1 = 0;
$runden_gif_technik1 = "";
$runden_gif2 = 0;
$runden_gif_technik2 = "";
if ($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$sql = "INSERT clan_fights SET hp1='$k_hp[0]', hp2='$k_hp[1]', mp1='$k_mp[0]', mp2='$k_mp[1]', schaden1='$schaden_1', schaden2='$schaden_2', attacke1='$technick1[name]', attacke2='$technick2[name]', char1='$chara_1[id]', char2='$chara_2[id]', starke1='$k_starke[0]', starke2='$k_starke[1]', ver1='$k_ver[0]', ver2='$k_ver[1]', speed1='$k_speed[0]', speed2='$k_speed[1]', ausdauer1='$k_ausdauer[0]', ausdauer2='$k_ausdauer[1]', clanfight_id='$clanfight_id', runde='$runde', kampf='$kampf'";
mysql_query($sql);
// echo $sql . '<br>';
if (mysql_affected_rows() == 0) {
echo '"' . $sql . '" konnte nicht ausgef&uuml;rt werden!<br>';
}
} else {
echo "Unbekannter B.U.G";
echo '<br />Bug 2';
#displayErrorMessage(NULL, 'Unbekannter B.U.G!', displayHistoryBackLink());
exit;
}
while ($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$technick1 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$prozent_technik1 = (20 * $technick1[aktiv]) - 20;
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick2 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2[$x]' LIMIT 10"));
$prozent_technik2 = (20 * $technick2[aktiv]) - 20;
$technick2 = mysql_fetch_array(mysql_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 "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);
$speed_char1 = ($k_speed[0] + $technick1[speed]);
$speed_char2 = ($k_speed[1] + $technick2[speed]);
// Speedbug
// $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_rand($speeds_char1_4, $speeds_char1);
// $speed_char2 = mt_rand($speeds_char2_4, $speeds_char2);
///////rechnung selber
include "kampf_include.php";
#####################################KAMPF SYSTEM
include "kampf/kampf_rechnung.php";
#$db_query = mysql_fetch_array(mysql_query("SELECT * FROM clan_fights WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') AND dauer='0' order by id DESC LIMIT 1"));
$db_query = mysql_fetch_array(mysql_query("SELECT * FROM clan_fights WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') order by id DESC LIMIT 1"));
mysql_query("UPDATE clan_fights 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]' WHERE id='$db_query[id]'");
$x++;
}
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];
}
}
if ($k_hp[1] < $k_aufgabe[1] OR $k_hp[1] < $k_hp[0]) {
$sieger = $chara_1['id'];
$verlierer = $chara_2['id'];
}
if ($k_hp[0] < $k_aufgabe[0] OR $k_hp[0] < $k_hp[1]) {
$sieger = $chara_2['id'];
$verlierer = $chara_1['id'];
}
mysql_query("UPDATE clan_fights SET win='$sieger', lose='$verlierer' WHERE id='$db_query[id]'");
?>

@ -0,0 +1,199 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$k_exp[0] = "";
$X23 = "";
$X13 = "";
if (!$chara_1['id'] OR !$chara_2['id']) {
echo "Unbekannter B.U.G";
exit;
}
################## Kaempfer 1
$char1_quis_item = explode(",", $chara_1[kampf_item]);
$char1_item_helm = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[0]' LIMIT 1"));
$char1_item_rustung = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[1]' LIMIT 1"));
$char1_item_schild = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[2]' LIMIT 1"));
$char1_item_schwert = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[3]' LIMIT 1"));
$char1_item_schuhe = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char1_quis_item[4]' LIMIT 1"));
$k_hp1 = explode(",", $chara_1[hp]);
$k_mp1 = explode(",", $chara_1[mp]);
$k_starke[0] = $chara_1[starke] + $char1_item_helm[starke] + $char1_item_rustung[starke] + $char1_item_schild[starke] + $char1_item_schwert[starke] + $char1_item_schuhe[starke];
$k_speed[0] = $chara_1[speed] + $char1_item_helm[speed] + $char1_item_rustung[speed] + $char1_item_schild[speed] + $char1_item_schwert[speed] + $char1_item_schuhe[speed];
$k_ver[0] = $chara_1[verteidigung] + $char1_item_helm[verteidigung] + $char1_item_rustung[verteidigung] + $char1_item_schild[verteidigung] + $char1_item_schwert[verteidigung] + $char1_item_schuhe[verteidigung];
$k_hp1[0] += $char1_item_helm[hp] + $char1_item_rustung[hp] + $char1_item_schild[hp] + $char1_item_schwert[hp] + $char1_item_schuhe[hp];
$k_hp1[1] += $char1_item_helm[hp] + $char1_item_rustung[hp] + $char1_item_schild[hp] + $char1_item_schwert[hp] + $char1_item_schuhe[hp];
$k_mp1[0] += $char1_item_helm[mp] + $char1_item_rustung[mp] + $char1_item_schild[mp] + $char1_item_schwert[mp] + $char1_item_schuhe[mp];
$k_mp1[1] += $char1_item_helm[mp] + $char1_item_rustung[mp] + $char1_item_schild[mp] + $char1_item_schwert[mp] + $char1_item_schuhe[mp];
$k_ausdauer[0] = $chara_1[ausdauer];
$k_glueck[0] = $chara_1[glueck];
$k_attacke1 = explode(",", $chara_1[attacken]);
$k_select1_1 = explode(",", $chara_1[auswahl1]);
$k_select1_2 = explode(",", $chara_1[auswahl2]);
$k_select1_3 = explode(",", $chara_1[auswahl3]);
$k_attacke1_2 = explode(",", $chara_1[attacken2]);
if ($kampf == 1) {
$k_hp[0] = round($k_hp1[1]);
$k_mp[0] = round($k_mp1[1]);
} else {
$k_hp[0] = round($k_hp1[0]);
$k_mp[0] = round($k_mp1[0]);
}
$k_aufgabe_a_1 = $k_hp1[1] / 100;
$k_aufgabe[0] = $k_aufgabe_a_1 * $chara_1[aufgeben];
################## Kaempfer 2
$char2_quis_item = explode(",", $chara_2[kampf_item]);
$char2_item_helm = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[0]' LIMIT 1"));
$char2_item_rustung = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[1]' LIMIT 1"));
$char2_item_schild = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[2]' LIMIT 1"));
$char2_item_schwert = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[3]' LIMIT 1"));
$char2_item_schuhe = mysql_Fetch_Array(mysql_query("SELECT i.hp, i.mp, i.starke, i.verteidigung, i.speed FROM ware w LEFT JOIN item i ON(i.id=w.item_id) WHERE w.id='$char2_quis_item[4]' LIMIT 1"));
$k_hp2 = explode(",", $chara_2[hp]);
$k_mp2 = explode(",", $chara_2[mp]);
$k_starke[1] = $chara_2[starke] + $char2_item_helm[starke] + $char2_item_rustung[starke] + $char2_item_schild[starke] + $char2_item_schwert[starke] + $char2_item_schuhe[starke];
$k_speed[1] = $chara_2[speed] + $char2_item_helm[speed] + $char2_item_rustung[speed] + $char2_item_schild[speed] + $char2_item_schwert[speed] + $char2_item_schuhe[speed];
$k_ver[1] = $chara_2[verteidigung] + $char2_item_helm[verteidigung] + $char2_item_rustung[verteidigung] + $char2_item_schild[verteidigung] + $char2_item_schwert[verteidigung] + $char2_item_schuhe[verteidigung];
$k_hp2[0] += $char2_item_helm[hp] + $char2_item_rustung[hp] + $char2_item_schild[hp] + $char2_item_schwert[hp] + $char2_item_schuhe[hp];
$k_hp2[1] += $char2_item_helm[hp] + $char2_item_rustung[hp] + $char2_item_schild[hp] + $char2_item_schwert[hp] + $char2_item_schuhe[hp];
$k_mp2[0] += $char2_item_helm[mp] + $char2_item_rustung[mp] + $char2_item_schild[mp] + $char2_item_schwert[mp] + $char2_item_schuhe[mp];
$k_mp2[1] += $char2_item_helm[mp] + $char2_item_rustung[mp] + $char2_item_schild[mp] + $char2_item_schwert[mp] + $char2_item_schuhe[mp];
$k_ausdauer[1] = $chara_2[ausdauer];
$k_glueck[1] = $chara_2[glueck];
$k_attacke2 = explode(",", $chara_2[attacken]);
$k_select2_1 = explode(",", $chara_2[auswahl1]);
$k_select2_2 = explode(",", $chara_2[auswahl2]);
$k_select2_3 = explode(",", $chara_2[auswahl3]);
$k_attacke2_2 = explode(",", $chara_2[attacken2]);
if ($kampf == 1) {
$k_hp[1] = round($k_hp2[1]);
$k_mp[1] = round($k_mp2[1]);
} else {
$k_hp[1] = round($k_hp2[0]);
$k_mp[1] = round($k_mp2[0]);
}
$k_aufgabe_a_2 = $k_hp2[1] / 100;
$k_aufgabe[1] = $k_aufgabe_a_2 * $chara_2[aufgeben];
$runden_type1 = 0;
$runden_type2 = 0;
$x = 0;
$runden_summon1 = "";
$runden_summon2 = "";
$runden_gif1 = 0;
$runden_gif_technik1 = "";
$runden_gif2 = 0;
$runden_gif_technik2 = "";
if ($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$sql = "INSERT clan_fights SET hp1='$k_hp[0]', hp2='$k_hp[1]', mp1='$k_mp[0]', mp2='$k_mp[1]', schaden1='$schaden_1', schaden2='$schaden_2', attacke1='$technick1[name]', attacke2='$technick2[name]', char1='$chara_1[id]', char2='$chara_2[id]', starke1='$k_starke[0]', starke2='$k_starke[1]', ver1='$k_ver[0]', ver2='$k_ver[1]', speed1='$k_speed[0]', speed2='$k_speed[1]', ausdauer1='$k_ausdauer[0]', ausdauer2='$k_ausdauer[1]', clanfight_id='$clanfight_id', runde='$runde', kampf='$kampf'";
mysql_query($sql);
// echo $sql . '<br>';
if (mysql_affected_rows() == 0) {
echo '"' . $sql . '" konnte nicht ausgef&uuml;rt werden!<br>';
}
} else {
displayErrorMessage(NULL, 'Unbekannter B.U.G!', displayHistoryBackLink());
exit;
}
while ($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$technick1 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$prozent_technik1 = (20 * $technick1[aktiv]) - 20;
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick2 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2[$x]' LIMIT 10"));
$prozent_technik2 = (20 * $technick2[aktiv]) - 20;
$technick2 = mysql_fetch_array(mysql_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 "kampf/andere_technik.php"; /////////////////// Wenn man ne andere technik sich aussuchen will...
#include ($_SERVER['DOCUMENT_ROOT'] . '/ag/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);
$speed_char1 = ($k_speed[0] + $technick1[speed]);
$speed_char2 = ($k_speed[1] + $technick2[speed]);
// Speedbug
// $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_rand($speeds_char1_4, $speeds_char1);
// $speed_char2 = mt_rand($speeds_char2_4, $speeds_char2);
///////rechnung selber
include "kampf_include.php";
#####################################KAMPF SYSTEM
include "kampf/kampf_rechnung.php";
#$db_query = mysql_fetch_array(mysql_query("SELECT * FROM clan_fights WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') AND dauer='0' order by id DESC LIMIT 1"));
$db_query = mysql_fetch_array(mysql_query("SELECT * FROM clan_fights WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') order by id DESC LIMIT 1"));
mysql_query("UPDATE clan_fights 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]' WHERE id='$db_query[id]'");
$x++;
}
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];
}
}
if ($k_hp[1] < $k_aufgabe[1] OR $k_hp[1] < $k_hp[0] OR $k_hp[1] == $k_hp[0]) {
$hp1_new= $k_hp[0].','.$k_hp1[1];
$mp1_new= $k_mp[0].','.$k_mp1[1];
$fighter_team_a_array[$fighter_a][hp]= $hp1_new;
$fighter_team_a_array[$fighter_a][mp]= $mp1_new;
$sieger = $chara_1['id'];
$verlierer = $chara_2['id'];
}
if ($k_hp[0] < $k_aufgabe[0] OR $k_hp[0] < $k_hp[1]) {
$hp2_new= $k_hp[1].','.$k_hp2[1];
$mp2_new= $k_mp[1].','.$k_mp2[1];
$fighter_team_b_array[$fighter_b][hp]= $hp2_new;
$fighter_team_b_array[$fighter_b][mp]= $mp2_new;
$sieger = $chara_2['id'];
$verlierer = $chara_1['id'];
}
mysql_query("UPDATE clan_fights SET win='$sieger', lose='$verlierer' WHERE id='$db_query[id]'");
?>

@ -0,0 +1,41 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$aussetzten_runde = ""; ////// MUSS SO BLEIBEN WICHTIG
##################################MP, SSJ Verwandlungen, HP, Koerper Tausch Technicken
include "kampf/majin.php";
if(!$aussetzten_runde) {
include "kampf/tausch2.php"; //////////////////Muss ganz oben sein wegen technik Tauschen
//include "kampf/summon.php";
include "kampf/gift.php";
include "kampf/frucht.php";
include "kampf/mp.php";
include "kampf/hp.php";
include "kampf/hp2.php";
include "kampf/SSJ.php";
include "kampf/kaioken.php";
include "kampf/kaioken2.php";
include "kampf/copy.php";
include "kampf/lose.php";
include "kampf/lose2.php";
include "kampf/ausdauer.php";
include "kampf/mpv.php";
include "kampf/tausch.php";
include "kampf/hpmp.php";
}
include "kampf/atk_wert.php";
if(!$aussetzten_runde) { /////DAS FueR MAJIN ATTACKEN
include "kampf/schatten.php";
include "kampf/runde.php";
}
?>

@ -0,0 +1,130 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include "db.php";
include_once ('inclu/messagefunctions.inc.php');
include_once ('inclu/halloffame.inc.php');
include_once ('inclu/exp.inc.php');
$row2 = mysql_query("SELECT c1.lernpunkte AS c1lern, c2.lernpunkte AS c2lern, u.round, u.win, u.hp1, u.hp2,c1.hp AS c1hp, c2.hp AS c2hp, c1.mp AS c1mp, c2.mp AS c2mp, u.mp1, u.mp2, c1.id AS c1id, c2.id AS c2id, c1.exp AS c1exp, c2.exp AS c2exp, i1.geld AS i1geld, i2.geld AS i2geld,
i1.id AS i1id, i2.id AS i2id FROM turnier_kampf u LEFT JOIN chars c1 ON(c1.id=u.char1) LEFT JOIN user i1 ON(i1.id=c1.besitzer) LEFT JOIN chars c2 ON(c2.id=u.char2) LEFT JOIN user i2 ON(i2.id=c2.besitzer) WHERE u.art='klein' ORDER BY u.round ASC");
$x=0;
while($row = mysql_fetch_array($row2)) {
$new_hp = explode(",",$row[hp1]);
$or_hp1 = explode(",",$row[c1hp]);
$new_hp2 = count($new_hp) - 1;
$new_mp = explode(",",$row[mp1]);
$or_mp1 = explode(",",$row[c1mp]);
$new_mp2 = count($new_mp) - 1;
$or_exp1 = explode(",",$row[c1exp]);
$new_exp = $or_exp1[0] + ($row[round] * 2000);
$add_exp1 = ($row[round] * 2000);
$new_lernpunkte1 = 0;
$new_lernpunkte2 = 0;
$new_geld1 = $row[i1geld] + ($row[round] * 2000);
$new_geld2 = $row[i2geld] + ($row[round] * 2000);
$trainings_points1 = $row[round] * 1;
$trainings_points2 = $row[round] * 1;
if($row[round] == 5 AND $row[win] == $row[c1id]) {
$new_exp += 10000;
$add_exp1 += 10000;
$new_geld1 += 15000;
$trainings_points1 += 5;
}
$new_hp_2 = explode(",",$row[hp2]);
$or_hp1_2 = explode(",",$row[c2hp]);
$new_hp2_2 = count($new_hp_2) - 1;
$new_mp_2 = explode(",",$row[mp2]);
$or_mp1_2 = explode(",",$row[c2mp]);
$new_mp2_2 = count($new_mp_2) - 1;
$or_exp1_2 = explode(",",$row[c2exp]);
$new_exp_2 = $or_exp1_2[0] + ($row[round] * 2000);
$add_exp2 = ($row[round] * 2000);
if($row[round] == 5 AND $row[win] == $row[c2id]) {
$new_exp_2 += 10000;
$add_exp2 += 10000;
$trainings_points2 += 5;
$new_geld2 += 15000;
}
$old_win = $row[win];
//mysql_query("UPDATE chars SET status='Frei', training_points=training_points+'$trainings_points1', hp='$new_hp[$new_hp2],$or_hp1[1]', mp='$new_mp[$new_mp2],$or_mp1[1]', exp='$new_exp,$or_exp1[1]' WHERE id='$row[c1id]'");
//mysql_query("UPDATE chars SET status='Frei', training_points=training_points+'$trainings_points2', hp='$new_hp_2[$new_hp2_2],$or_hp1_2[1]', mp='$new_mp_2[$new_mp2_2],$or_mp1_2[1]', exp='$new_exp_2,$or_exp1_2[1]' WHERE id='$row[c2id]'");
//mysql_query("UPDATE chars SET status='Frei', exp='$new_exp,$or_exp1[1]' WHERE id='$row[c1id]'");
//mysql_query("UPDATE chars SET status='Frei', exp='$new_exp_2,$or_exp1_2[1]' WHERE id='$row[c2id]'");
addExpToChar($row['c1id'],$add_exp1);
addExpToChar($row['c2id'],$add_exp2);
mysql_query("UPDATE user SET geld='$new_geld1' WHERE id='$row[i1id]' LIMIT 1");
mysql_query("UPDATE user SET geld='$new_geld2' WHERE id='$row[i2id]' LIMIT 1");
}
$win_user = mysql_Fetch_array(mysql_Query("SELECT name, besitzer FROM chars WHERE id='$old_win' LIMIT 1"));
$win_name = mysql_fetch_Array(mysql_query("SELECT nickname FROM user WHERE id='$win_user[besitzer]' LIMIT 1"));
$win_online = mysql_fetch_array(mysql_query("SELECT turnier_klein FROM online LIMIT 1"));
mysql_query("UPDATE online SET turnier_klein='$win_online[turnier_klein],$win_user[name],$win_name[nickname]' WHERE id='1'");
// insertIntoHallOfFame($title, $charid, $userid);
insertIntoHallOfFame('Anf&auml;ngerturnier', $old_win, $win_user['besitzer']);
if(getHallOfFame('Anf&auml;ngerturnier', $win_user['besitzer']) >= 2) {
// remove all chars that are registered
mysql_query('delete from turnier1 where art = \'klein\' and besitzer = '.$win_user['besitzer']);
}
$sql5 = 'Select count(win), win from turnier_kampf where art = \'klein\' group by win order by count(win) desc';
$qry5 = mysql_query($sql5);
$rang1 = mysql_fetch_assoc($qry5);
$rang2 = mysql_fetch_assoc($qry5);
$rang3 = mysql_fetch_assoc($qry5);
$rang4 = mysql_fetch_assoc($qry5);
$sql = 'select u.clan, c.id, u.id as userid from chars c inner join user u on c.besitzer = u.id where c.id IN ('.$rang1['win'].','.$rang2['win'].','.$rang3['win'].','.$rang4['win'].')';
echo $sql.'<br>';
$qry = mysql_query($sql);
while($row = mysql_fetch_assoc($qry)){
switch($row['id']){
case $rang1['win']:
mysql_query('UPDATE user set pkt = pkt + 25 WHERE id = '.$row['userid']);
insertUserTickerMessage($row['userid'], '25 IP von Anfänger Turnier Sieg erhalten!');
break;
case $rang2['win']:
mysql_query('UPDATE user set pkt = pkt + 20 WHERE id = '.$row['userid']);
insertUserTickerMessage($row['userid'], '20 IP von Anfänger Turnier 2.Platz erhalten!');
break;
case $rang3['win']:
case $rang4['win']:
mysql_query('UPDATE user set pkt = pkt + 15 WHERE id = '.$row['userid']);
insertUserTickerMessage($row['userid'], '15 IP von Anfänger Turnier 3. oder 4. Platz erhalten!');
break;
default:
break;
}
}
?>

@ -0,0 +1,127 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
//set_time_limit(0);
$art_1 ="klein";
function rand_array($array)
{
$maxarray=count($array)-1;
mt_srand((double)microtime()*1000000);
for($i=$maxarray; $i>=0; $i--)
{
if($i>0) $zufall=mt_rand(0,$i);
else $zufall=0;
$temp=$array[$i];
$array[$i]=$array[$zufall];
$array[$zufall]=$temp;
$newarray[]=$array[$i];
array_pop($array);
}
return $newarray;
}
include "db.php";
$max_charakter = mysql_num_rows(mysql_query("SELECT id FROM chars WHERE level<='25' and fusion='nein' AND char_type = '' LIMIT 32"));
if($max_charakter<32) {
exit;
}
mysql_query("DELETE FROM turnier_kampf WHERE art='$art_1'");
$char1 = mysql_query("SELECT charakter FROM turnier1 WHERE art='$art_1'");
while($row=mysql_fetch_array($char1))
{
$test2[]=$row['charakter'];
}
do
{
if(count($test2)<32)
{ // WHERE status='Frei'
list($count) = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM chars WHERE level<='25' and fusion='nein' AND char_type = '' "));
if(($count+count($test2))>=32)
{
$result = mysql_query("SELECT id FROM chars WHERE level<='25' AND char_type = '' and fusion='nein' ORDER BY RAND() LIMIT ".(32-count($test2)));
while($char_name2=mysql_fetch_array($result))
{
$test2[]=$char_name2['id'];
}
}
}
$test2 = rand_array($test2);
$test2 = array_unique($test2);
}
while(count($test2)<32);
$test3=$test2;
reset($test3);
while(current($test3)!=end($test2))
{
if(empty($list)) $list=current($test3);
else $list.=','.next($test3);
}
$result=mysql_query("SELECT * FROM chars WHERE id IN(".$list.") LIMIT 32");
while($row=mysql_fetch_array($result))
{
$charas[$row['id']]=$row;
}
$a8=0;
$b8=1;
$round = 1;
while($a8 < 32)
{
$chara_1 = $charas[$test2[$a8]];
$chara_2 = $charas[$test2[$b8]];
include "turnier_kampf.php";
$a8+=2;
$b8+=2;
}
while($round < 5)
{
unset($test9);
$chars_win = mysql_Query("SELECT win FROM turnier_kampf WHERE round='$round' AND art='$art_1'");
while($row9 = mysql_fetch_array($chars_win))
{
$test9[]=$row9['win'];
}
$round++;
$k9=0;
$l9=1;
while($k9 < count($test9))
{
$chara_1 = $charas[$test9[$k9]];
$chara_2 = $charas[$test9[$l9]];
include "turnier_kampf.php";
$k9+=2;
$l9+=2;
}
}
mysql_query("DELETE FROM turnier1 WHERE art='$art_1'");
?>

@ -0,0 +1,38 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include "db.php";
include_once ('inclu/messagefunctions.inc.php');
include_once ('inclu/halloffame.inc.php');
$platz1 = mysql_query("SELECT id, besitzer, name FROM chars order by liga_punkte DESC LIMIT 3");
mysql_query("UPDATE chars SET liga_siege='0', liga_niederlagen='0', liga_punkte='0'");
$x=0;
$mac_geld = 50000;
while($row = mysql_fetch_array($platz1)) {
$user = mysql_fetch_array(mysql_query("SELECT geld, nickname FROM user WHERE id='$row[besitzer]' LIMIT 3"));
$new_geld = $user[geld] + $mac_geld;
mysql_query("UPDATE user SET geld='$new_geld' WHERE id='$row[besitzer]'");
$mac_geld = $mac_geld - 20000;
if($x == 0) {
$platz_a = $row[name];
$platz_a_id = $row['id'];
$platz_b = $user[nickname];
$platz_b_id = $row['besitzer'];
}
$x++;
}
$all_user = mysql_query("SELECT mail FROM user");
//while($rowa = mysql_fetch_array($all_user)) {
//@mail($rowa[mail],"LIGA Sieger","Sieger: $platz_a \n Trainer: $platz_b", "From: "."Vegeta"."\nReply-To: "."vegeta@animegame.de"."\nX-Mailer: PHP/" . phpversion());
//}
$ligas = mysql_fetch_array(mysql_query("SELECT liga FROM online WHERE id='1'"));
mysql_query("UPDATE online SET liga='$ligas[liga],$platz_a,$platz_b' WHERE id='1'");
// insertIntoHallOfFame($title, $charid, $userid);
insertIntoHallOfFame('Liga', $platz_a_id, $platz_b_id);
?>

@ -0,0 +1,81 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
set_time_limit(0);
function rand_array($array)
{
$maxarray=count($array)-1;
mt_srand((double)microtime()*1000000);
for($i=$maxarray; $i>=0; $i--)
{
if($i>0) $zufall=mt_rand(0,$i);
else $zufall=0;
$temp=$array[$i];
$array[$i]=$array[$zufall];
$array[$zufall]=$temp;
$newarray[]=$array[$i];
array_pop($array);
}
return $newarray;
}
include "db.php";
$max_charakter = mysql_num_rows(mysql_query("SELECT id FROM chars WHERE rasse!='NPC' LIMIT 250"));
if($max_charakter<250) {
exit;
}
$charakter = mysql_query("SELECT name, id FROM chars WHERE rasse!='NPC' ORDER BY level DESC LIMIT $max_charakter");
while($row=mysql_fetch_array($charakter))
{
$test2[]=$row['id'];
}
$test2 = rand_array($test2);
$test2 = array_unique($test2);
while(count($test2)<$max_charakter);
$test3=$test2;
reset($test3);
while(current($test3)!=end($test2))
{
if(empty($list)) $list=current($test3);
else $list.=','.next($test3);
}
$result=mysql_query("SELECT * FROM chars WHERE id IN(".$list.") LIMIT 250");
while($row=mysql_fetch_array($result))
{
$charas[$row['id']]=$row;
}
$a8=0;
$b8=1;
$round = 1;
while($a8 < $max_charakter)
{
$chara_1 = $charas[$test2[$a8]];
$chara_2 = $charas[$test2[$b8]];
include "liga_kampf.php";
$a8+=2;
$b8+=2;
}
?>

@ -0,0 +1,184 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$uzze=0;
while($uzze < 10) {
$aktion_AV1[$uzze] = "";
$aktion_AV2[$uzze] = "";
$uzze++;
}
$ssj_tech_1="";
$ssj_tech_2="";
$play1_ausweich="";
$play2_ausweich="";
$k_exp[0] = "";
$X23 = "";
$X13 = "";
$schaden_1="";
$schaden_2="";
$runden_type1=0;
$runden_type2=0;
################## Kaempfer 1
$k_hp1 = explode(",", $chara_1[hp]);
$k_mp1 = explode(",", $chara_1[mp]);
$k_hp1[0] = $k_hp1[1];
$k_mp1[0] = $k_mp1[1];
$k_starke[0] = $chara_1[starke] + $k_rustung[ru_mal];
$k_speed[0] = $chara_1[speed];
$k_ver[0] = $chara_1[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[0] = $chara_1[ausdauer];
$k_glueck[0] = $chara_1[glueck];
$k_attacke1 = explode(",", $chara_1[attacken]);
$k_hp[0] = round($k_hp1[0]);
$k_mp[0] = round($k_mp1[0]);
$k_aufgabe_a_1 = $k_hp1[1] / 100;
$k_aufgabe[0] = $k_aufgabe_a_1 * $chara_1[aufgeben];
######################################Kaempfer2
$k_hp2 = explode(",", $chara_2[hp]);
$k_mp2 = explode(",", $chara_2[mp]);
$k_hp2[0] = $k_hp2[1];
$k_mp2[0] = $k_mp2[1];
$k_starke[1] = $chara_2[starke] + $k_rustung[ru_mal];
$k_speed[1] = $chara_2[speed];
$k_ver[1] = $chara_2[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[1] = $chara_2[ausdauer];
$k_glueck[1] = $chara_2[glueck];
$k_attacke2 = explode(",", $chara_2[attacken]);
$k_hp[1] = round($k_hp2[0]);
$k_mp[1] = round($k_mp2[0]);
$k_aufgabe_a_2 = $k_hp2[1] / 100;
$k_aufgabe[1] = $k_aufgabe_a_2 * $chara_2[aufgeben];
$x=0;
mysql_query("INSERT liga_kampf SET hp1='$k_hp[0]', hp2='$k_hp[1]', mp1='$k_mp[0]', mp2='$k_mp[1]', schaden1='$schaden_1', schaden2='$schaden_2', attacke1='$technick1[name]', attacke2='$technick2[name]', char1='$chara_1[id]', char2='$chara_2[id]', starke1='$k_starke[0]', starke2='$k_starke[1]', ver1='$k_ver[0]', ver2='$k_ver[1]', speed1='$k_speed[0]', speed2='$k_speed[1]', ausdauer1='$k_ausdauer[0]', ausdauer2='$k_ausdauer[1]', glueck1='$k_glueck[0]', glueck2='$k_glueck[1]'");
while($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$technick1 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$prozent_technik1 = (20*$technick1[aktiv])-20;
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick2 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2[$x]' LIMIT 10"));
$prozent_technik2 = (20*$technick2[aktiv])-20;
$technick2 = mysql_fetch_array(mysql_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 "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_rand($speeds_char1_4,$speeds_char1);
$speed_char2 = mt_rand($speeds_char2_4,$speeds_char2);
///////rechnung selber
include "kampf_include.php";
#####################################KAMPF SYSTEM
include "kampf/kampf_rechnung.php";
$db_query = mysql_fetch_array(mysql_query("SELECT * FROM liga_kampf WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') AND dauer='0' order by id DESC LIMIT 1"));
mysql_query("UPDATE liga_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]'");
$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] = 0;
$k_geld[1] = 0;
$k_exp[0] = 0;
$k_geld[0] = 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] = 0;
$k_geld[1] = 0;
$k_exp[0] = 0;
$k_geld[0] = 0;
}
if($k_exp[0]) { $s=2; } else { $s++; }
}
$punkt_sieger = (11-$x) + 500;
$punkt_verlierer = 0;
$dauer_Z = time();
mysql_query("UPDATE chars SET liga_siege=liga_siege+1, liga_punkte=liga_punkte+'$punkt_sieger' WHERE id='$sieger' LIMIT 1");
mysql_query("UPDATE chars SET liga_niederlagen=liga_niederlagen+1, liga_punkte=liga_punkte+'$punkt_verlierer' WHERE id='$verlierer' LIMIT 1");
mysql_query("UPDATE liga_kampf SET 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]'");
?>

@ -0,0 +1,152 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include_once 'db.php';
/**
* Konfiguration
*/
$serverid = 1;
$mumbledb = 'ag01_murmur';
$ag_db = 'hecht_ag';
$clan_chan_name = 'Clans';
// Ab $min_member_count_create wird ein Raum erstellt
$min_member_count_create = 5;
// Sollte die Anzahl der member auf $max_member_count_delete oder weniger fallen, wird der channel gelöscht!
$max_member_count_delete = 1;
/**
* Erstmal die ganzen SQL-Befehle definieren!
*/
$res = mysql_fetch_assoc(mysql_query('Select max(channel_id) as mx FROM '.$mumbledb.'.channels where server_id = '.$serverid));
$max_channel = $res['mx'];
$res = mysql_fetch_assoc(mysql_query('Select max(group_id) as mx FROM '.$mumbledb.'.groups where server_id = '.$serverid));
$max_group = $res['mx'];
$res = mysql_fetch_assoc(mysql_query('Select channel_id FROM '.$mumbledb.'.channels where name = \''.$clan_chan_name.'\' and server_id = '.$serverid));
$clan_chan = $res['channel_id'];
$rename_sql = 'UPDATE '.$mumbledb.'.users p inner join '.$ag_db.'.user u on p.user_id = u.id set p.name = u.nickname WHERE p.name != u.nickname and server_id = '.$serverid;
$search_lost_players = 'Select p.user_id FROM '.$mumbledb.'.users as p left join '.$ag_db.'.user as u on p.user_id = u.id where p.user_id > 0 and u.nickname is null and p.server_id = '.$serverid;
$qry = mysql_query($search_lost_players);
while($row = mysql_fetch_assoc($qry)){
$player[] = $row['user_id'];
}
if(count($player) > 0){
$delete_sql = 'DELETE FROM '.$mumbledb.'.users where user_id IN ('.join(',',$player).') and server_id = '.$serverid;
}
//echo $delete_sql.'<br>';
// Verbinde die Clanchannels mit den Clans
//$clan_channels_sql = 'SELECT distinct(clanname) as name from '.$mumbledb.'.channels c right join '.$ag_db.'.clan cl on c.name = cl.clanname where name is null';
$clan_channels_sql = 'SELECT distinct(clanname) as name, count(u.clan) anzahl, name is not null as existance from '.$mumbledb.'.channels c right join '.$ag_db.'.clan cl on c.name = cl.clanname left join '.$ag_db.'.user u on cl.id = u.clan group by clanname';
$qry = mysql_query($clan_channels_sql);
$insert_clan_channels = 'INSERT INTO '.$mumbledb.'.channels(server_id, channel_id, parent_id, name, inheritacl) values';
$insert_clan_groups = 'INSERT INTO '.$mumbledb.'.groups(group_id, server_id, name, channel_id, inherit, inheritable) values';
$insert_acl = 'INSERT INTO '.$mumbledb.'.acl(server_id, channel_id, priority, group_name, apply_here, apply_sub, grantpriv, revokepriv) values';
$i=1;
while($row = mysql_fetch_assoc($qry)){
$channelid = ($max_channel + $i);
$groupid = ($max_group + $i);
if($row['existance'] == 0 && $row['anzahl'] >= $min_member_count_create){
echo $row['name'].' ist gross genug!<br>';
if($i==1){
$insert_clan_channels .= '('.$serverid.', '.$channelid.', '.$clan_chan.', \''.$row['name'].'\',1)';
$insert_clan_groups .= '('.$groupid.', '.$serverid.', \'member\', '.$channelid.', 1, 1)';
$insert_acl .= '('.$serverid.','.$channelid.',5,\'member\',1,1,510,0), ('.$serverid.','.$channelid.',6,\'member\',0,1,1,0)';
} else{
$insert_clan_channels .= ', ('.$serverid.', '.$channelid.', '.$clan_chan.', \''.$row['name'].'\',1)';
$insert_clan_groups .= ', ('.$groupid.', '.$serverid.', \'member\', '.$channelid.', 1, 1)';
$insert_acl .= ', ('.$serverid.','.$channelid.',5,\'member\',1,1,510,0), ('.$serverid.','.$channelid.',6,\'member\',0,1,1,0)';
}
$i++;
} else if($row['existance'] == 1 && $row['anzahl'] <= $max_member_count_delete){
mysql_query('DELETE FROM '.$mumbledb.'.channels WHERE parent_id = '.$clan_chan. ' and name = \''.$row['name'].'\' and server_id = '.$serverid);
}
}
// Delete nonexistant Clan-Channels!
$search_lost_channels = 'select channel_id FROM '.$mumbledb.'.channels left join '.$ag_db.'.clan on name = clanname where clanname is null and parent_id = '.$clan_chan.' and server_id = '.$serverid;
$qry = mysql_query($search_lost_channels);
while($row = mysql_fetch_assoc($qry)){
$channels[] = $row['channel_id'];
}
if(count($channels) > 0){
$remove_clan_channel_sql = 'DELETE FROM '.$mumbledb.'.channels where channel_id IN ('.join(',',$channels).') and server_id = '.$serverid;
}
//echo $remove_clan_channel_sql.'<br>';
$sql_user_select = 'Select p.user_id, ch.name as ch_name, ch2.name as ch2_name, ch.parent_id as ch_parent_id, ch2.parent_id as ch2_parent_id, g.group_id as g_group_id, g2.group_id as g2_group_id from
( '.$ag_db.'.user u inner join '.$mumbledb.'.users p on
u.id = p.user_id
)
left join '.$ag_db.'.clan cl on
u.clan = cl.id
left join '.$mumbledb.'.group_members gm on
gm.user_id = p.user_id and p.server_id = gm.server_id
left join '.$mumbledb.'.groups g on
g.group_id = gm.group_id and g.server_id = p.server_id
left join '.$mumbledb.'.channels ch on
ch.channel_id = g.channel_id and p.server_id = ch.server_id
left join '.$mumbledb.'.channels ch2 on
ch2.name = cl.clanname and p.server_id = ch2.server_id
left join '.$mumbledb.'.groups g2 on
g2.channel_id = ch2.channel_id and g2.server_id = p.server_id
where not (ch.name is null && ch2.name is null) and (ch.name is null || ch.parent_id = 2) and (ch2.name is null || ch2.parent_id = 2) and (ch.name is null || ch2.name is null or ch.name != ch2.name) and p.server_id = '.$serverid;
/**
* So nun die Ausfuehrung!
*/
mysql_query($rename_sql);
if(isset($delete_sql)){
mysql_query($delete_sql);
}
if($i!=1){
// echo $insert_clan_channels.'<br>';
mysql_query($insert_clan_channels);
mysql_query($insert_clan_groups);
mysql_query($insert_acl);
}
// Entferne Channels von Clans die es nicht mehr gibt!
mysql_query($remove_clan_channel_sql);
// Nun die User :)
$qry = mysql_query($sql_user_select);
while($row = mysql_fetch_assoc($qry)){
// Zu Gruppe hinzufuegen oder aus gruppe entfernen?
if($row['ch_name'] == NULL){
// Hinzufuegen
$sql = 'INSERT INTO '.$mumbledb.'.group_members(group_id, server_id, user_id, addit) values('.$row['g2_group_id'].', '.$serverid.', '.$row['user_id'].',1)';
// echo $sql.'<br>';
mysql_query($sql);
} else if($row['ch2_name'] == NULL){
// Entfernen
$sql = 'DELETE FROM '.$mumbledb.'.group_members where group_id = '.$row['g_group_id'].' and server_id = '.$serverid.' and user_id = '.$row['user_id'];
// echo $sql.'<br>';
mysql_query($sql);
}
}
?>

@ -0,0 +1,52 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
include "db.php";
$row2 = mysql_query("SELECT c1.lernpunkte AS c1lern, c2.lernpunkte AS c2lern, u.round, u.win, u.hp1, u.hp2,c1.hp AS c1hp, c2.hp AS c2hp, c1.mp AS c1mp, c2.mp AS c2mp, u.mp1, u.mp2, c1.id AS c1id, c2.id AS c2id, c1.exp AS c1exp, c2.exp AS c2exp, i1.geld AS i1geld, i2.geld AS i2geld,
i1.id AS i1id, i2.id AS i2id FROM turnier_kampf u LEFT JOIN chars c1 ON(c1.id=u.char1) LEFT JOIN user i1 ON(i1.id=c1.besitzer) LEFT JOIN chars c2 ON(c2.id=u.char2) LEFT JOIN user i2 ON(i2.id=c2.besitzer) WHERE u.art='chu_pruef' ORDER BY u.round ASC");
$x=0;
while($row = mysql_fetch_array($row2)) {
if($row[round] == 4) {
$new_geld1 = 200000;
$trainings_points1 = 20;
$new_lernpunkte1 = 4;
$new_geld2 += 200000;
$trainings_points2 = 20;
$new_lernpunkte2 = 4;
if($row[win] == $row[c1id]) {
$new_geld1 += 300000;
$trainings_points1 += 30;
$new_lernpunkte1 = 6;
}
if($row[win] == $row[c2id]) {
$new_lernpunkte2 = 6;
$trainings_points2 += 50;
$new_geld2 += 500000;
}
//////////////////pause
$weiter_1[0]= $row[c1id];
$weiter_1[1]= $row[c2id];
}
}
mysql_query("UPDATE chars SET n_missionpunkte=n_missionpunkte+45000, training_points=training_points+'$trainings_points1', lernpunkte='$new_lernpunkte1' WHERE id='$weiter_1[0]' LIMIT 1");
mysql_query("UPDATE chars SET n_missionpunkte=n_missionpunkte+45000, training_points=training_points+'$trainings_points2', lernpunkte='$new_lernpunkte2' WHERE id='$weiter_1[1]' LIMIT 1");
/*
mysql_query("UPDATE user SET geld='$new_geld1' WHERE id='$row[i1id]' LIMIT 1");
mysql_query("UPDATE user SET geld='$new_geld2' WHERE id='$row[i2id]' LIMIT 1");
*/
?>

@ -0,0 +1,111 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
set_time_limit(0);
$art_1 ="chu_pruef";
function rand_array($array)
{
$maxarray=count($array)-1;
mt_srand((double)microtime()*1000000);
for($i=$maxarray; $i>=0; $i--)
{
if($i>0) $zufall=mt_rand(0,$i);
else $zufall=0;
$temp=$array[$i];
$array[$i]=$array[$zufall];
$array[$zufall]=$temp;
$newarray[]=$array[$i];
array_pop($array);
}
return $newarray;
}
include "db.php";
$max_charakter = mysql_num_rows(mysql_query("SELECT id FROM n_turnier_reg LIMIT 16"));
if($max_charakter<16) {
echo "Turnier kann nicht beginn.";
exit;
}
mysql_query("DELETE FROM turnier_kampf WHERE art='$art_1'");
$char1 = mysql_query("SELECT charakter FROM n_turnier_reg ORDER BY id ASC LIMIT 16");
while($row=mysql_fetch_array($char1))
{
$test2[]=$row['charakter'];
}
$test2 = rand_array($test2);
$test3=$test2;
reset($test3);
while(current($test3)!=end($test2))
{
if(empty($list)) $list=current($test3);
else $list.=','.next($test3);
}
$result=mysql_query("SELECT * FROM chars WHERE id IN(".$list.") LIMIT 16");
while($row=mysql_fetch_array($result))
{
$charas[$row['id']]=$row;
}
$a8=0;
$b8=1;
$round = 1;
while($a8 < 16)
{
$chara_1 = $charas[$test2[$a8]];
$chara_2 = $charas[$test2[$b8]];
include "turnier_kampf.php";
$a8+=2;
$b8+=2;
}
while($round < 4)
{
unset($test9);
$chars_win = mysql_Query("SELECT win FROM turnier_kampf WHERE round='$round' AND art='$art_1'");
while($row9 = mysql_fetch_array($chars_win))
{
$test9[]=$row9['win'];
}
$round++;
$k9=0;
$l9=1;
while($k9 < count($test9))
{
$chara_1 = $charas[$test9[$k9]];
$chara_2 = $charas[$test9[$l9]];
include "turnier_kampf.php";
$k9+=2;
$l9+=2;
}
}
mysql_query("DELETE FROM n_turnier_reg ORDER BY id ASC LIMIT 16");
?>

@ -0,0 +1,13 @@
######Special Charakter
Black Boo F: Magia
Brolly F: Saiyajins
Gold Rogger F: Gran Maschin
Monkey D. Ruffy F: Piraten
Lorendor Zorro F: Schwert K&auml;mpfer
Mac Magia F: Hexe
Babidi : D&auml;mon
Vegeta (BLACK-BOO) Fusion F:Mutanten
Hildegarn H&auml;lfte 1 F: namekianer
Hildegarn H&auml;lfte 2 F: Cyborg
Grandcer F: Menschen

@ -0,0 +1,243 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$test = date("H");
include "db.php";
include_once ('inclu/messagefunctions.inc.php');
include_once ('clanfights.inc.php');
if ($test == "02") {
$i = 0;
}
if ($test == "04") {
$i = 1;
}
if ($test == "06") {
$i = 2;
}
if ($test == "08") {
$i = 3;
}
if ($test == "10") {
$i = 4;
}
if ($test == "12") {
//Jeden Tag gibts es was für Wanted
// $rangliste1 = mysql_query("SELECT besitzer, name, preis FROM chars order by preis");
// while($row = mysql_fetch_array($rangliste1)) {
// insertUserTickerMessage($row['besitzer'], ' '.$row['preis'].' Geld durch deinen Wanted erhalten');
// mysql_query("UPDATE user SET geld= geld + '$row[preis]' WHERE id='$row[besitzer]'");
// if ($row['preis']>10000){
// $IP = $row['preis']/1000;
// mysql_query("UPDATE user SET pkt= pkt + '$IP' WHERE id='$row[besitzer]'");
// insertUserTickerMessage($row['besitzer'], ' '.$IP.' IP durch deinen Wanted erhalten, da du eine Grenze überschritten hast');
// }
// }
$i = 5;
}
if ($test == "14") {
$i = 6;
}
if ($test == "16") {
$i = 7;
}
if ($test == "18") {
$i = 8;
}
if ($test == "20") {
$i = 9;
}
if ($test == "22") {
$i = 10;
}
if ($test == "00" || $_GET['midnight'] == 1) {
$i = 11;
}
########################CLAN ITEMS BENUTZEN
if ($i == 11) {
// Erstmal Arena (auch wenns nix mit Training zu tun hat)
// select round(einnahmen*0.5/(1+EXP(2-einnahmen/100000))) from arena where einnahmen > 10000
// Kann erstmal bleiben!
mysql_query('Update arena set zustand = zustand - 1/4 where mietlasten >= 2 and einnahmen > 0');
mysql_query('Update arena set zustand = 0 where zustand < 0'); // No negatives any more
$freibetrag = 300000;
$steuersatz_start = 25;
$faktor_level = 3;
$faktor_finanz = 2;
$sql = 'Update arena set mietlasten = mietlasten + 1, steuerlasten = steuerlasten + ceil((einnahmen - '.$freibetrag.') * (('.$steuersatz_start.' + level * '.$faktor_level.' -hausmeister * '.$faktor_finanz.')/100)) where ceil((einnahmen - '.$freibetrag.') * (('.$steuersatz_start.' + level * '.$faktor_level.' -hausmeister * '.$faktor_finanz.')/100)) > 0';
// echo $sql.'<br>';
mysql_query($sql);
mysql_query('Update arena set einnahmen = 0');
// Inaktive Clans löschen (Clanräume werden automatisch gelöscht durch Fremdschlüssel)
mysql_query('delete from clan where id NOT IN(SELECT distinct(clan) from user )');
// Räume die Ticker auf (Massivster Datenmüll!!)
mysql_query('DELETE FROM clan_ticker WHERE date < TIMESTAMPADD(day, -7, now())');
mysql_query('DELETE FROM user_ticker WHERE date < TIMESTAMPADD(day, -7, now())');
// Benutze Clan items!!
// Folgende SQL-Anweisung ermittelt mit einer kleinen Hilfsfunktion die Summe der Miete und das Geld des Clans
$mindestchar = 12; // War vorher 40;
$sql = 'SELECT cw.id as clan_train, if(count(ch.id)<'.$mindestchar.','.$mindestchar.',count(ch.id)) * miete as mietkosten, c.id as clan, c.geld as geld from clan_ware cw inner join clan_item ci on cw.item_id = ci.id inner join clan c on cw.clan = c.id inner join user u on u.clan = c.id left join chars ch on ch.clan_train = cw.id and ch.besitzer = u.id group by c.id, cw.id order by c.id';
// SQL-Anweisung, wenn Ungenutzte items nicht beruecksichtigt werden sollen -> 'SELECT ch.clan_train, if(count(ch.id)<40,40,count(ch.id)) * miete as mietkosten, c.id as clan, c.geld as geld from user u inner join clan c on u.clan = c.id inner join chars ch on u.id = ch.besitzer inner join clan_ware cw on cw.clan = c.id inner join clan_item ci on cw.item_id = ci.id and ch.clan_train = cw.id group by c.id, cw.id order by c.id'
// echo '<br>'.$sql.'<br>';
$clan_kosten = mysql_query($sql);
$clan_raum_array = array();
while ($row = mysql_fetch_assoc($clan_kosten)){
if($clan_raum_array[$row['clan']] === null){
$clan_raum_array[$row['clan']] = $row;
} else{
$clan_raum_array[$row['clan']]['mietkosten'] += $row['mietkosten'];
}
}
$clans = array ();
// while ($row = mysql_fetch_assoc($clan_kosten)) {
foreach($clan_raum_array as $row){
// print_r($row);
// Ermittle das Vermoegen und die Useranzahl des Clans!
if ($row['mietkosten'] > $row['geld']) {
// Clan is pleite!
// echo 'Clan '.$row['clan'].' is Pleite!';
insertClanTickerMessage($row['clan'], 'Die Miete f&uuml;r die R&auml;ume ('.displayMoney($row['mietkosten']).') konnte nicht bezahlt werden!');
} else {
// Clan kann miete bezahlen, also in Trainingsliste aufnehmen
$clans[] = $row['clan'];
// Clan die Miete abziehen
mysql_query('UPDATE clan SET geld = geld - ' . $row['mietkosten'] . ' WHERE id = ' . $row['clan']);
insertClanTickerMessage($row['clan'], 'Die Miete f&uuml;r die R&auml;ume ('.displayMoney($row['mietkosten']).') wurde bezahlt!');
}
}
// Ermittle die Kosten fuer die Nutzer (es werden nur Chars beruecksichtigt, die genug TP haben)
$sql = 'select besitzer, user.geld, sum(1/(1+exp(3-level/12)) * nutzung) as nutzkosten from user inner join chars on chars.besitzer = user.id inner join clan_ware on chars.clan_train = clan_ware.id inner join clan_item on clan_ware.item_id = clan_item.id where user.clan = clan_ware.clan and user.clan IN (' . join(',', $clans) . ') and clan_item.tp <= chars.training_points group by besitzer order by besitzer';
$user_kosten = mysql_query($sql);
// echo '<br>'.$sql.'<br>';
$users = array ();
if (count($clans) != 0) {
while ($row = mysql_fetch_assoc($user_kosten)) {
if ($row['nutzkosten'] > $row['geld']) {
// User is pleite!
insertUserTickerMessage($row['besitzer'], 'Die Nutzungsgeb&uuml;hren ('.displayMoney($row['nutzkosten']).') f&uuml;r die R&auml;ume konnte nicht bezahlt werden!');
} else {
// User kann Nutzkosten bezahlen, also in Trainingsliste aufnehmen
$users[] = $row['besitzer'];
// Clan die Miete abziehen
mysql_query('UPDATE user SET geld = geld - ' . $row['nutzkosten'] . ' WHERE id = ' . $row['besitzer']);
insertUserTickerMessage($row['besitzer'], 'Die Nutzungsgeb&uuml;hren ('.displayMoney($row['nutzkosten']).') f&uuml;r die R&auml;ume wurde bezahlt!');
}
}
$sql = 'Update chars inner join user on chars.besitzer = user.id inner join clan_ware on chars.clan_train = clan_ware.id inner join clan_item on clan_ware.item_id = clan_item.id SET chars.starke = clan_item.staerke + chars.starke, chars.speed = chars.speed + clan_item.geschwindigkeit, chars.verteidigung = chars.verteidigung + clan_item.verteidigung, chars.glueck = chars.glueck + clan_item.glueck, chars.ausdauer = chars.ausdauer + clan_item.ausdauer, chars.training_points = chars.training_points - clan_item.tp WHERE user.clan = clan_ware.clan and chars.besitzer IN(' . join(',', $users) . ') and chars.training_points >= clan_item.tp';
$check = mysql_query($sql);
}
// echo '<br>'.$sql.'<br>';
}
#########################EXIT
$char_info = mysql_query("SELECT training_points, id, training, starke, verteidigung, speed, ausdauer, glueck, mp, hp, level FROM chars");
$x = 0;
while ($row = mysql_fetch_array($char_info)) {
$hp = explode(",", $row['hp']);
$mp = explode(",", $row['mp']);
$trains = explode(",", $row['training']);
if (!$trains[$i] || $trains[$i] == 'ausruhen') {
mysql_query("UPDATE chars SET hp='$hp[1],$hp[1]', mp='$mp[1],$mp[1]' WHERE id='$row[id]' LIMIT 1");
} else {
if ($row[training_points] > 1) {
if ($trains[$i] == 'hp' OR $trains[$i] == 'mp') {
if ($trains[$i] == hp) {
$zu[$x] = $hp[1] + 20;
$zu[$x] = "$hp[0],$zu[$x]";
} else if ($trains[$i] == 'mp') {
$zu[$x] = $mp[1] + 10;
$zu[$x] = "$mp[0],$zu[$x]";
}
// echo "UPDATE chars SET $trains[$i]='$zu[$x]', training_points=training_points-2 WHERE id='$row[id]' LIMIT 1<br>";
mysql_query("UPDATE chars SET $trains[$i]='$zu[$x]', training_points=training_points-4 WHERE id='$row[id]' LIMIT 1");
} else {
$event = mysql_fetch_assoc(mysql_query('SELECT CURRENT_TIMESTAMP between TIMESTAMP(\'2009-04-25 00:00:00\') and TIMESTAMP(\'2009-05-02 23:59:59\') as betw'));
$step = 2 + ($event['betw']*3);
$news2 = $trains[$i];
$news[$x] = $row[$news2] + $step;
$step*=2;
$sql = "UPDATE chars SET $news2='$news[$x]', training_points=training_points-$step WHERE id='$row[id]' LIMIT 1";
// echo $sql.'<br>'."\n";
mysql_query($sql);
}
}
}
$x++;
}
mysql_query('DELETE FROM ag_chat where TIMESTAMPDIFF(Hour,zeit,now()) > 48');
mysql_query('DELETE FROM user_activation where TIMESTAMPDIFF(day, registerdate, now()) > 7');
// Loesche inaktive anons :)
mysql_query('DELETE FROM anon_chatter WHERE TIMESTAMPDIFF(day, online, now()) > 35'); // 5 Wochen
// Loesche inaktive user!
$sql = 'Select * from user where TIMESTAMPDIFF(week, online_zeit, now()) > 10 and id > 2';
//echo $sql;
$u_qry = mysql_query($sql);
if (mysql_num_rows($u_qry) != 0) {
$user = array ();
while ($row = mysql_fetch_assoc($u_qry)) {
$user[] = $row['id'];
}
$users = join(',', $user);
// echo 'Delete inactive Users ' . $users . '<br>';
mysql_query('Delete from user where id in (' . $users . ')');
mysql_query('Delete from arena where besitzer in (' . $users . ')');
mysql_query('Delete from ware where user in (' . $users . ')');
mysql_query('Delete from npc_ware where user in (' . $users . ')');
mysql_query('Delete from sp_ware where user in (' . $users . ')');
mysql_query('Delete from wochen_ware where user in (' . $users . ')');
mysql_query('Delete from user_ticker where userid in (' . $users . ')');
mysql_query('Delete from user_rename where userid in (' . $users . ')');
mysql_query('Delete from user_clan where userid in (' . $users . ')');
mysql_query('Delete from nachricht where besitzer in (' . $users . ')');
mysql_query('Delete from ignolist where user in (' . $users . ') or besitzer in (' . $users . ')');
$char = array ();
$c_qry = mysql_query('Select * from chars where besitzer IN (' . $users . ')');
while ($row = mysql_fetch_assoc($c_qry)) {
$char[] = $char['id'];
}
$chars = join(',', $char);
mysql_query('Delete from chars where id IN (' . $chars . ')');
mysql_query('Delete from lernen where besitzer IN (' . $chars . ')');
mysql_query('Delete from quests where charid IN (' . $chars . ')');
mysql_query('Delete from quests_fights where charid IN (' . $chars . ')');
mysql_query('Delete from quests_rounds where charid IN (' . $chars . ')');
mysql_query('Delete from kampf where dbsatz IN (' . $chars . ')');
mysql_query('Delete from kampf_list where charakter IN (' . $chars . ')');
mysql_query('Delete from char_abholcodes where charid IN (' . $chars . ')');
}
$qry = mysql_query('SELECT id, zeitpunkt, clanfighttyp FROM clan_fight_list WHERE status=1');
while($row = mysql_fetch_assoc($qry)){
if ($row['zeitpunkt'] <= time()) {
$status_updaten= mysql_query('UPDATE clan_fight_list SET status=2 WHERE id='.$row['id'].' LIMIT 1');
if ($row['clanfighttyp'] == 1) {
clanFightExecute($row['id']);
} elseif ($row['clanfighttyp'] == 2) {
clanFightExecute_survival($row['id']);
}
}
}
?>

@ -0,0 +1,124 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$art_1 ="wochen";
//set_time_limit(0);
function rand_array($array)
{
$maxarray=count($array)-1;
mt_srand((double)microtime()*1000000);
for($i=$maxarray; $i>=0; $i--)
{
if($i>0) $zufall=mt_rand(0,$i);
else $zufall=0;
$temp=$array[$i];
$array[$i]=$array[$zufall];
$array[$zufall]=$temp;
$newarray[]=$array[$i];
array_pop($array);
}
return $newarray;
}
include "db.php";
$max_charakter = mysql_num_rows(mysql_query("SELECT id FROM chars LIMIT 64"));
if($max_charakter<64) {
exit;
}
mysql_query("DELETE FROM turnier_kampf WHERE art='$art_1'");
$char1 = mysql_query("SELECT charakter FROM turnier1 WHERE art='$art_1'");
while($row=mysql_fetch_array($char1))
{
$test2[]=$row['charakter'];
}
do
{
if(count($test2)<64)
{ // WHERE status='Frei'
list($count) = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM chars"));
if(($count+count($test2))>=64)
{
$result = mysql_query("SELECT id FROM chars WHERE status='Frei' AND rasse !='NPC' ORDER BY RAND() LIMIT ".(64-count($test2)));
while($char_name2=mysql_fetch_array($result))
{
$test2[]=$char_name2['id'];
}
}
}
$test2 = rand_array($test2);
$test2 = array_unique($test2);
}
while(count($test2)<64);
$test3=$test2;
reset($test3);
while(current($test3)!=end($test2))
{
if(empty($list)) $list=current($test3);
else $list.=','.next($test3);
}
$result=mysql_query("SELECT * FROM chars WHERE id IN(".$list.") LIMIT 64");
while($row=mysql_fetch_array($result))
{
$charas[$row['id']]=$row;
}
$a8=0;
$b8=1;
$round = 1;
while($a8 < 64)
{
$chara_1 = $charas[$test2[$a8]];
$chara_2 = $charas[$test2[$b8]];
include "turnier_kampf.php";
$a8+=2;
$b8+=2;
}
while($round < 6)
{
unset($test9);
$chars_win = mysql_Query("SELECT win FROM turnier_kampf WHERE round='$round' AND art='$art_1'");
while($row9 = mysql_fetch_array($chars_win))
{
$test9[]=$row9['win'];
}
$round++;
$k9=0;
$l9=1;
while($k9 < count($test9))
{
$chara_1 = $charas[$test9[$k9]];
$chara_2 = $charas[$test9[$l9]];
include "turnier_kampf.php";
$k9+=2;
$l9+=2;
}
}
mysql_query("DELETE FROM turnier1 WHERE art='$art_1' ");
?>

@ -0,0 +1,199 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$uzze = 0;
while ($uzze < 10) {
$aktion_AV1[$uzze] = "";
$aktion_AV2[$uzze] = "";
$uzze++;
}
$ssj_tech_1 = "";
$ssj_tech_2 = "";
$play1_ausweich = "";
$play2_ausweich = "";
$k_exp[0] = "";
$X23 = "";
$X13 = "";
$schaden_1 = "";
$schaden_2 = "";
$runden_type1 = 0;
$runden_type2 = 0;
$runden_summon1 = "";
$runden_summon2 = "";
$runden_gif1 = "";
$runden_gif_technik1 = "";
################## Kaempfer 1
$k_hp1 = explode(",", $chara_1[hp]);
$k_mp1 = explode(",", $chara_1[mp]);
$k_hp1[0] = $k_hp1[1];
$k_mp1[0] = $k_mp1[1];
$k_starke[0] = $chara_1[starke] + $k_rustung[ru_mal];
$k_speed[0] = $chara_1[speed];
$k_ver[0] = $chara_1[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[0] = $chara_1[ausdauer];
$k_glueck[0] = $chara_1[glueck];
$k_attacke1 = explode(",", $chara_1[attacken]);
$k_hp[0] = round($k_hp1[0]);
$k_mp[0] = round($k_mp1[0]);
$k_aufgabe_a_1 = $k_hp1[1] / 100;
$k_aufgabe[0] = $k_aufgabe_a_1 * $chara_1[aufgeben];
######################################Kaempfer2
$k_hp2 = explode(",", $chara_2[hp]);
$k_mp2 = explode(",", $chara_2[mp]);
$k_hp2[0] = $k_hp2[1];
$k_mp2[0] = $k_mp2[1];
$k_starke[1] = $chara_2[starke] + $k_rustung[ru_mal];
$k_speed[1] = $chara_2[speed];
$k_ver[1] = $chara_2[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[1] = $chara_2[ausdauer];
$k_glueck[1] = $chara_2[glueck];
$k_attacke2 = explode(",", $chara_2[attacken]);
$k_hp[1] = round($k_hp2[0]);
$k_mp[1] = round($k_mp2[0]);
$k_aufgabe_a_2 = $k_hp2[1] / 100;
$k_aufgabe[1] = $k_aufgabe_a_2 * $chara_2[aufgeben];
$x = 0;
$sql = "INSERT turnier_kampf SET hp1='$k_hp[0]', hp2='$k_hp[1]', mp1='$k_mp[0]', mp2='$k_mp[1]', schaden1='$schaden_1', schaden2='$schaden_2', attacke1='$technick1[name]', attacke2='$technick2[name]', char1='$chara_1[id]', char2='$chara_2[id]', starke1='$k_starke[0]', starke2='$k_starke[1]', ver1='$k_ver[0]', ver2='$k_ver[1]', speed1='$k_speed[0]', speed2='$k_speed[1]', ausdauer1='$k_ausdauer[0]', ausdauer2='$k_ausdauer[1]', glueck1='$k_glueck[0]', glueck2='$k_glueck[1]'";
if(mysql_query($sql) === false){
echo $sql.' Failed!!<br>';
}
while ($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$technick1 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$prozent_technik1 = (20 * $technick1[aktiv]) - 20;
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick2 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2[$x]' LIMIT 10"));
$prozent_technik2 = (20 * $technick2[aktiv]) - 20;
$technick2 = mysql_fetch_array(mysql_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 "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_rand($speeds_char1_4, $speeds_char1);
$speed_char2 = mt_rand($speeds_char2_4, $speeds_char2);
include "kampf_include.php"; ////Rechnung
#####################################KAMPF SYSTEM
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 = mysql_query($sql)) === false){
echo $sql.' Failed!!<br>';
}
$db_query = mysql_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.'<br>';
mysql_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] = (($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] = (($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 / 6)) / 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] = ($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 / 6)) * 2;
$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] = ($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] = ($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 / 6)) * 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)) / 2) * 5;
$k_geld[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 / 6)) / 2) * 2;
}
if ($k_exp[0]) {
$s = 2;
} else {
$s++;
}
}
$dauer_Z = time();
mysql_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]'");
?>

@ -0,0 +1,165 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
// Laden der db-Verbindung
ignore_user_abort(true);
include "db.php";
// Da es wichtig ist, dass die Querys korrekt abgehandelt werden wurde folgender Code eingefuehrt
function database_query($sql){
$tmp = mysql_query($sql);
if(!$tmp){
echo 'SQL-Anweisung '.$sql.' konnte nicht ausgefuehrt werden!!<br>';
}
return $tmp;
}
// Handelt eine einzelne Auktion ab
// @Return nichts
function bearbeiteAbgelaufeneAuktion($auktionsid){
// echo '<br>bearbeite '.$auktionsid.'</br>';
$qry = database_query('SELECT u.nickname AS anbietername, u2.nickname AS bietername, a.auktionsid,a.anbieter,a.bieter,a.itemid,a.itemname,a.tablename,a.anzahl,a.startgebot,a.aktuellesgebot,a.deadline,a.startdate,a.cheatingverdacht, TIMESTAMPDIFF(Minute,now(),deadline) AS zeitdifferenz FROM auktion AS a INNER JOIN user as u ON a.anbieter = u.id LEFT JOIN user as u2 ON a.bieter = u2.id WHERE auktionsid = '.$auktionsid);
if(mysql_num_rows($qry) == 0){ return NULL; }
$result = mysql_fetch_assoc($qry);
$itemreceiver = '';
// Nun muss geprüft werden, ob überhaupt jemand geboten hat!
if($result['bieter'] == NULL){ // Wenn nicht, dann geht das item an den anbieter
$itemreceiver = $result['anbieter'];
}
else{
// Ansonsten geht das Item an den Bietenden
$itemreceiver = $result['bieter'];
// Aber erst muss das Geld überwiesen werden
$erhalten = ceil($result['aktuellesgebot'] * 0.99);
$gebuehr = $result['aktuellesgebot'] - $erhalten;
database_query('UPDATE user SET geld = geld - '.$result['aktuellesgebot'].' WHERE id = '.$result['bieter']);
database_query('UPDATE user SET geld = geld + '.$erhalten.' WHERE id = '.$result['anbieter']);
if($result[cheatingverdacht] == 0){ // Wenn cheatingverdacht nicht besteht, dann pruefe ob Verdacht besteht!!
$avgprice = getAveragePrice($result[itemid], $result[tablename], $result[anzahl]);
if($avgprice != 0 && $avgprice * 1.2 < $result['aktuellesgebot'] && $result['anbieter'] != 1){
$result[cheatingverdacht] = 1;
}
}
//Transaktion verbuchen
$test = 'INSERT INTO auktion_transaktionen (anbieter, bieter, itemid, tablename, anzahl, betrag, deadline,cheatingverdacht) VALUES('.$result['anbieter'].','.$result['bieter'].','.$result['itemid'].',\''.$result['tablename'].'\','.$result['anzahl'].','.$result['aktuellesgebot'].',\''.$result['deadline'].'\','.$result['cheatingverdacht'].')';
database_query($test);
//echo '<br><br>'.$test.'<br><br>';
}
$anzahl = $result['anzahl'];
$item_row_name = 'item';
if($result['tablename'] == 'ware'){$item_row_name = 'item_id';}
while($anzahl-- > 0){
database_query('INSERT INTO '.$result['tablename'].' ('.$item_row_name.', user) VALUES('.$result['itemid'].','.$itemreceiver.')');
}
database_query('DELETE FROM auktion WHERE auktionsid = '.$auktionsid);
if($result['bieter'] == NULL){
database_query('INSERT INTO nachricht(von, besitzer, betreff, text) VALUES (\'Auktionsmarkt\', '.$result['anbieter'].', \'Item nicht verkauft\', \' Tut mir leid, doch Sie sind das Item '.$result['itemname'].' mit dem Startgebot '.$result['startgebot'].' nicht losgeworden. Deadline war '.$result['deadline'].'\')');
} else{
// Nun noch die Gluecklichen benachrichtigen
database_query('INSERT INTO nachricht(von, besitzer, betreff, text) VALUES (\'Auktionsmarkt\', '.$result['anbieter'].', \'Item erfolgreich verkauft\', \' Herzlichen Gl&uuml;ckwunsch, Sie sind das Item '.$result['itemname'].' f&uuml;r ganze '.$result['aktuellesgebot'].' an '.$result['bietername'].' losgeworden. Anzahl war '.$result['anzahl'].'. Nach abzug der Geb&uuml;hr von '.$gebuehr.' (ca. 1%) bleiben noch '.$erhalten.' &uuml;ber. Deadline war '.$result['deadline'].'\')');
database_query('INSERT INTO nachricht(von, besitzer, betreff, text) VALUES (\'Auktionsmarkt\', '.$result['bieter'].', \'Item erfolgreich ersteigert\', \' Herzlichen Gl&uuml;ckwunsch, Sie haben das Item '.$result['itemname'].' f&uuml;r ganze '.$result['aktuellesgebot'].' von '.$result['anbietername'].' ersteigert. Anzahl war '.$result['anzahl'].', Deadline war '.$result['deadline'].'\')');
}
}
//Sucht nach abgelaufenen Auktionen und handelt diese ab
// @Return nichts
function bearbeiteAlleAbgelaufenenAuktionen(){
$qry = database_query('SELECT auktionsid from auktion where TIMESTAMPDIFF(Minute,now(),deadline) < 0');
// Gehe alle Auktionen durch und bearbeite diese
$index = 0;
while($result = mysql_fetch_assoc($qry)){
bearbeiteAbgelaufeneAuktion($result['auktionsid']);
$index++;
}
return $index;
}
function insertAuktionen(){
if(Date("D") == 'Sun'){
$anzahl_auktionen = mt_rand(1,2); // anzahl der auktionen die gleichzeitig starten (ein oder zwei)
$startgebot = 1000000;
// Jeden Sonntag wird dieser Skript ausgefuehrt!
// erstmal checken obs schon Auktionen für kommende Woche gibt
$number = mysql_num_rows(database_query('SELECT * FROM auktion WHERE anbieter = 1 and TIMESTAMPDIFF(Second,startdate,now()) < 0'));
// echo $number.'= Number of effected rows';
if($number == 0){
// So, also es sind noch keine Auktionen vorhanden!!
// Nun 6 Auktionen erstellen 3x2 Auktionen (update 2x2)
$date = mysql_fetch_assoc(database_query('Select current_date AS date'));
$qry = database_query('SELECT id FROM `wochen_markt` WHERE aktiv = \'ja\'');
$fruchtcount = 0;
$frucht = array();
while($result = mysql_fetch_assoc($qry)){
$frucht[$fruchtcount++] = $result[id];
}
for($i = 0; $i<$anzahl_auktionen;$i++){
$id1[$i] = mt_rand(0,$fruchtcount-1);
$id2[$i] = mt_rand(0,$fruchtcount-1);
}
// Termine festlegen
// Start Sonntag->0,Montag->1,Dienstag->2, Mittwoch->3, Donnerstag->4
$off1 = mt_rand(0,4);
$off2 = mt_rand(0,4);
$start1 = 'TIMESTAMPADD(Day,'.$off1.',\''.$date[date].' 20:00:00\')';
$deadline1 = 'TIMESTAMPADD(Day,'.($off1+3).',\''.$date[date].' 20:00:00\')';
$start2 = 'TIMESTAMPADD(Day,'.$off2.',\''.$date[date].' 20:00:00\')';
$deadline2 = 'TIMESTAMPADD(Day,'.($off2+3).',\''.$date[date].' 20:00:00\')';
// Auktinoen der ersten Auktionswelle einfuegen
for($i=0;$i<$anzahl_auktionen;$i++){
$test1 = 'INSERT INTO auktion (itemid, itemname, tablename, anbieter, anzahl, deadline, startgebot, startdate) VALUES('.$frucht[$id1[$i]].',\'Geheim!\',\'wochen_ware\',1,1,'.$deadline1.','.$startgebot.','.$start1.')';
$test2 = 'INSERT INTO auktion (itemid, itemname, tablename, anbieter, anzahl, deadline, startgebot, startdate) VALUES('.$frucht[$id2[$i]].',\'Geheim!\',\'wochen_ware\',1,1,'.$deadline2.','.$startgebot.','.$start2.')';
database_query($test1);
database_query($test2);
// echo $test1.'<br>'.$test2.'<br>';
}
} else if($number > 6){
database_query('DELETE FROM auktion WHERE anbieter = 1 LIMIT '.($number-6));
}
}
}
function detectMultiAccounts(){
$sql = 'Select u1.id as uid1, u2.id as uid2, u1.nickname as n1, u2.nickname as n2 , u1.ip as ip1, u2.ip as ip2, u1.online_zeit as o1, u2.online_zeit as o2 from user as u1 inner join user as u2 on u1.ip = u2.ip and u1.id < u2.id and u1.ip != \'\' and abs(TIMESTAMPDIFF(HOUR, u1.online_zeit, u2.online_zeit)) < 24 and (abs(TIMESTAMPDIFF(HOUR, now(), u1.online_zeit)) < 1 || abs(TIMESTAMPDIFF(HOUR, now(), u2.online_zeit)) < 1)';
$qry = mysql_query($sql);
while($tmp = mysql_fetch_assoc($qry)){
$otime = min($tmp['o2'], $tmp['o1']);
$sql = 'INSERT INTO multiuser(user1, user2, occured, type) values(\'' . $tmp['uid1'] . '\', \''.$tmp['uid2'].'\',\''.$otime.'\', \'IP_'.$tmp['ip1'].'\')';
mysql_query($sql);
}
}
// sollte irgendwann mit der auktion_funktions verlinkt werden
function getAveragePrice($itemid, $tablename, $anzahl){
$sql = 'SELECT avg(betrag) / avg(anzahl) AS average FROM auktion_transaktionen WHERE anbieter != 1 and itemid = '.$itemid.' and tablename = \''.$tablename.'\' and cheatingverdacht = 0';
$qry = database_query($sql);
$row = mysql_fetch_assoc($qry);
return round($row['average']*$anzahl);
}
// Starten der Auktionsverteilung
$i = bearbeiteAlleAbgelaufenenAuktionen();
//$sql = 'INSERT INTO nachricht(von, besitzer, betreff, text) VALUES (\'GM-INFO\', 3735, \'Cronjob lief!\', \' Der Vierteilstunde-Cronjob wurde ausgefuehrt! Es wurden '.$i.' Anfragen bearbeitet!\')';
//database_query($sql);
insertAuktionen();
detectMultiAccounts();
?>

@ -0,0 +1,78 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
set_time_limit(0);
function rand_array($array)
{
$maxarray=count($array)-1;
mt_srand((double)microtime()*1000000);
for($i=$maxarray; $i>=0; $i--)
{
if($i>0) $zufall=mt_rand(0,$i);
else $zufall=0;
$temp=$array[$i];
$array[$i]=$array[$zufall];
$array[$zufall]=$temp;
$newarray[]=$array[$i];
array_pop($array);
}
return $newarray;
}
include "db.php";
$max_charakter = mysql_num_rows(mysql_query("SELECT id FROM chars WHERE rasse!='NPC' LIMIT 500"));
if($max_charakter<500) {
exit;
}
$charakter = mysql_query("SELECT name, id FROM chars WHERE rasse!='NPC' ORDER BY level DESC LIMIT $max_charakter");
while($row=mysql_fetch_array($charakter))
{
$test2[]=$row['id'];
}
$test2 = rand_array($test2);
$test2 = array_unique($test2);
while(count($test2)<$max_charakter);
$test3=$test2;
reset($test3);
while(current($test3)!=end($test2))
{
if(empty($list)) $list=current($test3);
else $list.=','.next($test3);
}
$result=mysql_query("SELECT * FROM chars WHERE id IN(".$list.") LIMIT 500");
while($row=mysql_fetch_array($result))
{
$charas[$row['id']]=$row;
}
$a8=0;
$b8=1;
$round = 1;
while($a8 < $max_charakter)
{
$chara_1 = $charas[$test2[$a8]];
$chara_2 = $charas[$test2[$b8]];
include "wanted_kampf.php";
$a8+=2;
$b8+=2;
}
?>

@ -0,0 +1,194 @@
<?php
/*
*
* @copyright (c) 2010 animegame.eu
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
*
*/
$uzze=0;
while($uzze < 10) {
$aktion_AV1[$uzze] = "";
$aktion_AV2[$uzze] = "";
$uzze++;
}
$ssj_tech_1="";
$ssj_tech_2="";
$play1_ausweich="";
$play2_ausweich="";
$k_exp[0] = "";
$X23 = "";
$X13 = "";
$schaden_1="";
$schaden_2="";
$runden_type1=0;
$runden_type2=0;
################## Kaempfer 1
$k_hp1 = explode(",", $chara_1[hp]);
$k_mp1 = explode(",", $chara_1[mp]);
$k_hp1[0] = $k_hp1[1];
$k_mp1[0] = $k_mp1[1];
$k_starke[0] = $chara_1[starke] + $k_rustung[ru_mal];
$k_speed[0] = $chara_1[speed];
$k_ver[0] = $chara_1[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[0] = $chara_1[ausdauer];
$k_glueck[0] = $chara_1[glueck];
$k_attacke1 = explode(",", $chara_1[attacken]);
$k_hp[0] = round($k_hp1[0]);
$k_mp[0] = round($k_mp1[0]);
$k_aufgabe_a_1 = $k_hp1[1] / 100;
$k_aufgabe[0] = $k_aufgabe_a_1 * $chara_1[aufgeben];
######################################Kaempfer2
$k_hp2 = explode(",", $chara_2[hp]);
$k_mp2 = explode(",", $chara_2[mp]);
$k_hp2[0] = $k_hp2[1];
$k_mp2[0] = $k_mp2[1];
$k_starke[1] = $chara_2[starke] + $k_rustung[ru_mal];
$k_speed[1] = $chara_2[speed];
$k_ver[1] = $chara_2[verteidigung] + $k_rustung[ru_mal];
$k_ausdauer[1] = $chara_2[ausdauer];
$k_glueck[1] = $chara_2[glueck];
$k_attacke2 = explode(",", $chara_2[attacken]);
$k_hp[1] = round($k_hp2[0]);
$k_mp[1] = round($k_mp2[0]);
$k_aufgabe_a_2 = $k_hp2[1] / 100;
$k_aufgabe[1] = $k_aufgabe_a_2 * $chara_2[aufgeben];
$x=0;
mysql_query("INSERT wanted_kampf SET hp1='$k_hp[0]', hp2='$k_hp[1]', mp1='$k_mp[0]', mp2='$k_mp[1]', schaden1='$schaden_1', schaden2='$schaden_2', attacke1='$technick1[name]', attacke2='$technick2[name]', char1='$chara_1[id]', char2='$chara_2[id]', starke1='$k_starke[0]', starke2='$k_starke[1]', ver1='$k_ver[0]', ver2='$k_ver[1]', speed1='$k_speed[0]', speed2='$k_speed[1]', ausdauer1='$k_ausdauer[0]', ausdauer2='$k_ausdauer[1]', glueck1='$k_glueck[0]', glueck2='$k_glueck[1]'");
while($k_hp[0] > $k_aufgabe[0] AND $k_hp[1] > $k_aufgabe[1] AND $x < 10) {
$technick1 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke1[$x]' LIMIT 10"));
$prozent_technik1 = (20*$technick1[aktiv])-20;
$technick1 = mysql_fetch_array(mysql_query("SELECT * FROM attacken WHERE id='$technick1[at_id]' LIMIT 10"));
$technick2 = mysql_fetch_array(mysql_query("SELECT at_id, aktiv FROM lernen WHERE id='$k_attacke2[$x]' LIMIT 10"));
$prozent_technik2 = (20*$technick2[aktiv])-20;
$technick2 = mysql_fetch_array(mysql_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 "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_rand($speeds_char1_4,$speeds_char1);
$speed_char2 = mt_rand($speeds_char2_4,$speeds_char2);
include "kampf_include.php"; ////Rechnung
#####################################KAMPF SYSTEM
include "kampf/kampf_rechnung.php";
$db_query = mysql_fetch_array(mysql_query("SELECT * FROM wanted_kampf WHERE (char1='$chara_1[id]' OR char1='$chara_2[id]') AND dauer='0' order by id DESC LIMIT 1"));
mysql_query("UPDATE wanted_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]'");
$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] = 0;
$k_geld[1] = 0;
$k_exp[0] = 0;
$k_geld[0] = 0;
$new_dead_list1 = "$chara_1[dead_list],$chara_2[name]";
$new_dead_list2 = "";
$new_preis1 = $chara_1[preis] + (($chara_2[preis] / 100) * 10);
$new_preis2 = $chara_2[preis] - (($chara_2[preis] / 100) * 10);
$sieger = $chara_1[id];
$verlierer = $chara_2[id];
}
if($k_hp[0] < $k_aufgabe[0] OR $X23 == "HALLO") {
$new_dead_list2 = "$chara_2[dead_list],$chara_1[name]";
$new_dead_list1 = "";
$new_preis2 = $chara_2[preis] + $chara_1[preis];
$new_preis1 = 500;
$sieger = $chara_2[id];
$verlierer = $chara_1[id];
$k_exp[1] = 0;
$k_geld[1] = 0;
$k_exp[0] = 0;
$k_geld[0] = 0;
}
if($k_exp[0]) { $s=2; } else { $s++; }
}
$dauer_Z = time();
mysql_query("UPDATE chars SET preis='$new_preis1', dead_list='$new_dead_list1' WHERE id='$chara_1[id]' LIMIT 1");
mysql_query("UPDATE chars SET preis='$new_preis2', dead_list='$new_dead_list2' WHERE id='$chara_2[id]' LIMIT 1");
mysql_query("UPDATE wanted_kampf SET 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]'");
?>
Loading…
Cancel
Save