battles/test_stats.php

188 lines
6.8 KiB
PHP
Raw Normal View History

2018-01-28 16:40:49 +00:00
<?php
session_start();
include "config.php";
//$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '2106' LIMIT 1;"));
//include "functions.php";
$exptable = array(
// stat umen vinos kred, level, up
"0" => array (0,0,0,0,0,20),//0
"20" => array (1,0,0,0,0,45),
"45" => array (1,0,0,1,0,75),
"75" => array (1,0,0,2,0,110),
"110" => array (3,1,1,4,1,160),//1
"160" => array (1,0,0,0,0,215),
"215" => array (1,0,0,1,0,280),
"280" => array (1,0,0,2,0,350),
"350" => array (1,0,0,4,0,410),
"410" => array (3,1,1,8,1,530),//2
"530" => array (1,0,0,0,0,670),
"670" => array (1,0,0,2,0,830),
"830" => array (1,0,0,4,0,950),
"950" => array (1,0,0,8,0,1100),
"1100" => array (1,0,0,12,0,1300),
"1300" => array (3,1,1,16,1,1450),//3
"1450" => array (1,0,0,1,0,1650),
"1650" => array (1,0,0,5,0,1850),
"1850" => array (1,0,0,10,0,2050),
"2050" => array (1,0,0,15,0,2200),
"2200" => array (1,0,0,20,0,2500),
"2500" => array (5,1,1,25,1,2900),//4
"2900" => array (1,0,0,3,0,3350),
"3350" => array (1,0,0,20,0,3800),
"3800" => array (1,0,0,25,0,4200),
"4200" => array (1,0,0,30,0,4600),
"4600" => array (1,0,0,35,0,5000),
"5000" => array (3,1,1,50,1,6000),//5
"6000" => array (1,0,0,60,0,7000),
"7000" => array (1,0,0,40,0,8000),
"8000" => array (1,0,0,40,0,9000),
"9000" => array (1,0,0,60,0,10000),
"10000" => array (1,0,0,60,0,11000),
"11000" => array (1,0,0,60,0,12000),
"12000" => array (1,0,0,70,0,12500),
"12500" => array (3,1,1,80,1,14000),//6
"14000" => array (1,0,0,90,0,15500),
"15500" => array (1,0,0,45,0,17000),
"17000" => array (1,0,0,65,0,19000),
"19000" => array (1,0,0,65,0,21000),
"21000" => array (1,0,0,65,0,23000),
"23000" => array (1,0,0,75,0,27000),
"27000" => array (1,0,0,65,0,30000),
"30000" => array (5,1,1,100,1,60000),//7
"60000" => array (1,0,0,100,0,75000),
"75000" => array (1,0,0,130,0,150000),
"150000" => array (1,0,0,180,0,175000),
"175000" => array (1,0,0,100,0,200000),
"200000" => array (1,0,0,150,0,225000),
"225000" => array (1,0,0,100,0,250000),
"250000" => array (1,0,0,150,0,260000),
"260000" => array (1,0,0,100,0,280000),
"280000" => array (1,0,0,150,0,300000),
"300000" => array (5,1,1,1000,1,1500000),//8
"1500000" => array (1,0,0,500,0,1750000),
"1750000" => array (1,0,0,200,0,2000000),
"2000000" => array (1,0,0,300,0,2175000),
"2175000" => array (1,0,0,100,0,2300000),
"2300000" => array (1,0,0,100,0,2400000),
"2400000" => array (1,0,0,1,0,2500000),
"2500000" => array (1,0,0,200,0,2600000),
"2600000" => array (1,0,0,100,0,2800000),
"2800000" => array (1,0,0,200,0,3000000),
"3000000" => array (7,1,2,1000,1,6000000),//9
"6000000" => array (1,0,0,1,0,6500000),
"6500000" => array (1,0,0,200,0,7500000),
"7500000" => array (1,0,0,1,0,8500000),
"8500000" => array (1,0,0,250,0,9000000),
"9000000" => array (1,0,0,400,0,9250000),
"9250000" => array (1,0,0,50,0,9500000),
"9500000" => array (1,0,0,400,0,9750000),
"9750000" => array (1,0,0,350,0,9900000),
"9900000" => array (1,0,0,500,0,10000000),
"10000000" => array (9,1,3,2000,1,13000000),//10
"13000000" => array (2,0,0,200,0,14000000),
"14000000" => array (2,0,0,200,0,15000000),
"15000000" => array (2,0,0,200,0,16000000),
"16000000" => array (2,0,0,200,0,17000000),
"17000000" => array (2,0,0,200,0,17500000),
"17500000" => array (2,0,0,200,0,18000000),
"18000000" => array (2,0,0,200,0,19000000),
"19000000" => array (2,0,0,200,0,19500000),
"19500000" => array (2,0,0,200,0,20000000),
"20000000" => array (2,0,0,200,0,30000000),
"30000000" => array (2,0,0,0,0,32000000),
"32000000" => array (2,0,0,0,0,34000000),
"34000000" => array (2,0,0,0,0,35000000),
"35000000" => array (2,0,0,0,0,36000000),
"36000000" => array (2,0,0,0,0,38000000),
"38000000" => array (2,0,0,0,0,40000000),
"40000000" => array (2,0,0,0,0,42000000),
"42000000" => array (2,0,0,0,0,44000000),
"44000000" => array (2,0,0,0,0,45000000),
"45000000" => array (2,0,0,0,0,46000000),
"46000000" => array (2,0,0,0,0,48000000),
"48000000" => array (2,0,0,0,0,50000000),
"50000000" => array (2,0,0,0,0,52000000),
"52000000" => array (10,1,5,1000,1,55000000),
"55000000" => array (1,0,0,0,0,60000000),
"60000000" => array (1,0,0,500,0,65000000),
"65000000" => array (1,0,0,0,0,70000000),
"70000000" => array (1,0,0,500,0,75000000),
"75000000" => array (1,0,0,0,0,80000000),
"80000000" => array (1,0,0,500,0,85000000),
"85000000" => array (1,0,0,0,0,90000000),
"90000000" => array (1,0,0,500,0,95000000),
"95000000" => array (1,0,0,0,0,100000000),
"100000000" => array (1,0,0,0,0,120000000),
"120000000" => array (10,1,5,5000,1,150000000)
);
//$komp_users = mysql_query("SELECT * FROM `users`,`online` WHERE `users`.`id`=`online`.`id` AND `online`.`date` >= ".(time()-60).";");
$komp_users = mysql_query("SELECT * FROM `users`;");
while($ku=mysql_fetch_array($komp_users))
{
$kompl_raw=mysql_query("SELECT * FROM inventory where owner=".$ku['id']." AND dressed=1");
$items_on_user=array();
$set_id_wear=array();
$kompl_har=0;
while ($kompl=mysql_fetch_array($kompl_raw))
{
$items_on_user[]=$kompl['prototype'];
};
$sets_raw=mysql_query("SELECT * FROM item_sets;");
while ($set_items=mysql_fetch_array($sets_raw))
{
$kompl_full=1;
$in_set=explode(',',$set_items['prot_id']);
foreach($in_set as $tmp_set)
if (!in_array($tmp_set,$items_on_user))
{$kompl_full=0;}
if ($kompl_full==1) $set_id_wear[]=$set_items['set_id'];
};
foreach($set_id_wear as $s)
{
$items_raw=mysql_fetch_array(mysql_query("SELECT * FROM item_sets where set_id='{$s}' limit 1;"));
$kompl_har+=$items_raw['gsila'];
$kompl_har+=$items_raw['glovk'];
$kompl_har+=$items_raw['gintel'];
$kompl_har+=$items_raw['ginta'];
};
if(!$kompl_har) $kompl_har=0;
$explim=0;
foreach(array_keys($exptable) as $k)
{
if($k>=$ku['exp'])
{
$explim=$k;
break;
}
}
$sum_stat=15;
foreach(array_keys($exptable) as $k)
{
if($k==$explim)
break;
else
{
$sum_stat+=$exptable[$k][0];
$sum_stat+=$exptable[$k][2];
}
}
$res=mysql_fetch_array(
mysql_query("SELECT IFNULL( (SUM( gsila ) + SUM( glovk ) + SUM( ginta ) + SUM( gintel )) , 0)+ {$kompl_har} + {$sum_stat}
FROM `inventory` WHERE `owner` = '{$ku['id']}' AND `dressed` = 1;"));
$res2=mysql_fetch_array(mysql_query("SELECT `sila`+`lovk`+`intel`+`inta`+`vinos`+`mudra`+`stats` FROM `users` WHERE `id`={$ku['id']};"));
if($res[0]!=$res2[0])
echo("<br/>".$kompl_har." _ ID=".$ku['id']."[".$ku['exp']."] : All=".$res2[0]."/norm=".$res[0]);
}
?>