parent
1c31547763
commit
fd894c9dc5
@ -1,39 +0,0 @@
|
|||||||
<?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('path.inc.php'); // get the path ;)
|
|
||||||
include_once (ROOT_PATH.'/include/sqlwrapper.inc.php');
|
|
||||||
include_once ('inclu/halloffame.inc.php');
|
|
||||||
include_once ('inclu/fruitdistribution.inc.php');
|
|
||||||
include_once ('inclu/exp.inc.php');
|
|
||||||
|
|
||||||
include_once ('inclu/turnier.inc.php');
|
|
||||||
include_once ('inclu/char.inc.php');
|
|
||||||
include_once(ROOT_PATH. "/include/random.inc.php");
|
|
||||||
|
|
||||||
// do the stuff for the whole exp and money distribution there ;)
|
|
||||||
$results = generateTournamentResults('wochen', 15000, 0);
|
|
||||||
$rang1 = getChar($results[0][0]);
|
|
||||||
|
|
||||||
insertIntoHallOfFame('Wochenturnier', $rang1['id'], $rang1['besitzer']);
|
|
||||||
|
|
||||||
$xiu=5;
|
|
||||||
|
|
||||||
if($xiu >= mt_random_wrapper(1, 100)) {
|
|
||||||
////////////////FRUCHT ARRAY
|
|
||||||
//include "array.php";
|
|
||||||
distributeFruit($rang1['besitzer']);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$prices[] = 50; // 1.
|
|
||||||
$prices[] = 40; // 2.
|
|
||||||
$prices[] = 30; // 3. + 4.
|
|
||||||
$prices[] = 20; // 5. - 8.
|
|
||||||
|
|
||||||
distributeShopPoints($prices, $results, 'Wochenturnier');
|
|
@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* @copyright (c) 2010 animegame.eu
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This script checks for completed tournaments to add the winner in the "hall-of-fame"
|
||||||
|
*/
|
||||||
|
|
||||||
|
include('db.php');
|
||||||
|
include('path.inc.php');
|
||||||
|
include_once (ROOT_PATH.'/include/sqlwrapper.inc.php');
|
||||||
|
include_once (ROOT_PATH.'/include/event.inc.php');
|
||||||
|
include_once (ROOT_PATH.'/include/halloffame.inc.php');
|
||||||
|
|
||||||
|
$tournaments = array();
|
||||||
|
$tournament_event_ids = array();
|
||||||
|
|
||||||
|
$qry = db_query('SELECT * FROM turniere WHERE ausgewertet = FALSE');
|
||||||
|
|
||||||
|
while ($row = mysqli_fetch_assoc($qry)) {
|
||||||
|
$tournament_event_ids[] = $row['event_id'];
|
||||||
|
$tournaments[$row['event_id']] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = 'select event_id, MAX(visible) < now() as done, MAX(event_fight_id) as final_fight_id FROM event_fights WHERE event_id IN ('.join(',', $tournament_event_ids).') GROUP BY event_id';
|
||||||
|
$qry = db_query($sql);
|
||||||
|
|
||||||
|
$tournaments_done = array();
|
||||||
|
|
||||||
|
while ($row = mysqli_fetch_assoc($qry)) {
|
||||||
|
if ($row['done']) {
|
||||||
|
$event_id = $row['event_id'];
|
||||||
|
$tournament = $tournaments[$event_id];
|
||||||
|
// determine the winner of the tournament ...
|
||||||
|
$final_fight = getEventFight($event_id, $row['final_fight_id']);
|
||||||
|
$winner_char = getEventChar($event_id, $final_fight['winner']);
|
||||||
|
$row = mysqli_fetch_assoc(db_query('Select max(id) as round from online'));
|
||||||
|
|
||||||
|
insertIntoHallOfFameFull($row['round'], $tournament['art'], $winner_char['char_id'], $winner_char['char_name'], $winner_char['user_id'], $winner_char['user_name'], '\''.$tournament['datum'].'\'', $tournament['id']);
|
||||||
|
$tournaments_done[] = $tournament['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($tournaments_done) > 0) {
|
||||||
|
db_query('UPDATE turniere SET ausgewertet = TRUE WHERE id IN ('.join(',', $tournaments_done).')');
|
||||||
|
}
|
@ -1,75 +0,0 @@
|
|||||||
<?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('path.inc.php'); // get the path ;)
|
|
||||||
include_once (ROOT_PATH.'/include/sqlwrapper.inc.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');
|
|
||||||
include_once (ROOT_PATH.'/include/usergroup.inc.php');
|
|
||||||
include_once ('inclu/turnier.inc.php');
|
|
||||||
include_once ('inclu/char.inc.php');
|
|
||||||
|
|
||||||
// calculate the avg level of the chars participating
|
|
||||||
$sql = '(Select distinct(char1) as x from turnier_kampf where art = \'gross\' ) union (Select distinct(char2) as x from turnier_kampf where art = \'gross\' )';
|
|
||||||
|
|
||||||
$charids = array();
|
|
||||||
$qry1 = db_query($sql);
|
|
||||||
while($row = mysqli_fetch_assoc($qry1)){
|
|
||||||
$charids[] = $row['x'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql2 = 'Select avg(level) as dlevel from chars where id in ('.join(',', $charids).')';
|
|
||||||
$row = mysqli_fetch_assoc(db_query($sql2));
|
|
||||||
|
|
||||||
$dlevel = ceil($row['dlevel']);
|
|
||||||
|
|
||||||
// do the stuff for the whole exp and money distribution there ;)
|
|
||||||
//$results = generateTournamentResults('gross', 250000, 2000000);
|
|
||||||
|
|
||||||
// Franky && Sinnes request no more money for rounds
|
|
||||||
$results = generateTournamentResults('gross', 250000, 0);
|
|
||||||
$rang1 = getChar($results[0][0]);
|
|
||||||
|
|
||||||
insertIntoHallOfFame('Weltturnier', $rang1['id'], $rang1['besitzer']);
|
|
||||||
|
|
||||||
//$natur_frucht = mysqli_num_rows(db_query("SELECT id FROM wochen_markt WHERE art='natur'")); ///wieviel TF gibt es?.
|
|
||||||
|
|
||||||
////////////////FRUCHT ARRAY
|
|
||||||
//include "array.php";
|
|
||||||
distributeFruit($rang1['besitzer']);
|
|
||||||
|
|
||||||
//Schutz vor automatischem löschen hinzufügen für den sieger :)
|
|
||||||
$usergroups = getUserGroups($rang1['besitzer']);
|
|
||||||
if(!isUserInGroup($usergroups, INAKTIV_LOESCHSCHUTZ) && !isUserInGroup($usergroups, AKTIV_LOESCHSCHUTZ)) {
|
|
||||||
addUserToGroup($rang1['besitzer'], INAKTIV_LOESCHSCHUTZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Durchschnittslevel
|
|
||||||
|
|
||||||
|
|
||||||
$summe = 20000000/(1+exp(5-$dlevel/14));
|
|
||||||
|
|
||||||
// Now distribute the shop points ;)
|
|
||||||
|
|
||||||
$prices[] = 4000000; // 1.
|
|
||||||
$prices[] = 3000000; // 2.
|
|
||||||
$prices[] = 2000000; // 3. + 4.
|
|
||||||
|
|
||||||
$cprices[] = ceil($summe/2);
|
|
||||||
$cprices[] = ceil($summe/4);
|
|
||||||
$cprices[] = ceil($summe/8);
|
|
||||||
|
|
||||||
distributeUserPrices($prices, $results, 'Weltturnier');
|
|
||||||
|
|
||||||
#distributeShopPoints($prices, $results, 'Weltturnier');
|
|
||||||
// clan prices are not distributed anymore!!
|
|
||||||
//distributeClanPrices($cprices, $results, 'Weltturnier');
|
|
||||||
|
|
||||||
?>
|
|
@ -1,79 +0,0 @@
|
|||||||
<?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('path.inc.php'); // get the path ;)
|
|
||||||
include_once (ROOT_PATH.'/include/sqlwrapper.inc.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');
|
|
||||||
include_once (ROOT_PATH.'/include/usergroup.inc.php');
|
|
||||||
include_once ('inclu/turnier.inc.php');
|
|
||||||
include_once ('inclu/char.inc.php');
|
|
||||||
|
|
||||||
$turnier_kurz = 'grossst';
|
|
||||||
$turnier_name = 'Weltturnier Non-Fusion';
|
|
||||||
|
|
||||||
|
|
||||||
// calculate the avg level of the chars participating
|
|
||||||
$sql = '(Select distinct(char1) as x from turnier_kampf where art = \''.$turnier_kurz.'\' ) union (Select distinct(char2) as x from turnier_kampf where art = \''.$turnier_kurz.'\' )';
|
|
||||||
|
|
||||||
$charids = array();
|
|
||||||
$qry1 = db_query($sql);
|
|
||||||
while($row = mysqli_fetch_assoc($qry1)){
|
|
||||||
$charids[] = $row['x'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql2 = 'Select avg(level) as dlevel from chars where id in ('.join(',', $charids).')';
|
|
||||||
$row = mysqli_fetch_assoc(db_query($sql2));
|
|
||||||
|
|
||||||
$dlevel = ceil($row['dlevel']);
|
|
||||||
|
|
||||||
// do the stuff for the whole exp and money distribution there ;)
|
|
||||||
//$results = generateTournamentResults($turnier_kurz, 250000, 2000000);
|
|
||||||
|
|
||||||
// Franky && Sinnes request no more money for rounds
|
|
||||||
$results = generateTournamentResults($turnier_kurz, 250000, 0);
|
|
||||||
$rang1 = getChar($results[0][0]);
|
|
||||||
|
|
||||||
insertIntoHallOfFame($turnier_name, $rang1['id'], $rang1['besitzer']);
|
|
||||||
|
|
||||||
//$natur_frucht = mysqli_num_rows(db_query("SELECT id FROM wochen_markt WHERE art='natur'")); ///wieviel TF gibt es?.
|
|
||||||
|
|
||||||
////////////////FRUCHT ARRAY
|
|
||||||
//include "array.php";
|
|
||||||
distributeParamecia($rang1['besitzer']);
|
|
||||||
|
|
||||||
//Schutz vor automatischem löschen hinzufügen für den sieger :)
|
|
||||||
$usergroups = getUserGroups($rang1['besitzer']);
|
|
||||||
if(!isUserInGroup($usergroups, INAKTIV_LOESCHSCHUTZ) && !isUserInGroup($usergroups, AKTIV_LOESCHSCHUTZ)) {
|
|
||||||
addUserToGroup($rang1['besitzer'], INAKTIV_LOESCHSCHUTZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Durchschnittslevel
|
|
||||||
|
|
||||||
|
|
||||||
$summe = 20000000/(1+exp(5-$dlevel/14));
|
|
||||||
|
|
||||||
// Now distribute the shop points ;)
|
|
||||||
|
|
||||||
$prices[] = 4000000; // 1.
|
|
||||||
$prices[] = 3000000; // 2.
|
|
||||||
$prices[] = 2000000; // 3. + 4.
|
|
||||||
|
|
||||||
$cprices[] = ceil($summe/2);
|
|
||||||
$cprices[] = ceil($summe/4);
|
|
||||||
$cprices[] = ceil($summe/8);
|
|
||||||
|
|
||||||
distributeUserPrices($prices, $results, $turnier_name);
|
|
||||||
|
|
||||||
#distributeShopPoints($prices, $results, $turnier_name);
|
|
||||||
// clan prices are not distributed anymore!!
|
|
||||||
//distributeClanPrices($cprices, $results, $turnier_name);
|
|
||||||
|
|
||||||
?>
|
|
@ -1,68 +0,0 @@
|
|||||||
<?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){
|
|
||||||
echo 'insertIntoHallOfFame('.$title.', '.$charid.', '.$userid.')<br>';
|
|
||||||
$row = mysqli_fetch_assoc(db_query('Select max(id) as round from online'));
|
|
||||||
$char = getChar($charid);
|
|
||||||
$user = mysqli_fetch_assoc(db_query('Select * from user where id = '.$userid));
|
|
||||||
|
|
||||||
if(!$row){
|
|
||||||
echo 'insertIntoHallOfFame failed as the basic methods failed!<br>';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return insertIntoHallOfFameFull($row['round'], $title, $charid, $char['name'], $userid, $user['nickname'], 'CURRENT_DATE');
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertIntoHallOfFameFull($round = '', $title = '', $charid = '', $charname = '', $userid = '', $username = '', $date = ''){
|
|
||||||
echo 'insertIntoHallOfFame('.$title.', '.$charid.', '.$charname.', '.$username.', '.$userid.', '.$date.')<br>';
|
|
||||||
// These Entries may not be ''
|
|
||||||
if(!is_numeric($round) || $date == '' || $title == ''){
|
|
||||||
echo 'insertIntoHallOfFame failed as the extended methods failed!<br>';
|
|
||||||
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 = db_query($sql);
|
|
||||||
return db_affected_rows() > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getHallOfFame($title, $userid) {
|
|
||||||
$row = mysqli_fetch_assoc(db_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 = mysqli_fetch_row($sql);
|
|
||||||
return $row[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
@ -1,44 +0,0 @@
|
|||||||
<?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('path.inc.php'); // get the path ;)
|
|
||||||
include_once (ROOT_PATH.'/include/sqlwrapper.inc.php');
|
|
||||||
include_once ('inclu/halloffame.inc.php');
|
|
||||||
include_once ('inclu/turnier.inc.php');
|
|
||||||
include_once ('inclu/char.inc.php');
|
|
||||||
|
|
||||||
$name = 'klein';
|
|
||||||
|
|
||||||
// do the stuff for the whole exp and money distribution there ;)
|
|
||||||
$results = generateTournamentResults($name, 10000, 0);
|
|
||||||
|
|
||||||
$rang1 = getChar($results[0][0]);
|
|
||||||
|
|
||||||
// Hall of fame!
|
|
||||||
|
|
||||||
// insertIntoHallOfFame($title, $charid, $userid);
|
|
||||||
insertIntoHallOfFame('Anfängerturnier', $rang1['id'], $rang1['besitzer']);
|
|
||||||
|
|
||||||
|
|
||||||
/* FIXME: Before we can do this we have to resolve the include chaos!!
|
|
||||||
if(getHallOfFameEntryCount('Anfängerturnier', $rang1['id']) >= 2) {
|
|
||||||
// remove all chars that are registered
|
|
||||||
db_query('DELETE FROM turnier1 WHERE art = \'klein\' AND besitzer = '.$rang1['besitzer']);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
// Now distribute the shop points ;)
|
|
||||||
|
|
||||||
$prices[] = 25; // 1. (max win)
|
|
||||||
$prices[] = 20; // 2. (max win - 1)
|
|
||||||
$prices[] = 15; // 3. + 4. (max win -2)
|
|
||||||
|
|
||||||
distributeShopPoints($prices, $results, 'Anfängerturnier');
|
|
||||||
|
|
||||||
?>
|
|
@ -1,52 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* @copyright (c) 2010 animegame.eu
|
|
||||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
include "db.php";
|
|
||||||
|
|
||||||
$row2 = db_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 = mysqli_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];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
db_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");
|
|
||||||
db_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");
|
|
||||||
/*
|
|
||||||
db_query("UPDATE user SET geld='$new_geld1' WHERE id='$row[i1id]' LIMIT 1");
|
|
||||||
db_query("UPDATE user SET geld='$new_geld2' WHERE id='$row[i2id]' LIMIT 1");
|
|
||||||
*/
|
|
||||||
?>
|
|
@ -1,111 +0,0 @@
|
|||||||
<?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_random_wrapper(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 = mysqli_num_rows(db_query("SELECT id FROM n_turnier_reg LIMIT 16"));
|
|
||||||
|
|
||||||
if($max_charakter<16) {
|
|
||||||
echo "Turnier kann nicht beginn.";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
db_query("DELETE FROM turnier_kampf WHERE art='$art_1'");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$char1 = db_query("SELECT charakter FROM n_turnier_reg ORDER BY id ASC LIMIT 16");
|
|
||||||
while($row=mysqli_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=db_query("SELECT * FROM chars WHERE id IN(".$list.") LIMIT 16");
|
|
||||||
|
|
||||||
while($row=mysqli_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 = db_query("SELECT win FROM turnier_kampf WHERE round='$round' AND art='$art_1'");
|
|
||||||
while($row9 = mysqli_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
db_query("DELETE FROM n_turnier_reg ORDER BY id ASC LIMIT 16");
|
|
||||||
|
|
||||||
?>
|
|
@ -1,42 +0,0 @@
|
|||||||
<?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('path.inc.php'); // get the path ;)
|
|
||||||
include_once (ROOT_PATH.'/include/sqlwrapper.inc.php');
|
|
||||||
include_once ('inclu/halloffame.inc.php');
|
|
||||||
include_once ('inclu/fruitdistribution.inc.php');
|
|
||||||
include_once ('inclu/exp.inc.php');
|
|
||||||
|
|
||||||
include_once ('inclu/turnier.inc.php');
|
|
||||||
include_once ('inclu/char.inc.php');
|
|
||||||
include_once(ROOT_PATH. "/include/random.inc.php");
|
|
||||||
|
|
||||||
$turnier_kurz = 'wochenst';
|
|
||||||
$turnier_name = 'Wochenturnier Non-Fusion';
|
|
||||||
|
|
||||||
// do the stuff for the whole exp and money distribution there ;)
|
|
||||||
$results = generateTournamentResults($turnier_kurz, 15000, 0);
|
|
||||||
$rang1 = getChar($results[0][0]);
|
|
||||||
|
|
||||||
insertIntoHallOfFame($turnier_name , $rang1['id'], $rang1['besitzer']);
|
|
||||||
|
|
||||||
$xiu=5;
|
|
||||||
|
|
||||||
if($xiu >= mt_random_wrapper(1, 100)) {
|
|
||||||
////////////////FRUCHT ARRAY
|
|
||||||
//include "array.php";
|
|
||||||
distributeParamecia($rang1['besitzer']);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$prices[] = 50; // 1.
|
|
||||||
$prices[] = 40; // 2.
|
|
||||||
$prices[] = 30; // 3. + 4.
|
|
||||||
$prices[] = 20; // 5. - 8.
|
|
||||||
|
|
||||||
distributeShopPoints($prices, $results, $turnier_name);
|
|
Loading…
Reference in new issue