Ausschliessen der NPC in Liga und Wanted funktionierte nicht mehr.

main
hecht 10 years ago
parent 2c6f2fae5a
commit 20773426ed

@ -14,7 +14,7 @@ include_once ('inclu/turnier.inc.php');
include_once ('inclu/char.inc.php'); include_once ('inclu/char.inc.php');
// do the stuff for the whole exp and money distribution there ;) // do the stuff for the whole exp and money distribution there ;)
$results = generateTournamentResults('wochen', 15000, 20000); $results = generateTournamentResults('wochen', 15000, 0);
$rang1 = getChar($results[0][0]); $rang1 = getChar($results[0][0]);
insertIntoHallOfFame('Wochenturnier', $rang1['id'], $rang1['besitzer']); insertIntoHallOfFame('Wochenturnier', $rang1['id'], $rang1['besitzer']);

@ -13,7 +13,7 @@ include_once ('inclu/char.inc.php');
$name = 'klein'; $name = 'klein';
// do the stuff for the whole exp and money distribution there ;) // do the stuff for the whole exp and money distribution there ;)
$results = generateTournamentResults($name, 10000, 15000); $results = generateTournamentResults($name, 10000, 0);
$rang1 = getChar($results[0][0]); $rang1 = getChar($results[0][0]);
@ -39,4 +39,4 @@ $prices[] = 15; // 3. + 4. (max win -2)
distributeShopPoints($prices, $results, 'Anfängerturnier'); distributeShopPoints($prices, $results, 'Anfängerturnier');
?> ?>

@ -29,13 +29,20 @@ function rand_array($array)
} }
include "db.php"; include "db.php";
$max_charakter = mysql_num_rows(mysql_query("SELECT id FROM chars WHERE rasse!='NPC' LIMIT 250"));
$npc_race = getRaceTypeName('NPC'); // do not remove npc (there is a separate setting for this)
$races = getRacesByType($npc_race); // remove all NPC
foreach($races as $race) {
$exclude_race_ids[] = '\''.$race['id'].'\'';
}
$max_charakter = mysql_num_rows(mysql_query('SELECT id FROM chars WHERE rasse NOT IN ('.implode(',', $exclude_race_ids).') LIMIT 250'));
if($max_charakter<250) { if($max_charakter<250) {
exit; exit;
} }
$charakter = mysql_query("SELECT name, id FROM chars WHERE rasse!='NPC' ORDER BY level DESC LIMIT $max_charakter"); $charakter = mysql_query('SELECT name, id FROM chars WHERE rasse NOT IN '.implode(',', $exclude_race_ids).' ORDER BY level DESC LIMIT '.$max_charakter);
@ -82,4 +89,4 @@ while($a8 < $max_charakter)
?> ?>

@ -30,13 +30,21 @@ function rand_array($array)
} }
include "db.php"; include "db.php";
$max_charakter = mysql_num_rows(mysql_query("SELECT id FROM chars WHERE rasse!='NPC' LIMIT 500"));
$npc_race = getRaceTypeName('NPC'); // do not remove npc (there is a separate setting for this)
$races = getRacesByType($npc_race); // remove all NPC
foreach($races as $race) {
$exclude_race_ids[] = '\''.$race['id'].'\'';
}
$max_charakter = mysql_num_rows(mysql_query('SELECT id FROM chars WHERE rasse NOT IN ('.implode(',', $exclude_race_ids).') LIMIT 500'));
if($max_charakter<500) { if($max_charakter<500) {
exit; exit;
} }
$charakter = mysql_query("SELECT name, id FROM chars WHERE rasse!='NPC' ORDER BY level DESC LIMIT $max_charakter"); $charakter = mysql_query('SELECT name, id FROM chars WHERE rasse NOT IN '.implode(',', $exclude_race_ids).' ORDER BY level DESC LIMIT '.$max_charakter);
while($row=mysql_fetch_array($charakter)) while($row=mysql_fetch_array($charakter))

Loading…
Cancel
Save