linpc
Гуру форума
- Регистрация
- 6 Апр 2012
- Сообщения
- 178
- Реакции
- 55
- Автор темы
- #1
Думаю всех достал уже, да я такой( Нуб.
Не могу исправить ряд повторяющихся ошибок. И понять что в них не так.
ошибки
Вот сам виновник functions_game.php
Не могу исправить ряд повторяющихся ошибок. И понять что в них не так.
ошибки
Notice: Undefined index: 9 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 214 Notice: Undefined index: 20 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 214 Notice: Undefined index: 27 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 214 Notice: Undefined index: 19 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 214 Notice: Undefined index: 30 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 214 Notice: Undefined offset: 1 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 209 Notice: Undefined index: 5 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 214 Notice: Undefined index: 10 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 214 Notice: Undefined index: 11 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 214 Notice: Undefined index: 12 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 214 Notice: Undefined offset: 1 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 209 Notice: Undefined variable: tw in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 223 Notice: Undefined offset: 62 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 236 Notice: Undefined offset: 66 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 237 Notice: Undefined offset: 0 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined variable: st in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 3 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 6 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 7 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 8 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 13 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 14 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 15 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 16 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 17 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 18 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 21 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 22 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 23 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 24 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 25 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 26 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 28 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 29 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 31 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 32 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 33 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 34 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 35 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 36 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 37 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 38 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 39 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 40 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 41 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 42 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 43 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 44 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 45 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 46 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 47 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 48 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 49 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 50 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 51 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 52 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 53 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 54 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 55 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 56 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 57 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 58 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 59 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 60 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 61 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 62 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 63 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 64 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 65 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 66 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 67 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 68 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 69 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined offset: 70 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 239 Notice: Undefined variable: s in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 415 Warning: Division by zero in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 104 Warning: Division by zero in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 105 Notice: Undefined offset: 33 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 106 Notice: Undefined offset: 8 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 106 Notice: Undefined offset: 18 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 106 Notice: Undefined offset: 27 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 106 Notice: Undefined offset: 34 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 107 Notice: Undefined offset: 11 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 107 Notice: Undefined offset: 29 in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 107 Warning: Division by zero in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 117 Warning: Division by zero in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 118 Warning: Division by zero in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 119 Warning: Division by zero in /var/www/adminlinpcrus/data/www/gamele.ru/includes/functions_game.php on line 120
Вот сам виновник functions_game.php
PHP:
<?
function pvu_logs($uid, $see, $reason) { //--Запись логов действий для Личного Дела
mysql_query("INSERT INTO `pvu_logs` (`uid`, `see`, `time_unix`, `time_norm`,`reason`) VALUES ('".$uid."', '".$see."', '".time()."', '".date("Y-m-d H:i:s", time())."','".$reason."');");
}
function player() { //--Функция определения авторизации персонажа
return mysql_fetch_assoc(mysql_query("SELECT `active_session`.*, `user`.* FROM `user` INNER JOIN `active_session` ON `user`.`id` = `active_session`.`User_ID` WHERE `user`.`pcid` = `active_session`.`session` AND `pcid`='".mysql_real_escape_string($_COOKIE['HonorHash'])."';"));
}
function updateslot($act, $item, $pid, $slot) { //--Одевание вещей
switch ($act) {
case 0:
mysql_query("UPDATE invent SET used='0', curslot='0' WHERE id_item='" . $item . "' and pl_id='" . $pid . "'");
break;
case 1:
mysql_query("UPDATE invent SET used='1', curslot='" . $slot . "' WHERE id_item='" . $item . "' and pl_id='" . $pid . "'");
break;
case 2:
mysql_query("UPDATE invent SET used='0', curslot='0' WHERE curslot='$slot' and pl_id='" . $pid . "'");
mysql_query("UPDATE invent SET used='1', curslot='" . $slot . "' WHERE id_item='" . $item . "' and pl_id='" . $pid . "'");
break;
case 3:
mysql_query("UPDATE `invent` SET `used`='0', `curslot`='0' WHERE pl_id='" . $pid . "'");
break;
}
}
function change_get($go) {
$player = player();
$GoLoc = mysql_fetch_assoc(mysql_query("SELECT `id`,`city`,`loc`,`room`,`inc`,`go_id`,`but`,`folder`,`core2` FROM `loc` WHERE `id`='" . intval($go) . "' and `pos`='" . $player["pos"] . "' LIMIT 1;"));
if ($GoLoc['go_id'] == $player['loc']) {
mysql_query("UPDATE `user` SET `loc`='" . $GoLoc["id"] . "' WHERE `login`='" . $_SESSION['user']['login'] . "' LIMIT 1;");
echo"<script>top.frames['ch_list'].location='ch.php?lo=1'</script>";
}
}
function pl_loc($id) {
$loc = mysql_fetch_assoc(mysql_query("SELECT `id`,`inc`,`core2` FROM `loc` WHERE `id`='" . $id . "' LIMIT 1;"));
return $loc['core2'] ? 'core2.php' : $loc['inc'];
}
function ret_id($id, $pos) {
$player = player();
if ($id != 28) {
$loc = mysql_fetch_assoc(mysql_query("SELECT `id`,`city`,`loc`,`room`,`inc`,`go_id`,`but`,`folder`,`core2` FROM `loc` WHERE `id`='" . intval($id) . "' LIMIT 1;"));
}
if ($loc['go_id'] == $loc['id']) {
$s = 1;
}
$s = 0;
$locte = array($loc['go_id'], $loc['but'], $loc['loc'], $loc['folder'], $s);
echo"<script>top.frames['ch_list'].location='ch.php?lo=1'</script>";
return $locte;
}
function getIP() {
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
return $ip;
}
function save_hp() {
$pl = player();
$hps = $pl['hp_all'] / $pl['hps'];
$mps = $pl['mp_all'] / $pl['mps'];
if (time() >= $pl['chp']) {
$curhp = $pl['hp_all'];
} else {
$curhp = $pl['hp_all'] - (($pl['chp'] - time()) * $hps);
}
if (time() >= $pl['cmp']) {
$curmp = $pl['mp_all'];
} else {
$curmp = $pl['mp_all'] - (($pl['cmp'] - time()) * $mps);
}
if ($pl['hp_all'] != $pl['hp'] or $pl['mp_all'] != $pl['mp']) {
mysql_query("UPDATE `user` SET `hp`='" . $curhp . "',`mp`='" . $curmp . "' WHERE `login`='" . $_SESSION['user']['login'] . "' LIMIT 1;");
}
$str = "\n<SCRIPT language=\"JavaScript\">\nins_HP(" . $curhp . "," . $pl['hp_all'] . "," . $curmp . "," . $pl['mp_all'] . "," . $pl['hps'] . "," . $pl['mps'] . ");\n</SCRIPT>\n";
return $str;
}
function calchp() {
$pl = player();
$s = explode("|", $pl['st']);
foreach (explode("|", $pl['perk']) as $key => $val) {
if ($val == '') {
$val = 0;
}
$p[$key] = $val;
}
$trw = affect($pl['affect'], 3);
if (!empty($trw)) {
foreach ($trw as $key => $val) {
$s[$key]+=$val;
}
}
$hps = $pl['hp_all'] / $pl['hps'];
$mps = $pl['mp_all'] / $pl['mps'];
$hp = (($pl['zdorov'] + $s[33] + ($p[8] * 2) + (($pl['level'] + 1) * $p[18])) * 5) + $s[27];
$mp = (($pl['znan'] + $s[34] + ($p[11] * 2)) * 7) + $s[29];
if ($hp != $pl['hp_all'] or $mp != $pl['mp_all']) {
mysql_query("UPDATE `user` SET `hp_all`='" . $hp . "',`mp_all`='" . $mp . "' WHERE `login`='" . $pl['login'] . "' LIMIT 1;");
}
inshp();
}
function inshp() {
$pl = player();
$hps = $pl['hp_all'] / $pl['hps'];
$mps = $pl['mp_all'] / $pl['mps'];
$chp = time() + (($pl['hp_all'] - $pl['hp']) / $hps);
$cmp = time() + (($pl['mp_all'] - $pl['mp']) / $mps);
mysql_query("UPDATE `user` SET `chp`='" . $chp . "',`cmp`='" . $cmp . "' WHERE `login`='" . $pl['login'] . "' LIMIT 1;");
}
function calc_um($id, $value) { //-- Функция рассчета умений
$sk_arr = array("10:8:6:4", "8:6:4:2", "8:6:4:2", "8:6:4:2", "8:6:4:2", "8:6:4:2", "8:6:4:2", "8:6:4:2", "6:4:4:2", "10:8:6:4", "4:4:2:2", "2:2:2:2", "8:6:4:2", "8:6:4:2", "8:6:4:2", "8:6:4:2", "6:4:2:2", "6:4:2:2", "6:4:2:2", "6:4:2:2", "6:4:2:2", "2:2:2:2", "6:4:3:2", "6:4:3:2", "6:4:3:2", "10:8:6:4", "8:6:4:2", "8:6:4:2", "2:2:2:2", "2:2:2:2", "6:4:3:2", "2:2:2:2", "6:4:2:2", "6:4:3:2", "6:4:3:2", "6:4:3:2", "6:4:3:2");
$val = explode(":", $sk_arr[$id]);
$skill = 0;
$a = 0;
$b = 0;
$c = 0;
$d = 0;
if ($skill == 0) {
while (($val[0] * $a) < 25) {
$a++;
if ($value == $val[0] * $a) {
$skill = $a;
}
}
$val[0]*=$a;
}
if ($skill == 0) {
while (($val[0] + $val[1] * $b) < 50) {
$b++;
if ($value == ($val[0] + $val[1] * $b)) {
$skill = $a + $b;
}
}
$val[1]*=$b;
}
if ($skill == 0) {
while (($val[0] + $val[1] + $val[2] * $c) <= 75) {
$c++;
if ($value == ($val[0] + $val[1] + $val[2] * $c)) {
$skill = $a + $b + $c;
}
}
$val[2]*=$c;
}
if ($skill == 0) {
while (($val[0] + $val[1] + $val[2] + $val[3] * $d) < 100) {
$d++;
$x = $val[0] + $val[1] + $val[2] + $val[3] * $d;
if ($x > 100) {
$x = 100;
}
if ($value == $x) {
$skill = $a + $b + $c + $d;
}
}
$val[3]*=$d;
}
return $skill;
}
function calcstat($id){ //--Подсчет статов
$pl=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id`='".$id."'"));
$um=explode("|",$pl['umen']);
$t=array(0=> 0,2,4);
$od=45;
$bl=0;
$Stat=mysql_query("SELECT `invent`.*, `items`.* FROM `items` INNER JOIN `invent` ON `items`.id = `invent`.protype WHERE `used`='1' AND `pl_id`='".$id."'");
while ($row = mysql_fetch_array($Stat)) {
$item = explode("|",$row['i_param']);
if($row['type']=="w20"){
$bl=$row['block'];
}
if($row['slot']==3 and $row['type']!="w20"){
$it = explode("|",$row['i_need']);
foreach ($it as $val) {
$i_need=explode("@",$val);
if($i_need[0]==28 and $i_need[1]>$od){
$od=$i_need[1];
$tw=$row['type'];
}
}
}
foreach ($item as $value) {
$stat=explode("@",$value);
if(in_array ($stat[0], $t)){
$par[$stat[0]]='';
continue;
}
if($stat[0]==1){
$tmp=explode("-",$stat[1]);
$tmp[0]=round($tmp[0]);
$tmp[1]=round($tmp[1]);
$tmp1=explode("-",$par[1]);
$tmp[0]+=$tmp1[0];
$tmp[1]+=$tmp1[1];
continue;
}
$tmp=explode("-",$stat[1]);
$par[1]=implode("-",$tmp);
$par[$stat[0]]+=$stat[1];
}
}
$sil = $par[30]+$pl['sila'];
$dmg=explode("-",$par[1]);
$par[1]=implode("-",$dmg);
print_r ($row['type']);
switch($tw){
case'':$od=round($od/(($um[0]/100)*0.30+2));$par[1]=round((1+$um[0]/300))."-".round((1+$um[0]/150)+1); break;
case'w1': $od=round($od/(($um[1]/100)*0.30+2));break;
case'w2': $od=round($od/(($um[2]/100)*0.30+2));break;
case'w3': $od=round($od/(($um[3]/100)*0.30+2));break;
case'w4': $od=round($od/(($um[4]/100)*0.30+2));break;
case'w5': $od=round($od/(($um[5]/100)*0.30+21));break;
case'w6': $od=round($od/(($um[6]/100)*0.30+2));break;
case'w7': $od=round($od/(($um[7]/100)*0.30+2));break;
default:
$od=round($od/(($um[7]/100)*0.30+2));
break;
}
$hps=(750/(($par[62]+$um[30])/100+1));
$mps=(4500/(($par[66]+$um[33])/100+1));
for($i=0;$i<=70;$i++){
$st.="$par[$i]|";
}
mysql_query("UPDATE `user` SET `bl`='".$bl."',`od`='".$od."',`st`='".$st."',`hps`='".$hps."',`mps`='".$mps."' WHERE `id`='".$id."' LIMIT 1;");
}
function allparam($pl){
$pt = explode("|",$pl['st']);
$um = explode("|",$pl['umen']);
$mass=mysql_fetch_assoc(mysql_query("SELECT Sum(`items`.`massa`) AS `mass` ,`invent`.`pl_id` FROM `items` INNER JOIN `invent` ON `items`.`id` = `invent`.`protype` WHERE `pl_id`='".$pl['id']."'"));
if($mass['mass'] == '')$mass['mass']=0;
$trw=effects($pl['affect'],3);
if(!empty($trw)){
foreach ($trw as $key => $val){
$pt[$key]+=$val;
}
}
foreach (explode("|",$pl['perk']) as $key => $val){
if($val==''){
$val=0;
}
$perk[$key]=$val;
}
$pt[5]+=$perk[19]*30;
$pt[6]+=$perk[0]*30;
$pt[7]+=$perk[5]*30;
$pt[8]+=$perk[15]*30;
$pt[9]+=$perk[32]*30;
$pt[30]+=$pl['sila']+($perk[7]*2);
$pt[31]+=$pl['lovk']+($perk[9]*2);
$pt[32]+=$pl['uda4a']+($perk[10]*2);
$pt[33]+=$pl['zdorov']+($perk[8]*2);
$pt[34]+=$pl['znan']+($perk[11]*2);
$pt[35]+=$pl['mudr'];
for($i=30;$i<=35;$i++){
if($pt[$i]<0)$pt[$i]=1;
}
if($pl['level']<5){
$od=80;
}else if($pl['level']<10){
$od=90;
}else{
$od=100;
}
$pt[28]=$od+$um[11]+$pt[28];
$pt[36]+=$um[1];
$pt[37]+=$um[2];
$pt[38]+=$um[3];
$pt[39]+=$um[4];
$pt[40]+=$um[5];
$pt[41]+=$um[6];
$pt[42]+=$um[7];
$pt[43]+=$um[8];
$pt[44]+=$um[9];
$pt[45]+=$um[12]+($perk[27]*25);
$pt[46]+=$um[13]+($perk[24]*25);//магия огня и воды
$pt[49]+=$um[16]+($perk[28]*25);
$pt[50]+=$um[17]+($perk[29]*25);//сопротивление магии огня и воды
$pt[53]+=$um[21];
$pt[54]+=$um[22];
$pt[55]+=$um[23];
$pt[56]+=$um[24];
$pt[57]+=$um[25];
$pt[58]+=$um[26];
//$pt[59]+=$pl['fish_skill'];
$pt[61]+=$um[29];
$pt[62]+=$um[30];
$pt[63]+=$um[31];
$pt[64]+=$um[32];
$pt[66]+=$um[33];
//$pt[68]+=$pl['alhim'];
//$pt[70]+=$pl['trav'];
//$pt[60]+=$pl['les'];
//$pt[72]=$pl['level'];
$pt[73]=$pt[71];
$pt[71]=$mass['mass'];
$pt[99]=$um[20];
$pt[101]=0;
$pt[102]=0;
$pt[103]=0;
$pt[104]=0;
return $pt;
}
function slotwiev($id,$s)
{
$sl_free = array(1 => 'sl_l_0.gif:Слот для шлема', 'sl_l_1.gif:Слот для ожерелья', 'sl_l_2.gif:Слот для оружия', 'sl_l_3.gif:Слот для пояса', 'sl_l_4.gif:Слот для содержимого пояса', 'sl_l_4.gif:Слот для содержимого пояса', 'sl_l_4.gif:Слот для содержимого пояса', 'sl_l_5.gif:Слот для сапог', 'sl_r_0.gif:Слот для кармана', 'sl_r_1.gif:Слот для содержимого кармана', 'sl_r_2.gif:Слот для наручей', 'sl_r_3.gif:Слот для перчаток', 'sl_l_2.gif:Слот для оружия/щита', 'sl_r_5.gif:Слот для кольца', 'sl_r_5.gif:Слот для кольца', 'sl_r_6.gif:Слот для брони', 'sl_r_6.gif:Слот для брони');
$invet = mysql_query("SELECT `invent`.*, `items`.* FROM `items` INNER JOIN `invent` ON `items`.id = `invent`.protype WHERE `used`='1' AND `pl_id`='".$id."'");
while ($row = mysql_fetch_array($invet)) {
$it = explode("|",$row['i_param']);
if($row['slot']==5){$ret.="$row[id_item]@$row[num_a]|";}
$par='';
foreach ($it as $value) {
$stat=explode("@",$value);
switch($stat[0]){
case 0: $par[0]="$stat[1]"; break;
case 1:
$ud=explode("-",$stat[1]);
$par[1]="$ud[0]";
$par[2]="$ud[1]";
break;
case 2: $par[7]=$row['dolg'];break;
case 9: $par[3]="$stat[1]";break;
case 10: $par[4]="$stat[1]";break;
case 27: $par[5]="$stat[1]";break;
case 29: $par[6]="$stat[1]";break;}
}
$p.="$par[0]|$par[1]|$par[2]|$par[3]|$par[4]|$par[5]|$par[6]|$par[7]";
$img=$row['img'];
$itname=$row['ItemName'];
$sl_free[$row['curslot']]="$img:$itname:$p";
$sl_id[$row['curslot']]=$row['id_item'];
$sl_pr[$row['curslot']]=$row['dolg']-$row['iznos'];
$v_c[$row['curslot']]=scode();
}
for($i=1; $i<=15; $i++){
$idd.=$sl_id[$i].'@';
$pr .= $sl_pr[$i].'@';
$item .= $sl_free[$i].'@';
$vcod.=$v_c[$i].'@';}
if($sl_free[16]!='sl_r_6.gif:Слот для брони'){$pr .= $sl_pr[16]; $item .= $sl_free[16]; $idd .= $sl_id[16];$vcod.=scode();}elseif($sl_free[17]!='sl_r_6.gif:Слот для брони'){$pr .= $sl_pr[17]; $item .= $sl_free[17]; $idd .= $sl_id[17];$vcod.=scode();}else{$item .= $sl_free[17];}
if($s==1){$invs=",\"$idd\",\"$vcod\"";}
echo "$item\"$invs,\"$pr";
return substr_replace($ret, '', -1);
}
function affect($UserID,$var){
/* DataBase */
$effects = array('','Боевая травма','Тяжелая травма','Средняя травма','Легкая травма','Излечение','','','Темное проклятие','Благословение ангела','Магическое зеркало','Берсеркер','Милосердие Создателя','Алкогольное опьянение','Свиток Покровительства','Блок','Тюрьма','Молчанка','Форумная молчанка','Свиток Неизбежности','Зелье Колкости','Зелье Загрубелой Кожи','Зелье Просветления','Зелье Гения','Яд','Зелье Иммунитета','Зелье Силы','Зелье Защиты От Ожогов','Зелье Арктических Вьюг','Зелье Жизни','Зелье Сокрушительных Ударов','Зелье Стойкости','Зелье Недосягаемости','Зелье Точного Попадания','Зелье Ловкости','Зелье Удачи','Зелье Огненного Ореола','Зелье Метаболизма','Зелье Медитации','Зелье Громоотвода','Зелье Сильной Спины','Зелье Скорбь Лешего','Зелье Боевой Славы','Зелье Ловких Ударов','Зелье Спокойствия','Зелье Мужества','Зелье Человек-Гора','Зелье Секрет Волшебника','Зелье Инквизитора','Зелье Панциря','','Секретное Зелье','Зелье Скорости','Зелье Соколиный Взор','Зелье Подвижности','Фронтовые 100 грамм','','','','','','','','','','','','','','','Зелье Кровожадности','Зелье Быстроты','Свиток Величия','Свиток Каменной кожи','Слеза Создателя','Гнев Локара','Дар Иланы','Новогодний бонус','Эликсир из Подснежника','Молодильное яблочко','Благословение Иланы','День всех влюбленных','Галантный кавалер');
/* Effects Show */
$Query = mysql_query("SELECT * FROM `effects` WHERE `userid`='".$UserID."' AND `time`>'".time()."' ORDER BY `time` DESC");
while($row = mysql_fetch_assoc($Query)){
/* Вычесляем время */
if($row['time']>time()){
$row['time']-=time();
$ch=floor($row['time']/3600);
$min=floor(($row['time']-($ch*3600))/60);
$sec=floor(($row['time']-($ch*3600))%60);
if($var==0){
$row['time']=$ch."ч ".$min."мин ";
}elseif($var==1){
$row['time']=(($ch<10)?'0'.$ch:$ch).":".(($min<10)?'0'.$min:$min).":".(($sec<10)?'0'.$sec:$sec);
}
}
/* Считаем статы */
$params=explode(";",$row['f_params']);
foreach ($params as $f_params){
$sts=explode("/",$f_params);
$stat[$sts[0]]+=$sts[1];
}
/* Колество травм на вывод, допустим (x2) */
$Effect[$row['eff_id']] += 1;
/* Подсчет и написание текстов */
if($var==1 and $effects[$row['eff_id']] != '' and $Effect[$row['eff_id']] == 1){
$CountEff = mysql_num_rows(mysql_query("SELECT * FROM `effects` WHERE `userid`='".$UserID."' AND `time`>'".time()."' AND `eff_id`='".$row['eff_id']."' ORDER BY `time` DESC"));
$s.="[".$row['eff_id'].",'<b>".$effects[$row['eff_id']]."</b> (x".$CountEff.") (еще ".$row['time'].")'],";
}
if($var==0 and !empty($effects[$row['eff_id']])){
$s.= $effects[$row['eff_id']]." еще ".$row['time'].",";
}
if($var==2 and !empty($effects[$row['eff_id']])){
$s.= $effects[$row['eff_id']]."<br>еще ".$row['time']."<br>";
}
}
if($var == 0){
return substr($s,0,strlen($s)-1);
}elseif($var == 3){
return $stat;
}else{
return $s;
}
}
function effects($UserID,$var){
/* DataBase */
$effects = array('','Боевая травма','Тяжелая травма','Средняя травма','Легкая травма','Излечение','','','Темное проклятие','Благословение ангела','Магическое зеркало','Берсеркер','Милосердие Создателя','Алкогольное опьянение','Свиток Покровительства','Блок','Тюрьма','Молчанка','Форумная молчанка','Свиток Неизбежности','Зелье Колкости','Зелье Загрубелой Кожи','Зелье Просветления','Зелье Гения','Яд','Зелье Иммунитета','Зелье Силы','Зелье Защиты От Ожогов','Зелье Арктических Вьюг','Зелье Жизни','Зелье Сокрушительных Ударов','Зелье Стойкости','Зелье Недосягаемости','Зелье Точного Попадания','Зелье Ловкости','Зелье Удачи','Зелье Огненного Ореола','Зелье Метаболизма','Зелье Медитации','Зелье Громоотвода','Зелье Сильной Спины','Зелье Скорбь Лешего','Зелье Боевой Славы','Зелье Ловких Ударов','Зелье Спокойствия','Зелье Мужества','Зелье Человек-Гора','Зелье Секрет Волшебника','Зелье Инквизитора','Зелье Панциря','','Секретное Зелье','Зелье Скорости','Зелье Соколиный Взор','Зелье Подвижности','Фронтовые 100 грамм','','','','','','','','','','','','','','','Зелье Кровожадности','Зелье Быстроты','Свиток Величия','Свиток Каменной кожи','Слеза Создателя','Гнев Локара','Дар Иланы','Новогодний бонус','Эликсир из Подснежника','Молодильное яблочко','Благословение Иланы','День всех влюбленных','Галантный кавалер');
/* Effects Show */
$Query = mysql_query("SELECT * FROM `effects` WHERE `userid`='".$UserID."' AND `time`>'".time()."' ORDER BY `time` DESC");
while($row = mysql_fetch_assoc($Query)){
/* Вычесляем время */
if($row['time']>time()){
$row['time']-=time();
$ch=floor($row['time']/3600);
$min=floor(($row['time']-($ch*3600))/60);
$sec=floor(($row['time']-($ch*3600))%60);
if($var==0){
$row['time']=$ch."ч ".$min."мин ";
}elseif($var==1){
$row['time']=(($ch<10)?'0'.$ch:$ch).":".(($min<10)?'0'.$min:$min).":".(($sec<10)?'0'.$sec:$sec);
}
}
/* Считаем статы */
$params=explode(";",$row['f_params']);
foreach ($params as $f_params){
$sts=explode("/",$f_params);
$stat[$sts[0]]+=$sts[1];
}
/* Колество травм на вывод, допустим (x2) */
$Effect[$row['eff_id']] += 1;
/* Подсчет и написание текстов */
if($var==1 and $effects[$row['eff_id']] != '' and $Effect[$row['eff_id']] == 1){
$CountEff = mysql_num_rows(mysql_query("SELECT * FROM `effects` WHERE `userid`='".$UserID."' AND `time`>'".time()."' AND `eff_id`='".$row['eff_id']."' ORDER BY `time` DESC"));
$s.="[".$row['eff_id'].",'<b>".$effects[$row['eff_id']]."</b> (x".$CountEff.") (еще ".$row['time'].")'],";
}
if($var==0 and !empty($effects[$row['eff_id']]) and $Effect[$row['eff_id']] == 1 and $row['eff_id']<5){
$CountEff = mysql_num_rows(mysql_query("SELECT * FROM `effects` WHERE `userid`='".$UserID."' AND `time`>'".time()."' AND `eff_id`='".$row['eff_id']."' ORDER BY `time` DESC"));
$s.= $effects[$row['eff_id']]." (x".$CountEff.") еще ".$row['time'].",";
}
if($var==2 and !empty($effects[$row['eff_id']])){
$s.= $effects[$row['eff_id']]."<br>еще ".$row['time']."<br>";
}
}
if($var == 0){
return substr($s,0,strlen($s)-1);
}elseif($var == 3){
return $stat;
}else{
return $s;
}
}
function exp_level($level){
switch($level){
case 0: $arr=array("exp"=>100,"ma"=>8,"ex"=>1,"frs"=>15,"nv"=>50,"nav"=>1,"mum"=>2,"bum"=>10);break;
case 1: $arr=array("exp"=>300,"ma"=>12,"ex"=>1,"frs"=>3,"nv"=>100,"nav"=>1,"mum"=>3,"bum"=>4);break;
case 2: $arr=array("exp"=>800,"ma"=>16,"ex"=>1,"frs"=>3,"nv"=>150,"nav"=>0,"mum"=>4,"bum"=>5);break;
case 3: $arr=array("exp"=>1800,"ma"=>20,"ex"=>1,"frs"=>3,"nv"=>200,"nav"=>0,"mum"=>4,"bum"=>5);break;
case 4: $arr=array("exp"=>3500,"ma"=>24,"ex"=>1,"frs"=>5,"nv"=>300,"nav"=>1,"mum"=>5,"bum"=>4);break;
case 5: $arr=array("exp"=>5500,"ma"=>40,"ex"=>1,"frs"=>5,"nv"=>350,"nav"=>1,"mum"=>5,"bum"=>5);break;
case 6: $arr=array("exp"=>10000,"ma"=>52,"ex"=>1,"frs"=>5,"nv"=>250,"nav"=>0,"mum"=>6,"bum"=>6);break;
case 7: $arr=array("exp"=>18000,"ma"=>56,"ex"=>1,"frs"=>10,"nv"=>300,"nav"=>0,"mum"=>7,"bum"=>6);break;
case 8: $arr=array("exp"=>30000,"ma"=>64,"ex"=>1,"frs"=>5,"nv"=>400,"nav"=>1,"mum"=>8,"bum"=>7);break;
case 9: $arr=array("exp"=>50000,"ma"=>76,"ex"=>1,"frs"=>7,"nv"=>500,"nav"=>0,"mum"=>9,"bum"=>8);break;
case 10: $arr=array("exp"=>200000,"ma"=>80,"ex"=>1,"frs"=>15,"nv"=>400,"nav"=>1,"mum"=>12,"bum"=>10);break;
case 11: $arr=array("exp"=>500000,"ma"=>104,"ex"=>1,"frs"=>7,"nv"=>500,"nav"=>0,"mum"=>15,"bum"=>5);break;
case 12: $arr=array("exp"=>900000,"ma"=>120,"ex"=>1,"frs"=>12,"nv"=>600,"nav"=>1,"mum"=>15,"bum"=>10);break;
case 13: $arr=array("exp"=>1600000,"ma"=>136,"ex"=>1,"frs"=>10,"nv"=>600,"nav"=>1,"mum"=>20,"bum"=>15);break;
case 14: $arr=array("exp"=>3000000,"ma"=>150,"ex"=>1,"frs"=>12,"nv"=>800,"nav"=>0,"mum"=>12,"bum"=>15);break;
case 15: $arr=array("exp"=>10000000,"ma"=>170,"ex"=>1,"frs"=>15,"nv"=>1000,"nav"=>1,"mum"=>15,"bum"=>15);break;
case 16: $arr=array("exp"=>25000000,"ma"=>180,"ex"=>1,"frs"=>15,"nv"=>1500,"nav"=>1,"mum"=>25,"bum"=>20);break;
case 17: $arr=array("exp"=>50000000,"ma"=>190,"ex"=>1,"frs"=>15,"nv"=>2000,"nav"=>0,"mum"=>25,"bum"=>20);break;
case 18: $arr=array("exp"=>80000000,"ma"=>200,"ex"=>1,"frs"=>15,"nv"=>2500,"nav"=>1,"mum"=>25,"bum"=>20);break;
case 19: $arr=array("exp"=>160000000,"ma"=>220,"ex"=>1,"frs"=>15,"nv"=>3000,"nav"=>1,"mum"=>15,"bum"=>20);break;
case 20: $arr=array("exp"=>500000000,"ma"=>240,"ex"=>1,"frs"=>10,"nv"=>3500,"nav"=>0,"mum"=>25,"bum"=>10);break;
case 21: $arr=array("exp"=>1200000000,"ma"=>240,"ex"=>1,"frs"=>15,"nv"=>4000,"nav"=>0,"mum"=>25,"bum"=>10);break;
case 22: $arr=array("exp"=>1000000000,"ma"=>240,"ex"=>1,"frs"=>20,"nv"=>4500,"nav"=>0,"mum"=>25,"bum"=>10);break;
case 23: $arr=array("exp"=>2000000000,"ma"=>240,"ex"=>1,"frs"=>25,"nv"=>5500,"nav"=>0,"mum"=>25,"bum"=>10);break;
case 24: $arr=array("exp"=>4000000000,"ma"=>240,"ex"=>1,"frs"=>20,"nv"=>6500,"nav"=>0,"mum"=>25,"bum"=>10);break;
case 25: $arr=array("exp"=>5000000000,"ma"=>240,"ex"=>1,"frs"=>30,"nv"=>7500,"nav"=>0,"mum"=>25,"bum"=>10);break;
case 26: $arr=array("exp"=>6000000000,"ma"=>240,"ex"=>1,"frs"=>35,"nv"=>8500,"nav"=>0,"mum"=>25,"bum"=>10);break;
case 27: $arr=array("exp"=>7000000000,"ma"=>240,"ex"=>1,"frs"=>40,"nv"=>10500,"nav"=>0,"mum"=>25,"bum"=>10);break;
case 28: $arr=array("exp"=>8000000000,"ma"=>240,"ex"=>1,"frs"=>45,"nv"=>12500,"nav"=>0,"mum"=>25,"bum"=>10);break;
case 29: $arr=array("exp"=>9000000000,"ma"=>240,"ex"=>1,"frs"=>50,"nv"=>15500,"nav"=>0,"mum"=>25,"bum"=>10);break;
case 30: $arr=array("exp"=>1200000000,"ma"=>240,"ex"=>1,"frs"=>55,"nv"=>17500,"nav"=>0,"mum"=>25,"bum"=>10);break;
default: $arr = array();
}
return $arr;
}
function online($login, $pcid) {//-добавление, обновление online
mysql_query("UPDATE `user` SET `pcid`='".$pcid."',`last`='".time()."' WHERE `login`='".$_SESSION['user']["login"]."';");
}
?>