Nun ist es möglich NPC zuzulassen.

main
hecht 10 years ago
parent df5675858e
commit c9b42f6af0

@ -61,6 +61,8 @@ $gain = $_GET['gain']; // ('Anmeldung', 'PL', 'Level')
$randomize = $_GET['randomize']; // 1 für nach jeder Runde die reihenfolge setzen
$itemless = $_GET['itemless']; // gibt an ob das turnier die items ingorieren soll (standard sind items aktiv)
$npc = $_GET['npc'];
// Turniereigenschaften
$gruppenphase = $_GET['gruppenphase']; // Flag für Gruppenphase (1 für aktiv)
$grp_size = $_GET['grp_size']; // Anzahl der Teilnehmer in einer Gruppe
@ -127,22 +129,39 @@ mysql_query('DELETE FROM turnier_kampf WHERE art=\''.$name.'\'');
$race_type = getRaceTypeName("NPC");
// Es sollen keine NPC mitmachen :) und nicht die Spezial Wanted NPCs
$auswahl_kriteria = ' type!=\''.$race_type.'\'';
$auswahl_kriteria .= ' AND besitzer!=2 ';
$auswahl_kriteria = '1';
if($fusion != 1){
$auswahl_kriteria .= ' AND fusions_rasse = \'0\' ';
$auswahl_kriteria .= ' AND fusion_rasse = \'0\' ';
}
// Es sollen keine NPC mitmachen :) und nicht die Spezial Wanted NPCs
$exclude_race_ids = array();
if($special != 1){
$races = getSpecialRaceIds();
$special_race_ids = array();
$npc_race = getRaceTypeName('NPC'); // do not remove npc (there is a separate setting for this)
foreach($races as $race) {
$special_race_ids[] = '\''.$race['id'].'\'';
if($race['type'] != $npc_race['id']) {
$exclude_race_ids[] = '\''.$race['id'].'\'';
}
}
}
if($special != 1){
$auswahl_kriteria .= ' AND rasse NOT IN('.implode(',',$special_race_ids).') ';
if($npc != 1) {
$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'].'\'';
}
}
if(count($exclude_race_ids)) {
$auswahl_kriteria .= ' AND rasse NOT IN('.implode(',',$exclude_race_ids).') ';
}
if(is_numeric($minlevel)){
$auswahl_kriteria .= ' AND level >= '.$minlevel.' ';

Loading…
Cancel
Save