Define undefined variables in showitem()

This commit is contained in:
lopar 2018-12-11 01:52:46 +02:00
parent 374205b7f4
commit 6db3a04f1d

View File

@ -19,7 +19,7 @@ if (isset($user['id']) && $user['block'] == 1) {
define("HPADDICTIONEFFECT", 33);
$ip = filter_input(INPUT_SERVER,'REMOTE_ADDR', FILTER_VALIDATE_IP);
$ip = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP);
if (isset($_GET['goto']) and isset($_GET['tStamp']) and isset($_GET['vcode'])) {
if ($_GET['vcode'] == md5(sha1($_GET['goto'] . $_GET['tStamp']))) {
@ -56,7 +56,7 @@ $userslots = ['sergi', 'kulon', 'perchi', 'weap', 'bron', 'r1', 'r2', 'r3', 'hel
function getuserdata($id = 0)
{
if (!$id) $id = isset($_SESSION['uid'])?$_SESSION['uid']:NULL; // Хорошее решение проверок, кстати.
if (!$id) $id = isset($_SESSION['uid']) ? $_SESSION['uid'] : NULL; // Хорошее решение проверок, кстати.
if (!$id) return array();
$rec = db::c()->query('SELECT `hp`, `maxhp`, `fullhptime`, `battle` FROM `users` WHERE `id` = "?s"', $id)->fetch_assoc();
if ($rec['hp'] < $rec['maxhp'] && time() > $rec['fullhptime'] && !$rec['battle'] && ($rec['hp'] > 0)) {
@ -618,6 +618,7 @@ function nick($user)
$r .= '';
return $r;
}
function nick4($id, $st)
{
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1"));
@ -815,15 +816,15 @@ function timeOut($ttm)
function show_eff_inf($u, $type)
{
$img = [
1 => "travma.gif", 2 => "magic/sleep.gif", 3 => "magic/sleepf.gif", 4 => "magic/haos.gif",
5 => "magic/obezl.gif", 6 => "expx15.gif", 7 => "euphoria.png", 8 => "sleep_obj.gif",
10 => "magic/chains.gif", 11 => "travma.gif", 12 => "travma.gif", 13 => "travma.gif",
14 => "travma.gif", 20 => "check.gif", 21 => "magic/al_neut_power.gif", 22 => "magic/fist_def.gif",
201 => "magic/defence.gif", 202 => "magic/devastate.gif", 203 => "magic/spell_luck.gif", 215 => "magic/wis_air_def1.gif",
216 => "magic/wis_air_def2.gif", 217 => "magic/wis_air_def3.gif", 218 => "magic/wis_earth_def1.gif", 219 => "magic/wis_earth_def2.gif",
220 => "magic/wis_earth_def3.gif", 221 => "magic/wis_fire_def1.gif", 222 => "magic/wis_fire_def2.gif", 223 => "magic/wis_fire_def3.gif",
224 => "magic/wis_water_def1.gif", 225 => "magic/wis_water_def2.gif", 226 => "magic/wis_water_def3.gif", 227 => "magic/attack_defence.gif",
1022 => "sh/hidden.gif"
1 => "travma.gif", 2 => "magic/sleep.gif", 3 => "magic/sleepf.gif", 4 => "magic/haos.gif",
5 => "magic/obezl.gif", 6 => "expx15.gif", 7 => "euphoria.png", 8 => "sleep_obj.gif",
10 => "magic/chains.gif", 11 => "travma.gif", 12 => "travma.gif", 13 => "travma.gif",
14 => "travma.gif", 20 => "check.gif", 21 => "magic/al_neut_power.gif", 22 => "magic/fist_def.gif",
201 => "magic/defence.gif", 202 => "magic/devastate.gif", 203 => "magic/spell_luck.gif", 215 => "magic/wis_air_def1.gif",
216 => "magic/wis_air_def2.gif", 217 => "magic/wis_air_def3.gif", 218 => "magic/wis_earth_def1.gif", 219 => "magic/wis_earth_def2.gif",
220 => "magic/wis_earth_def3.gif", 221 => "magic/wis_fire_def1.gif", 222 => "magic/wis_fire_def2.gif", 223 => "magic/wis_fire_def3.gif",
224 => "magic/wis_water_def1.gif", 225 => "magic/wis_water_def2.gif", 226 => "magic/wis_water_def3.gif", 227 => "magic/attack_defence.gif",
1022 => "sh/hidden.gif"
];
$r = '';
$and = '';
@ -831,7 +832,7 @@ function show_eff_inf($u, $type)
if ($type == 1) {
$and = " AND `type` != 1022";
}
$effs = db::c()->query('SELECT * FROM `effects` WHERE `owner` = ?i'.$and, $u)->fetch_assoc();
$effs = db::c()->query('SELECT * FROM `effects` WHERE `owner` = ?i' . $and, $u)->fetch_assoc();
$etype = $effs['type'];
if ($type == 1) {
while ($effs) {
@ -1135,7 +1136,7 @@ function showinf_pers($id, $pas = 0, $battle = 0, $me = 0, $main = false) //FIXM
if ($invis) {
$data['id'] = null;
} else {
$data = db::c()->query('SELECT * FROM `online` WHERE `date` >= ?i AND `id` = ?i', time()-60, $user['id'])->fetch_assoc();
$data = db::c()->query('SELECT * FROM `online` WHERE `date` >= ?i AND `id` = ?i', time() - 60, $user['id'])->fetch_assoc();
}
$r .= '</td></tr></table></td></tr></table>';
@ -1148,7 +1149,7 @@ function showinf_pers($id, $pas = 0, $battle = 0, $me = 0, $main = false) //FIXM
if (!$battle) {
if ($pas) {
$r .= '<tr><td align=middle colSpan=2><b><small>'.GAMEDOMAIN.'</small></b></td></tr><tr><td colSpan=2>';
$r .= '<tr><td align=middle colSpan=2><b><small>' . GAMEDOMAIN . '</small></b></td></tr><tr><td colSpan=2>';
$online = db::c()->query('SELECT `u`.*, `o`.`date`, `u`.*, `o`.`real_time` FROM `users` AS `u`, `online` AS `o` WHERE `u`.`id` = `o`.`id` AND `u`.`id` = ?i ', $user['id'])->fetch_assoc();
if ($invis) {
$invis = db::c()->query('SELECT `time` FROM `effects` WHERE `owner` = ?i AND `type` = 1022', $user['id'])->fetch_assoc();//FIXME Тип содержит число, невозможное в базе.
@ -1252,7 +1253,7 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
<TABLE cellspacing=0 cellpadding=0>
<tr>
<TD colspan=3 width=100%>
<?=setHP($user['hp'], $user['maxhp'])?>
<?= setHP($user['hp'], $user['maxhp']) ?>
</td>
</tr>
<?
@ -1279,7 +1280,7 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
?>
</TD>
</TR>
<?
<?
} ?>
<TR>
<TD width=62 valign=top>
@ -1287,7 +1288,7 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
<TR>
<TD><?php
if ($user['sergi'] > 0) {
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i',$user['sergi'])->fetch_assoc();
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i', $user['sergi'])->fetch_assoc();
if ($dress['includemagicdex'] && !$pas) {
echo showhrefmagic($dress);
} else {
@ -1301,7 +1302,7 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
<TR>
<TD><?php
if ($user['kulon'] > 0) {
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i',$user['kulon'])->fetch_assoc();
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i', $user['kulon'])->fetch_assoc();
if ($dress['includemagicdex'] && !$pas) {
echo showhrefmagic($dress);
} else {
@ -1315,7 +1316,7 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
<TR>
<TD><?php
if ($user['weap'] > 0) {
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i',$user['weap'])->fetch_assoc();
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i', $user['weap'])->fetch_assoc();
if ($dress['includemagicdex'] && !$pas) {
echo showhrefmagic($dress);
} else {
@ -1334,23 +1335,23 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
if ($user['plaw']) {
$d = $user['plaw'];
if ($user['bron']) {
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i',$user['bron'])->fetch_assoc();
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i', $user['bron'])->fetch_assoc();
$title .= '<br />--------------------<br /><b>' . $dress['name'] . '</b><br />Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . '' . (($dress['ghp'] > 0) ? '<br />Уровень жизни ' . plusorminus($dress['ghp']) : '') . (($dress['text'] != null) ? '<br />На одежде вышито ' . $dress['text'] . '' : '') . (($dress['gsila'] != 0) ? '<br />Сила ' . plusorminus($dress['gsila']) . '' : '') . (($dress['glovk'] != 0) ? '<br />Ловкость ' . plusorminus($dress['glovk']) . '' : '') . (($dress['ginta'] != 0) ? '<br />Интуиция ' . plusorminus($dress['ginta']) . '' : '') . (($dress['gintel'] != 0) ? '<br />Интеллект ' . plusorminus($dress['gintel']) . '' : '') . (($dress['bron1'] != 0) ? '<br />Броня головы: ' . plusorminus($dress['bron1']) . '' : '') . (($dress['bron2'] != 0) ? '<br />Броня корпуса: ' . plusorminus($dress['bron2']) . '' : '') . (($dress['bron3'] != 0) ? '<br />Броня пояса: ' . plusorminus($dress['bron3']) . '' : '') . (($dress['bron4'] != 0) ? '<br />Броня ног: ' . plusorminus($dress['bron4']) . '' : '');
}
if ($user['rybax']) {
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i',$user['rybax'])->fetch_assoc();
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i', $user['rybax'])->fetch_assoc();
$title .= '<br />--------------------<br /><b>' . $dress['name'] . '</b><br />Прочность ' . $dress['duration'] . '/' . $dress['maxdur'] . '' . (($dress['ghp'] > 0) ? '<br />Уровень жизни ' . plusorminus($dress['ghp']) : '') . (($dress['text'] != null) ? '<br />На одежде вышито ' . $dress['text'] . '' : '') . (($dress['gsila'] != 0) ? '<br />Сила ' . plusorminus($dress['gsila']) . '' : '') . (($dress['glovk'] != 0) ? '<br />Ловкость ' . plusorminus($dress['glovk']) . '' : '') . (($dress['ginta'] != 0) ? '<br />Интуиция ' . plusorminus($dress['ginta']) . '' : '') . (($dress['gintel'] != 0) ? '<br />Интеллект ' . plusorminus($dress['gintel']) . '' : '') . (($dress['bron1'] != 0) ? '<br />Броня головы: ' . plusorminus($dress['bron1']) . '' : '') . (($dress['bron2'] != 0) ? '<br />Броня корпуса: ' . plusorminus($dress['bron2']) . '' : '') . (($dress['bron3'] != 0) ? '<br />Броня пояса: ' . plusorminus($dress['bron3']) . '' : '') . (($dress['bron4'] != 0) ? '<br />Броня ног: ' . plusorminus($dress['bron4']) . '' : '');
}
} elseif ($user['bron']) {
$d = $user['bron'];
if ($user['rybax']) {
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i',$user['rybax'])->fetch_assoc();
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i', $user['rybax'])->fetch_assoc();
$title .= "<br />--------------------<br /><b>$dress[name]</b><br />Прочность $dress[duration]/$dress[maxdur]" . (($dress['ghp'] > 0) ? "<br />Уровень жизни " . plusorminus($dress['ghp']) : "") . (($dress['text'] != null) ? "<br />На одежде вышито '{$dress['text']}'" : "") . (($dress['gsila'] != 0) ? "<br />Сила " . plusorminus($dress['gsila']) : "") . (($dress['glovk'] != 0) ? "<br />Ловкость " . plusorminus($dress['glovk']) : "") . (($dress['ginta'] != 0) ? "<br />Интуиция " . plusorminus($dress['ginta']) : "") . (($dress['gintel'] != 0) ? "<br />Интеллект " . plusorminus($dress['gintel']) : "") . (($dress['bron1'] != 0) ? "<br />Броня головы: " . plusorminus($dress['bron1']) : "") . (($dress['bron2'] != 0) ? "<br />Броня корпуса: " . plusorminus($dress['bron2']) : "") . (($dress['bron3'] != 0) ? "<br />Броня пояса: " . plusorminus($dress['bron3']) : "") . (($dress['bron4'] != 0) ? "<br />Броня ног: " . plusorminus($dress['bron4']) : "") . '"';
}
} elseif ($user['rybax']) {
$d = $user['rybax'];
}
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i',$d)->fetch_assoc();
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i', $d)->fetch_assoc();
if ($dress['includemagicdex'] && !$pas) {
echo showhrefmagic($dress);
} else {
@ -1367,7 +1368,7 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
<tr>
<td><?php
if ($user['r1'] > 0) {
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i',$user['r1'])->fetch_assoc();
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i', $user['r1'])->fetch_assoc();
if ($dress['includemagicdex'] && !$pas) {
showhrefmagic($dress);
} else {
@ -1379,7 +1380,7 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
?></A></td>
<td><?php
if ($user['r2'] > 0) {
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i',$user['r2'])->fetch_assoc();
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i', $user['r2'])->fetch_assoc();
if ($dress['includemagicdex'] && !$pas) {
echo showhrefmagic($dress);
} else {
@ -1391,7 +1392,7 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
?></A></td>
<td><?php
if ($user['r3'] > 0) {
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i',$user['r3'])->fetch_assoc();
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i', $user['r3'])->fetch_assoc();
if ($dress['includemagicdex'] && !$pas) {
echo showhrefmagic($dress);
} else {
@ -1415,7 +1416,7 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
<TR>
<TD><?php
if ($user['helm'] > 0) {
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i',$user['helm'])->fetch_assoc();
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i', $user['helm'])->fetch_assoc();
if ($dress['includemagicdex'] && !$pas) {
echo showhrefmagic($dress);
} else {
@ -1429,7 +1430,7 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
<TR>
<TD><?php
if ($user['perchi'] > 0) {
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i',$user['perchi'])->fetch_assoc();
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i', $user['perchi'])->fetch_assoc();
if ($dress['includemagicdex'] && !$pas) {
echo showhrefmagic($dress);
} else {
@ -1443,7 +1444,7 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
<TR>
<TD><?php
if ($user['shit'] > 0) {
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i',$user['shit'])->fetch_assoc();
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i', $user['shit'])->fetch_assoc();
if ($dress['includemagicdex'] && !$pas) {
echo showhrefmagic($dress);
} else {
@ -1457,7 +1458,7 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
<TR>
<TD><?php
if ($user['boots'] > 0) {
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i',$user['boots'])->fetch_assoc();
$dress = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i', $user['boots'])->fetch_assoc();
if ($dress['includemagicdex'] && !$pas) {
echo showhrefmagic($dress);
} else {
@ -1478,9 +1479,9 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
style="background: url('i/runes_slots.jpg') no-repeat center bottom;">
<tbody>
<tr>
<td width="59" height="48" align="right"><?=show_rune(1, $user['id'])?></td>
<td width="74" height="48" align="center"><?=show_rune(2, $user['id'])?></td>
<td width="57" height="48" align="left"><?=show_rune(3, $user['id'])?></td>
<td width="59" height="48" align="right"><?= show_rune(1, $user['id']) ?></td>
<td width="74" height="48" align="center"><?= show_rune(2, $user['id']) ?></td>
<td width="57" height="48" align="left"><?= show_rune(3, $user['id']) ?></td>
</tr>
</tbody>
</table>
@ -1516,34 +1517,38 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
</TD>
<TD valign=top style='width:450px;'></TD>
Сила: <?=$user['sila']?>
<?php if (isset($param_bonus['sila'])) echo " <b><font color=green>(+" . $param_bonus['sila'] . ")</font></b>"; ?><BR>
Ловкость: <?=$user['lovk']?>
<?php if (isset($param_bonus['lovk'])) echo " <b><font color=green>(+" . $param_bonus['lovk'] . ")</font></b>"; ?><BR>
Интуиция: <?=$user['inta']?>
<?php if (isset($param_bonus['inta'])) echo " <b><font color=green>(+" . $param_bonus['inta'] . ")</font></b>"; ?><BR>
Выносливость:<?=$user['vinos']?>
<?php if (isset($param_bonus['vinos'])) echo " <b><font color=green>(+" . $param_bonus['vinos'] . ")</font></b>"; ?><BR>
Интеллект: <?=$user['intel']?><BR>
Мудрость: <?=$user['mudra']?><BR>
Сила: <?= $user['sila'] ?>
<?php if (isset($param_bonus['sila'])) echo " <b><font color=green>(+" . $param_bonus['sila'] . ")</font></b>"; ?>
<BR>
Ловкость: <?= $user['lovk'] ?>
<?php if (isset($param_bonus['lovk'])) echo " <b><font color=green>(+" . $param_bonus['lovk'] . ")</font></b>"; ?>
<BR>
Интуиция: <?= $user['inta'] ?>
<?php if (isset($param_bonus['inta'])) echo " <b><font color=green>(+" . $param_bonus['inta'] . ")</font></b>"; ?>
<BR>
Выносливость:<?= $user['vinos'] ?>
<?php if (isset($param_bonus['vinos'])) echo " <b><font color=green>(+" . $param_bonus['vinos'] . ")</font></b>"; ?>
<BR>
Интеллект: <?= $user['intel'] ?><BR>
Мудрость: <?= $user['mudra'] ?><BR>
<?php if ($user['stats'] > 0 || $user['master'] > 0): ?>
<a href="main.php?edit=1">+ Способности</a>
<?php endif; ?>
<hr>
Опыт: <b><?=$user['exp']?></b> (<?= $user['nextup'] ?>) <br>
Уровень: <?=$user['level']?><br>
Побед: <?=$user['win']?><br>
Поражений: <?=$user['lose']?><br>
Ничьих: <?=$user['nich']?><br>
Опыт: <b><?= $user['exp'] ?></b> (<?= $user['nextup'] ?>) <br>
Уровень: <?= $user['level'] ?><br>
Побед: <?= $user['win'] ?><br>
Поражений: <?= $user['lose'] ?><br>
Ничьих: <?= $user['nich'] ?><br>
<?
$ekr_bank = db::c()->query('SELECT SUM(`ekr`) AS `bank_ekr`,SUM(`cr`) AS `bank_cr` FROM `bank` WHERE `id`= ?i', $user['id'])->fetch_assoc();
?>
Деньги: <b><?=$user['money']?></b> кр.<br>
В банке: <b><?=$ekr_bank['bank_cr']?><b> кр. / <b><?=$ekr_bank['bank_ekr']?></b> eкр.<br>
Деньги: <b><?= $user['money'] ?></b> кр.<br>
В банке: <b><?= $ekr_bank['bank_cr'] ?></b> кр. / <b><?= $ekr_bank['bank_ekr'] ?></b> eкр.<br>
<?
if ($user['klan']) {
@ -1554,12 +1559,12 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
?>
<TR>
<TD colSpan=2 style="padding-left:25px;">
Сила: <?=$user['sila']?><BR>
Ловкость: <?=$user['lovk']?><BR>
Интуиция: <?=$user['inta']?><BR>
Выносливость: <?=$user['vinos']?><BR>
Интеллект: <?=$user['intel']?><BR>
Мудрость: <?=$user['mudra']?><BR>
Сила: <?= $user['sila'] ?><BR>
Ловкость: <?= $user['lovk'] ?><BR>
Интуиция: <?= $user['inta'] ?><BR>
Выносливость: <?= $user['vinos'] ?><BR>
Интеллект: <?= $user['intel'] ?><BR>
Мудрость: <?= $user['mudra'] ?><BR>
</td>
</tr></table>
<?
@ -1588,7 +1593,7 @@ function addActions($time, $vars, $vls, $uid)
function plusorminus($n, $shownum = 1)
{
if (!$shownum) {
if (empty($shownum)) {
if ($n >= 2) return "++";
if ($n > 0) return "+";
if ($n < 0) return "-";
@ -1600,15 +1605,37 @@ function plusorminus($n, $shownum = 1)
}
}
function showitem2()
{
/**
* Проверяем одевается ли предмет
*/
function isWereable()
{
if (
(empty($row['nsila']) OR $user['sila'] >= $row['nsila']) AND
(empty($row['nlovk']) OR $user['lovk'] >= $row['nlovk']) AND
(empty($row['ninta']) OR $user['inta'] >= $row['ninta']) AND
(empty($row['nvinos']) OR $user['vinos'] >= $row['nvinos']) AND
(empty($row['nintel']) OR $user['intel'] >= $row['nintel']) AND
(empty($row['nmudra']) OR $user['mudra'] >= $row['nmudra']) AND
(empty($row['nlevel']) OR $user['level'] >= $row['nlevel']) AND
(empty($row['nalign']) OR $user['align'] >= $row['nalign'])
) return true; else return false;
}
}
/**
* По ходу, главная функция отображения предметов.
*
* @param array $row - массив значений, передаваймый из запроса к таблице inventory
* @param int $type - тип предмета. Где бы их всех взять?
* @param bool $returned
* @param bool $infOnly
* @return string
*/
* @param array $row - массив значений, передаваймый из запроса к таблице inventory
* @param int $type - тип предмета. Где бы их всех взять?
* @param bool $returned
* @param bool $infOnly
* @return string
*/
function showitem($row, $type, $returned = false, $infOnly = false)
{
@ -1621,19 +1648,20 @@ function showitem($row, $type, $returned = false, $infOnly = false)
destructitem($row['id']);
}
if ($row['magic']) $magic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $row['magic'])->fetch_assoc();
if (!empty($row['magic'])) $magic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $row['magic'])->fetch_assoc();
else {
$magic['chanse'] = $incmagic['chanse'];
$magic['time'] = $incmagic['time'];
$magic['targeted'] = $incmagic['targeted'];
}
if ($row['includemagic']) $incmagic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $row['includemagic'])->fetch_assoc();
if (!empty($row['includemagic'])) $incmagic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $row['includemagic'])->fetch_assoc();
$incmagic['name'] = $row['includemagicname'];
$incmagic['cur'] = $row['includemagicdex'];
$incmagic['max'] = $row['includemagicmax'];
$returnHTML .= '<TR bgcolor="#C7C7C7">';
if ((!$row['count'] || $type == 10) && $infOnly == false) {
if ((empty($row['count']) || $type == 10) && $infOnly == false) {
$up = ($row['upgrade'] > 0 ? " <b>[" . $row['upgrade'] . "]</b>" : "");
$returnHTML .= '<TD align="center" width="100">';
if ($incmagic['max']) {
@ -1643,26 +1671,26 @@ function showitem($row, $type, $returned = false, $infOnly = false)
}
if (($user['sila'] >= $row['nsila']) &&
($user['lovk'] >= $row['nlovk']) &&
($user['inta'] >= $row['ninta']) &&
($user['vinos'] >= $row['nvinos']) &&
($user['intel'] >= $row['nintel']) &&
($user['mudra'] >= $row['nmudra']) &&
($user['level'] >= $row['nlevel']) &&
(((int)$user['align'] == $row['nalign']) || ($row['nalign'] == 0)) &&
($user['noj'] >= $row['nnoj']) &&
($user['topor'] >= $row['ntopor']) &&
($user['dubina'] >= $row['ndubina']) &&
($user['mec'] >= $row['nmech']) &&
($user['mfire'] >= $row['nfire']) &&
($user['mwater'] >= $row['nwater']) &&
($user['mair'] >= $row['nair']) &&
($user['mearth'] >= $row['nearth']) &&
($user['mlight'] >= $row['nlight']) &&
($user['mgray'] >= $row['ngray']) &&
($user['mdark'] >= $row['ndark']) &&
($row['needident'] == 0) &&
($row['type'] < 13 || ($row['type'] == 22 || $row['type'] == 23 || $row['type'] == 24))) {
($user['lovk'] >= $row['nlovk']) &&
($user['inta'] >= $row['ninta']) &&
($user['vinos'] >= $row['nvinos']) &&
($user['intel'] >= $row['nintel']) &&
($user['mudra'] >= $row['nmudra']) &&
($user['level'] >= $row['nlevel']) &&
(((int)$user['align'] == $row['nalign']) || ($row['nalign'] == 0)) &&
($user['noj'] >= $row['nnoj']) &&
($user['topor'] >= $row['ntopor']) &&
($user['dubina'] >= $row['ndubina']) &&
($user['mec'] >= $row['nmech']) &&
($user['mfire'] >= $row['nfire']) &&
($user['mwater'] >= $row['nwater']) &&
($user['mair'] >= $row['nair']) &&
($user['mearth'] >= $row['nearth']) &&
($user['mlight'] >= $row['nlight']) &&
($user['mgray'] >= $row['ngray']) &&
($user['mdark'] >= $row['ndark']) &&
($row['needident'] == 0) &&
($row['type'] < 13 || ($row['type'] == 22 || $row['type'] == 23 || $row['type'] == 24))) {
$returnHTML .= "<a href='?edit=1&dress={$row['id']}'>надеть</a> ";
}
@ -1673,7 +1701,7 @@ function showitem($row, $type, $returned = false, $infOnly = false)
elseif ($magic['targeted'] == 2) $returnHTML .= "findlogin('Введите имя персонажа', 'main.php?edit=1&use={$row['id']}', 'target')";
else $returnHTML .= "window.location='main.php?edit=1&use=" . $row['id'] . "';";
$returnHTML .= "\"href='#'>использовать</a><BR> ";
}
}
if ($type != 10) {
$returnHTML .= '<br />ID: ' . $row['id'] . '<br />';
@ -1685,203 +1713,148 @@ function showitem($row, $type, $returned = false, $infOnly = false)
}
$returnHTML .= "<td>";
if ($row['destinyinv'] > 0) {
if (!empty($row['destinyinv'])) {
$returnHTML .= "{$row['name']}{$up}<img src=i/align_{$row['nalign']}.gif>&nbsp;(Масса:&nbsp;{$row['massa']})<img src=i/destiny{$row['destinyinv']}.gif alt=\"Этот предмет связан с Вами общей судьбой. Вы не можете передать его кому-либо еще.\"><img src=i/artefact{$row['artefact']}.gif>" . (($row['present']) ? '&nbsp;<IMG SRC="i/podarok.gif" TITLE="Этот предмет вам подарил ' . $row['present'] . '. Вы не сможете передать этот предмет кому-либо еще." ALT="Этот предмет вам подарил ' . $row['present'] . '. Вы не сможете передать этот предмет кому-либо еще.">' : "") . "<BR>";
} elseif ($row['destiny'] > 0) {
} elseif (!empty($row['destiny'])) {
$returnHTML .= "{$row['name']}{$up}<img src=i/align_{$row['nalign']}.gif>&nbsp;(Масса:&nbsp;{$row['massa']})<img src=i/destiny{$row['destiny']}.gif alt=\"Этот предмет будет связан с Вами общей судьбой. Вы не сможете передать его кому-либо еще.\"><img src=i/artefact{$row['artefact']}.gif>" . (($row['present']) ? '&nbsp;<IMG SRC="i/podarok.gif" WIDTH="16" HEIGHT="18" BORDER=0 TITLE="Этот предмет вам подарил ' . $row['present'] . '. Вы не сможете передать этот предмет кому-либо еще." ALT="Этот предмет вам подарил ' . $row['present'] . '. Вы не сможете передать этот предмет кому-либо еще.">' : "") . "<BR>";
} else {
} else
$returnHTML .= "{$row['name']}{$up}<img src=i/align_{$row['nalign']}.gif>&nbsp;(Масса:&nbsp;{$row['massa']})<img src=i/destiny{$row['destiny']}.gif><img src=i/artefact{$row['artefact']}.gif>" . (($row['present']) ? ' <IMG SRC="i/podarok.gif" WIDTH="16" HEIGHT="18" BORDER=0 TITLE="Этот предмет вам подарил ' . $row['present'] . '. Вы не сможете передать этот предмет кому-либо еще." ALT="Этот предмет вам подарил ' . $row['present'] . '. Вы не сможете передать этот предмет кому-либо еще.">' : "") . "<BR>";
}
if ($row['type'] == 24 && $type != 11) {
$returnHTML .= 'Уровень руны: <b>' . $row['rune_level'] . '</b> (<b title=\'Опыт\'>' . $row['rune_exp'] . '/' . $runes_exp[$row['rune_level'] + 1] . '</b>)<br />';
}
if ($row['ecost'] > 0) {
$returnHTML .= "<small style='color: green'>Предмет куплен за еврокредиты.</small> &nbsp; &nbsp;";
} elseif ($row['point'] > 0) {
$returnHTML .= "<small style='color: green'>Предмет куплен за очки репутации.</small> &nbsp; &nbsp;";
} else {
$returnHTML .= "<b>Цена: {$row['cost']} кр.</b> &nbsp; &nbsp;";
}
if ($row['zeton'] > 0) {
$returnHTML .= "<br><b>Жетон: {$row['zeton']}</b>&nbsp<br>";
}
if ($row['count']) {
$returnHTML .= "<small>(количество: {$row['count']})</small>";
}
if ($row['for_me'] > 0) {
$returnHTML .= '<br /><small style=\'color: Red;\'>После покупки вещь будет привязана к персонажу.</small>';
}
$returnHTML .= "<BR>Долговечность: {$row['duration']}/{$row['maxdur']}";
if ($row['podgon'] > 0) {
if ($row['type'] == 24 && $type != 11)
$returnHTML .= "<br>Уровень руны: <b>" . $row['rune_level'] . "</b> (<b title='Опыт'>" . $row['rune_exp'] . "/" . $runes_exp[$row['rune_level'] + 1] . "</b>)";
if (!empty($row['ecost'])) {
$returnHTML .= "<br><small style='color: green'>Предмет куплен за еврокредиты.</small>";
} elseif (!empty($row['point'])) {
$returnHTML .= "<br><small style='color: green'>Предмет куплен за очки репутации.</small>";
} else $returnHTML .= "<br><b>Цена: {$row['cost']} кр.</b>";
if (!empty($row['zeton']))
$returnHTML .= "<br><b>Жетон: {$row['zeton']}</b>&nbsp";
if (!empty($row['count']))
$returnHTML .= "<br><small>(количество: {$row['count']})</small>";
if (!empty($row['for_me']))
$returnHTML .= "<br><small style='color: red;'>После покупки вещь будет привязана к персонажу.</small>";
$returnHTML .= "<br>Долговечность: {$row['duration']}/{$row['maxdur']}";
if (!empty($row['podgon']))
$returnHTML .= " <small>[Подогнано: <b>" . $row['podgon'] . "</b> раз]</small>";
}
$returnHTML .= "<BR>";
if (empty($row['needident'])) {
if (!empty($magic['chanse'])) $returnHTML .= "<br>Вероятность срабатывания: {$magic['chanse']}%";
if (!empty($magic['time'])) $returnHTML .= "<br>Продолжительность действия магии: {$magic['time']} мин.";
if (!$row['needident']) {
if ($magic['chanse'] >= 98) $magic['chanse'] = 99;
$returnHTML .= (($magic['chanse']) ? "Вероятность срабатывания: " . $magic['chanse'] . "%<BR>" : "") . "
" . (($magic['time']) ? "Продолжительность действия магии: " . $magic['time'] . " мин.<BR>" : "") . "
" . (($row['goden']) ? "Срок годности: {$row['goden']} дн. " . ((!$row['count']) ? "(до " . date("Y.m.d H:i", $row['dategoden']) . ")" : "") . "<BR>" : "") . "
" . (($row['nsila'] || $row['nlovk'] || $row['ninta'] || $row['nvinos'] OR $row['nlevel'] OR $row['nintel'] OR $row['nmudra'] OR $row['nnoj'] OR $row['ntopor'] OR $row['ndubina'] OR $row['nmech'] OR $row['nfire'] OR $row['nwater'] OR $row['nair'] OR $row['nearth'] OR $row['nearth'] OR $row['nlight'] OR $row['ngray'] OR $row['ndark']) ? "<b>Требуется минимальное:</b><BR>" : "") . "
" . (($row['nsila'] > 0) ? " " . (($row['nsila'] > $user['sila']) ? "<span style='color: red'>" : "") . "Сила: {$row['nsila']}</span><BR>" : "") . "
" . (($row['nlovk'] > 0) ? " " . (($row['nlovk'] > $user['lovk']) ? "<span style='color: red'>" : "") . "Ловкость: {$row['nlovk']}</span><BR>" : "") . "
" . (($row['ninta'] > 0) ? " " . (($row['ninta'] > $user['inta']) ? "<span style='color: red'>" : "") . "Интуиция: {$row['ninta']}</span><BR>" : "") . "
" . (($row['nvinos'] > 0) ? " " . (($row['nvinos'] > $user['vinos']) ? "<span style='color: red'>" : "") . "Выносливость: {$row['nvinos']}</span><BR>" : "") . "
" . (($row['nlevel'] > 0) ? " " . (($row['nlevel'] > $user['level']) ? "<span style='color: red'>" : "") . "Уровень: {$row['nlevel']}</span><BR>" : "") . "
" . (($row['nintel'] > 0) ? " " . (($row['nintel'] > $user['intel']) ? "<span style='color: red'>" : "") . "Интеллект: {$row['nintel']}</span><BR>" : "") . "
" . (($row['nnoj'] > 0) ? " " . (($row['nnoj'] > $user['noj']) ? "<span style='color: red'>" : "") . "Мастерство владения ножами и кастетами: {$row['nnoj']}</span><BR>" : "") . "
" . (($row['ntopor'] > 0) ? " " . (($row['ntopor'] > $user['topor']) ? "<span style='color: red'>" : "") . "Мастерство владения топорами и секирами: {$row['ntopor']}</span><BR>" : "") . "
" . (($row['ndubina'] > 0) ? " " . (($row['ndubina'] > $user['dubina']) ? "<span style='color: red'>" : "") . "Мастерство владения дубинами и булавами: {$row['ndubina']}</span><BR>" : "") . "
" . (($row['nmech'] > 0) ? " " . (($row['nmech'] > $user['mec']) ? "<span style='color: red'>" : "") . "Мастерство владения мечами: {$row['nmech']}</span><BR>" : "") . "
" . (($row['nfire'] > 0) ? " " . (($row['nfire'] > $user['mfire']) ? "<span style='color: red'>" : "") . "Мастерство владения стихией Огня: {$row['nfire']}</span><BR>" : "") . "
" . (($row['nwater'] > 0) ? " " . (($row['nwater'] > $user['mwater']) ? "<span style='color: red'>" : "") . "Мастерство владения стихией Воды: {$row['nwater']}</span><BR>" : "") . "
" . (($row['nair'] > 0) ? " " . (($row['nair'] > $user['mair']) ? "<span style='color: red'>" : "") . "Мастерство владения стихией Воздуха: {$row['nair']}</span><BR>" : "") . "
" . (($row['nearth'] > 0) ? " " . (($row['nearth'] > $user['mearth']) ? "<span style='color: red'>" : "") . "Мастерство владения стихией Земли: {$row['nearth']}</span><BR>" : "") . "
" . (($row['nlight'] > 0) ? " " . (($row['nlight'] > $user['mlight']) ? "<span style='color: red'>" : "") . "Мастерство владения магией Света: {$row['nlight']}</span><BR>" : "") . "
" . (($row['ngray'] > 0) ? " " . (($row['ngray'] > $user['mgray']) ? "<span style='color: red'>" : "") . "Мастерство владения серой магией: {$row['ngray']}</span><BR>" : "") . "
" . (($row['ndark'] > 0) ? " " . (($row['ndark'] > $user['mdark']) ? "<span style='color: red'>" : "") . "Мастерство владения магией Тьмы: {$row['ndark']}</span><BR>" : "") . "
if (!empty($row['nlevel'])) $returnHTML .= "<br>Требуется Уровень: {$row['nlevel']}";
if (!empty($row['nsila'])) $returnHTML .= "<br>Требуется Сила: {$row['nsila']}";
if (!empty($row['nlovk'])) $returnHTML .= "<br>Требуется Ловкость: {$row['nlovk']}";
if (!empty($row['ninta'])) $returnHTML .= "<br>Требуется Интуиция: {$row['ninta']}";
if (!empty($row['nvinos'])) $returnHTML .= "<br>Требуется Выносливость: {$row['nvinos']}";
if (!empty($row['nintel'])) $returnHTML .= "<br>Требуется Интеллект: {$row['nintel']}";
if (!empty($row['nmudra'])) $returnHTML .= "<br>Требуется Мудрость: {$row['nmudra']}";
" . (($row['gmeshok'] OR $row['gsila'] OR $row['mfkrit'] OR $row['mfakrit'] OR $row['mfuvorot'] OR $row['mfauvorot'] OR $row['glovk'] OR $row['ghp'] OR $row['ginta'] OR $row['gintel'] OR $row['gnoj'] OR $row['gtopor'] OR $row['gdubina'] OR $row['gmech'] OR $row['gfire'] OR $row['gwater'] OR $row['gair'] OR $row['gearth'] OR $row['gearth'] OR $row['glight'] OR $row['ggray'] OR $row['gdark'] OR $row['minu'] OR $row['maxu'] OR $row['bron1'] OR $row['bron2'] OR $row['bron3'] OR $row['bron4']) ? "<b>Действует на:</b><BR>" : "") . "
" . (($row['minu']) ? " Минимальное наносимое повреждение: +{$row['minu']}<BR>" : "") . "
" . (($row['maxu']) ? " Максимальное наносимое повреждение: +{$row['maxu']}<BR>" : "");
if (!empty($row['minu'])) $returnHTML .= "<br>Минимальное наносимое повреждение: +{$row['minu']}";
if (!empty($row['maxu'])) $returnHTML .= "<br>Максимальное наносимое повреждение: +{$row['maxu']}";
if ($row['gsila']) {
$returnHTML .= "Сила: " . plusorminus($row['gsila']);
if ($row['free_stat'] > 0) {
$returnHTML .= "<br>Сила: " . plusorminus($row['gsila']);
if ($row['free_stat'] > 0)
$returnHTML .= " <a href=?modif_stat=gsila&ids=" . $row['id'] . "&edit=1>🔼</a>";
}
$returnHTML .= "<br>";
}
if ($row['glovk']) {
$returnHTML .= "Ловкость: " . plusorminus($row['glovk']);
if ($row['free_stat'] > 0) {
$returnHTML .= "<br>Ловкость: " . plusorminus($row['glovk']);
if ($row['free_stat'] > 0)
$returnHTML .= " <a href=?modif_stat=glovk&ids=" . $row['id'] . "&edit=1>🔼</a>";
}
$returnHTML .= "<br>";
}
if ($row['ginta']) {
$returnHTML .= "Интуиция: " . plusorminus($row['ginta']);
if ($row['free_stat'] > 0) {
$returnHTML .= "<br>Интуиция: " . plusorminus($row['ginta']);
if ($row['free_stat'] > 0)
$returnHTML .= " <a href=?modif_stat=ginta&ids=" . $row['id'] . "&edit=1>🔼</a>";
}
$returnHTML .= "<br>";
}
if ($row['gintel']) {
$returnHTML .= "Интеллект: " . plusorminus($row['gintel']);
if ($row['free_stat'] > 0) {
$returnHTML .= "<br>Интеллект: " . plusorminus($row['gintel']);
if ($row['free_stat'] > 0)
$returnHTML .= " <a href=?modif_stat=gintel&ids=" . $row['id'] . "&edit=1>🔼</a>";
}
$returnHTML .= "<br>";
}
$returnHTML .= (($row['ghp']) ? "• Уровень жизни: " . plusorminus($row['ghp']) . "<BR>" : "");
if (!empty($row['ghp'])) $returnHTML .= "<br>Уровень жизни: " . plusorminus($row['ghp']);
if ($row['mfkrit'] > 0) {
$returnHTML .= "Мф. критических ударов: " . plusorminus($row['mfkrit']) . "%";
if ($row['free_mf'] > 0) {
$returnHTML .= "<br>Мф. критических ударов: " . plusorminus($row['mfkrit']) . "%";
if ($row['free_mf'] > 0)
$returnHTML .= " <a href=?modif_mf=mfkrit&ids=" . $row['id'] . "&edit=1>🔼</a>";
}
$returnHTML .= "<br>";
}
if ($row['mfakrit'] > 0) {
$returnHTML .= "Мф. против крит. ударов: " . plusorminus($row['mfakrit']) . "%";
if ($row['free_mf'] > 0) {
$returnHTML .= "<br>Мф. против крит. ударов: " . plusorminus($row['mfakrit']) . "%";
if ($row['free_mf'] > 0)
$returnHTML .= " <a href=?modif_mf=mfakrit&ids=" . $row['id'] . "&edit=1>🔼</a>";
}
$returnHTML .= "<br>";
}
if ($row['mfuvorot'] > 0) {
$returnHTML .= "Мф. увертливости: " . plusorminus($row['mfuvorot']) . "%";
if ($row['free_mf'] > 0) {
$returnHTML .= "<br>Мф. увертливости: " . plusorminus($row['mfuvorot']) . "%";
if ($row['free_mf'] > 0)
$returnHTML .= " <a href=?modif_mf=mfuvorot&ids=" . $row['id'] . "&edit=1>🔼</a>";
}
$returnHTML .= "<br>";
}
if ($row['mfauvorot'] > 0) {
$returnHTML .= "Мф. против увертлив.: " . plusorminus($row['mfauvorot']) . "%";
if ($row['free_mf'] > 0) {
$returnHTML .= "<br>Мф. против увертлив.: " . plusorminus($row['mfauvorot']) . "%";
if ($row['free_mf'] > 0)
$returnHTML .= " <a href=?modif_mf=mfauvorot&ids=" . $row['id'] . "&edit=1>🔼</a>";
}
$returnHTML .= "<br>";
}
$returnHTML .= (($row['gnoj']) ? "• Мастерство владения ножами и кастетами: +{$row['gnoj']}<BR>" : "") . "
" . (($row['gtopor']) ? " Мастерство владения топорами и секирами: +{$row['gtopor']}<BR>" : "") . "
" . (($row['gdubina']) ? " Мастерство владения дубинами и булавами: +{$row['gdubina']}<BR>" : "") . "
" . (($row['gmech']) ? " Мастерство владения мечами: +{$row['gmech']}<BR>" : "") . "
" . (($row['gfire']) ? " Мастерство владения стихией Огня: +{$row['gfire']}<BR>" : "") . "
" . (($row['gwater']) ? " Мастерство владения стихией Воды: +{$row['gwater']}<BR>" : "") . "
" . (($row['gair']) ? " Мастерство владения стихией Воздуха: +{$row['gair']}<BR>" : "") . "
" . (($row['gearth']) ? " Мастерство владения стихией Земли: +{$row['gearth']}<BR>" : "") . "
" . (($row['glight']) ? " Мастерство владения магией Света: +{$row['glight']}<BR>" : "") . "
" . (($row['ggray']) ? " Мастерство владения серой магией: +{$row['ggray']}<BR>" : "") . "
" . (($row['gdark']) ? " Мастерство владения магией Тьмы: +{$row['gdark']}<BR>" : "");
if ($row['bron1'] > 0) {
$returnHTML .= "Броня головы: " . $row['bron1'];
if ($row['free_bron'] > 0) {
$returnHTML .= "<br>Броня головы: " . $row['bron1'];
if ($row['free_bron'] > 0)
$returnHTML .= " <a href=?modif_bron=bron1&ids=" . $row['id'] . "&edit=1>🔼</a>";
}
$returnHTML .= "<br>";
}
if ($row['bron2'] > 0) {
$returnHTML .= "Броня корпуса: " . $row['bron2'];
if ($row['free_bron'] > 0) {
$returnHTML .= "<br>Броня корпуса: " . $row['bron2'];
if ($row['free_bron'] > 0)
$returnHTML .= " <a href=?modif_bron=bron2&ids=" . $row['id'] . "&edit=1>🔼</a>";
}
$returnHTML .= "<br>";
}
if ($row['bron3'] > 0) {
$returnHTML .= "Броня пояса: " . $row['bron3'];
if ($row['free_bron'] > 0) {
$returnHTML .= "<br>Броня пояса: " . $row['bron3'];
if ($row['free_bron'] > 0)
$returnHTML .= " <a href=?modif_bron=bron3&ids=" . $row['id'] . "&edit=1>🔼</a>";
}
$returnHTML .= "<br>";
}
if ($row['bron4'] > 0) {
$returnHTML .= "Броня ног: " . $row['bron4'];
if ($row['free_bron'] > 0) {
$returnHTML .= "<br>Броня ног: " . $row['bron4'];
if ($row['free_bron'] > 0)
$returnHTML .= " <a href=?modif_bron=bron4&ids=" . $row['id'] . "&edit=1>🔼</a>";
}
$returnHTML .= "<br>";
}
$returnHTML .= (($row['gmeshok']) ? "• Вместимость рюкзака: +{$row['gmeshok']}<BR>" : "") . "
" . (($row['letter']) ? "Количество символов: " . strlen($row['letter']) . "</div>" : "") . "
" . (($row['letter']) ? "На бумаге записан текст:<div style='background-color:#FAF0E6;'> " . nl2br($row['letter']) . "</div>" : "") . "
" . (($row['opisan']) ? "&bull; " . nl2br($row['opisan']) . "<br />" : "") . "
" . (($magic['name'] && $row['type'] != 50) ? "<span style='color: maroon;'>Наложены заклятия:</span> " . $magic['name'] . "<BR>" : "") . "
if (!empty($row['gmeshok'])) $returnHTML .= "<br>Вместимость рюкзака: +{$row['gmeshok']}";
if (!empty($row['letter'])) $returnHTML .= "<br>На бумаге записан текст:<div style='background-color:#FAF0E6;'> " . nl2br($row['letter']) . "</div>";
if (!empty($row['opisan'])) $returnHTML .= "<br>" . nl2br($row['opisan']);
//Хрен пойми что есть что.
$returnHTML .= (($magic['name'] && $row['type'] != 50) ? "<span style='color: maroon;'>Наложены заклятия:</span> " . $magic['name'] . "<BR>" : "") . "
" . (($row['text']) ? "<em style='font-size:11px; color:chocolate;'> " . $row['text'] . "</em><BR>" : "") . "
" . (($incmagic['max']) ? " Встроено заклятие <img src=\"i/magic/" . $incmagic['img'] . "\" /> " . $incmagic['cur'] . " шт. <BR>" : "") . "
" . (($row['podzem']) ? "<span style='font-size:11px; color:maroon;'>Предмет из подземелья</span><BR>" : "") . "
" . (($row['laba'] == 1) ? "<span style='font-size: 11px; color:maroon'>Пропадёт если не найти выход</span><BR>" : "") . "
" . (($row['laba'] == 2) ? "<span style='font-size: 11px; color:maroon'>Предмет пропадёт после выхода</span><BR>" : "") . "
" . ((!$row['isrep']) ? "<span style='font-size: 11px; color:maroon'>Предмет не подлежит ремонту</span><BR>" : "");
" . (($incmagic['max']) ? " Встроено заклятие <img src=\"i/magic/" . $incmagic['img'] . "\" /> " . $incmagic['cur'] . " шт. <BR>" : "");
if ($row['free_bron'] > 0) {
if (!empty($row['podzem'])) $returnHTML .= "<br><span style='font-size:11px; color:maroon;'>Предмет из подземелья</span>";
if ($row['podzem'] == 1) $returnHTML .= "<br><span style='font-size:11px; color:maroon'>Пропадёт если не найти выход</span>";
if ($row['podzem'] == 2) $returnHTML .= "<br><span style='font-size:11px; color:maroon'>Предмет пропадёт после выхода</span>";
if (empty($row['isrep'])) $returnHTML .= "<br><span style='font-size:11px; color:maroon;'>Предмет не подлежит ремонту</span>";
if ($row['free_bron'] > 0)
$returnHTML .= "<span style='color:blue'>Свободных улучшений брони: " . $row['free_bron'] . "</span><br>";
}
if ($row['free_stat'] > 0) {
if ($row['free_stat'] > 0)
$returnHTML .= "<span style='color:blue'>Свободных улучшений параметров: " . $row['free_stat'] . "</span><br>";
}
if ($row['free_mf'] > 0) {
if ($row['free_mf'] > 0)
$returnHTML .= "<span style='color:blue'>Свободных улучшений модификаторов: " . $row['free_mf'] . "%</span><br>";
}
if ($row['add_proc_mf'] > 0 || $row['add_proc_uron'] > 0 || $row['add_proc_bron'] > 0) {
$returnHTML .= 'Усиление:<br />';
@ -1895,9 +1868,8 @@ function showitem($row, $type, $returned = false, $infOnly = false)
$returnHTML .= '&bull; Брони:' . plusorminus($row['add_proc_bron']) . '%<br />';
}
}
} else {
$returnHTML .= "<span style='color: maroon'><B>Свойства предмета не идентифицированы</B></span><BR>";
}
} else $returnHTML .= "<br><b style='color: maroon'>Свойства предмета не идентифицированы!</b>";
$osob = array(22, 23);
if (in_array($row['type'], $osob)) {
$returnHTML .= 'Особенности:<br />';
@ -2162,17 +2134,17 @@ function dropitem($slot)
`u`.`fauvorot` = `u`.`fauvorot` - `i`.`mfauvorot`,
`u`.`uminu` = `u`.`uminu` - `i`.`minu`,
`u`.`umaxu` = `u`.`umaxu` - `i`.`maxu`
WHERE `i`.`id` = `u`.?f AND `i`.`dressed` = 1 AND `i`.`owner` = ?i AND u.id = ?i',$slot1,$slot1,$user['id'],$user['id']))
db::c()->query('UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = ?i WHERE `hp` > `maxhp` AND `id` = ?i',time(),$user['id']);
WHERE `i`.`id` = `u`.?f AND `i`.`dressed` = 1 AND `i`.`owner` = ?i AND u.id = ?i', $slot1, $slot1, $user['id'], $user['id']))
db::c()->query('UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = ?i WHERE `hp` > `maxhp` AND `id` = ?i', time(), $user['id']);
$wear_raw = db::c()->query('SELECT * FROM `inventory` where `owner` = ?i AND `dressed` = 1',$user['id']);
$wear_raw = db::c()->query('SELECT * FROM `inventory` where `owner` = ?i AND `dressed` = 1', $user['id']);
while ($wear_list = $wear_raw->fetch_assoc()) {
$wear_arr[] = $wear_list['prototype'];
};
$item['id'] = $user[$slot1];
$get_pro = db::c()->query('SELECT * FROM `inventory` where `id` = ?i',$item['id'])->fetch_assoc();
$get_pro = db::c()->query('SELECT * FROM `inventory` where `id` = ?i', $item['id'])->fetch_assoc();
/////////////////////
$sets_items = db::c()->query('SELECT * FROM `item_sets`');
@ -2229,7 +2201,7 @@ function dropitem($slot)
`u`.`mlight = `u`.`mlight - `s`.`glight`,
`u`.`mgray = `u`.`mgray - `s`.`ggray`
WHERE
`u`.`id` = ?i AND `s`.`set_id`= ?i',$user['id'],$set_id);
`u`.`id` = ?i AND `s`.`set_id`= ?i', $user['id'], $set_id);
}
}
return true;
@ -2250,8 +2222,8 @@ function ref_drop()
function derj($id)
{
//global $user;
$user = db::c()->query('SELECT `id`, `align` FROM `users` WHERE `id` = ?i',$_SESSION['uid'])->fetch_assoc();
$ts = db::c()->query('SELECT `id`, `nalign` FROM `inventory` WHERE `id` = ?i',$id)->fetch_assoc();
$user = db::c()->query('SELECT `id`, `align` FROM `users` WHERE `id` = ?i', $_SESSION['uid'])->fetch_assoc();
$ts = db::c()->query('SELECT `id`, `nalign` FROM `inventory` WHERE `id` = ?i', $id)->fetch_assoc();
$al = '(1 = 1)';
if ($ts['nalign'] == 1.1) $al = '(1 = 2)';
$dd = db::c()->query('SELECT `i`.`id` FROM `users` AS `u`, `inventory` AS `i`
@ -2280,7 +2252,7 @@ function ref_drop()
`u`.`mgray` >= `i`.`ngray` AND
`u`.`mdark` >= `i`.`ndark` AND
`i`.`setsale` = 0 AND
`u`.`id` = ?i',$id,$user['id'],$al,$user['align'],$user['id']);
`u`.`id` = ?i', $id, $user['id'], $al, $user['align'], $user['id']);
if ($dd->getNumRows() > 0) {
return true;
} else {
@ -2518,10 +2490,11 @@ function addchp($text, $who, $room = 0)
}
/**
* @param $msg
* @throws \Krugozor\Database\Mysql\Exception
* @param $msg
* @throws \Krugozor\Database\Mysql\Exception
* Отправка системного сообщения в чат.
*/function AddChatSystem($msg)
*/
function AddChatSystem($msg)
{
if ($msg) db::c()->query('INSERT INTO `chat` (`cid`,`msg`,`type`) VALUES (?i,"?s","?s")', 1, $msg, 'sys');
}