You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.7 KiB

14 years ago
<?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]'");
?>