NPCs wurden in Top50 User gezeigt

main
hecht 11 years ago
parent 98d56a4b63
commit b60a825bd8

@ -10,6 +10,7 @@ include_once(ROOT_PATH.'/include/config.inc.php');
include_once(ROOT_PATH.'/include/parse.inc.php');
include_once(ROOT_PATH.'/include/fehlerausgabe.inc.php');
include_once(ROOT_PATH.'/include/designfunctions.inc.php');
include_once(ROOT_PATH.'/include/rassen.inc.php');
include_once(ROOT_PATH.'/include/char.inc.php');
// GET-Section
@ -41,8 +42,14 @@ function displayHighscore($wahl, $char_name, $user, $char_vorhanden){
if($wahl == 'geld') {
$choice_s = mysql_query('SELECT geld, id FROM user where id >= 2 ORDER BY geld DESC LIMIT 50');
} else {
$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'].'\'';
}
$sql = 'SELECT c.name, c.level, c.besitzer, c.starke, c.preis, c.speed, c.glueck, c.bild, c.verteidigung, c.ausdauer, c.siege, c.niederlagen, c.id as charid, starke+verteidigung+speed+ausdauer+glueck as powerlevel FROM chars c ' .
'WHERE rasse != \'NPC\' ORDER BY ('.$wahl.') DESC LIMIT 50';
'WHERE rasse NOT IN('.implode(',',$exclude_race_ids).') ORDER BY ('.$wahl.') DESC LIMIT 50';
// Uncomment for hp/mp in PL
// $sql = 'SELECT cl.clanzeichen, u.nickname, u.id as userid, c.name, c.level, c.besitzer, c.starke, c.preis, c.speed, c.glueck, c.bild, c.verteidigung, c.ausdauer, c.siege, c.niederlagen, c.id as charid, starke+verteidigung+speed+ausdauer+glueck+substring_index(hp,\',\',-1)/10+substring_index(mp,\',\',-1)/5 as powerlevel' .

Loading…
Cancel
Save