runes goodbuy

This commit is contained in:
lopar 2019-01-16 22:20:47 +02:00
parent 094b8a6027
commit 0d5f5c1a43
4 changed files with 7 additions and 61 deletions

View File

@ -37,21 +37,21 @@ class ShopItem extends Item
{ {
switch ($shopType) { switch ($shopType) {
default: default:
$btnPrice = "Купить за " . intval($this->cost) . " кр."; $btnValue = "Купить за " . intval($this->cost) . " кр.";
$btnLink = "/shop.php?buy={$this->id}&rnd=" . mt_rand(); $btnLink = "/shop.php?buy={$this->id}&rnd=" . mt_rand();
break; break;
case 'ashop': case 'ashop':
$btnPrice = "Купить за " . intval($this->ecost) . "р."; $btnValue = "Купить за " . intval($this->ecost) . "р.";
$btnLink = "/ashop.php?buy={$this->id}&rnd=" . mt_rand(); $btnLink = "/ashop.php?buy={$this->id}&rnd=" . mt_rand();
break; break;
case 'sell': case 'sell':
$btnPrice = "Продать"; $btnValue = "Продать";
$btnLink = "/shop.php?sell={$this->id}&rnd=".mt_rand(); $btnLink = "/shop.php?sell={$this->id}&rnd=".mt_rand();
break; break;
} }
echo <<<BTN echo <<<BTN
<p><input type="button" style="background: darkgrey; border: 1px solid grey; border-radius: 2px;" value="{$btnPrice}" <p><input type="button" style="background: darkgrey; border: 1px solid grey; border-radius: 2px;" value="{$btnValue}"
onclick="location='{$btnLink}'"> onclick="location='{$btnLink}'">
BTN; BTN;
if ($this->count > 0) echo "<br><small>В наличии: {$this->count} штук</small>"; if ($this->count > 0) echo "<br><small>В наличии: {$this->count} штук</small>";

View File

@ -1456,17 +1456,6 @@ function showpersout($pas = 0) //FIXME Сделать по человеческ
</TD> </TD>
</TR> </TR>
</TABLE> </TABLE>
<table cellspacing="0" cellpadding="0" border="0"
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>
</tr>
</tbody>
</table>
<TABLE cellPadding=0 cellSpacing=0 width="100%"> <TABLE cellPadding=0 cellSpacing=0 width="100%">
<TBODY> <TBODY>
<? <?
@ -1623,7 +1612,6 @@ function showitem2()
function showitem($row, $type = null, $returned = false, $infOnly = false) function showitem($row, $type = null, $returned = false, $infOnly = false)
{ {
global $user; global $user;
$runes_exp = ['1' => 10500, '2' => 23500, '3' => 38500, '4' => 57000, '5' => 77000, '6' => 103000, '7' => 136500, '8' => 171500, '9' => 212500, '10' => 257500];
$returnHTML = ''; $returnHTML = '';
$incmagic = []; $incmagic = [];
$up = ''; $up = '';
@ -1706,9 +1694,6 @@ function showitem($row, $type = null, $returned = false, $infOnly = false)
$returnHTML .= " <img src=i/podarok.gif class='tooltip' title='Этот предмет вам подарил {$row['present']}. Вы не сможете передать этот предмет кому-либо еще.' alt='Этот предмет вам подарил {$row['present']}. Вы не сможете передать этот предмет кому-либо еще.'>"; $returnHTML .= " <img src=i/podarok.gif class='tooltip' title='Этот предмет вам подарил {$row['present']}. Вы не сможете передать этот предмет кому-либо еще.' alt='Этот предмет вам подарил {$row['present']}. Вы не сможете передать этот предмет кому-либо еще.'>";
// Конец первой строчки // Конец первой строчки
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'])) { if (!empty($row['ecost'])) {
$returnHTML .= "<br><small style='color: green'>Предмет куплен за еврокредиты.</small>"; $returnHTML .= "<br><small style='color: green'>Предмет куплен за еврокредиты.</small>";
} elseif (!empty($row['point'])) { } elseif (!empty($row['point'])) {
@ -1876,34 +1861,6 @@ function showitem($row, $type = null, $returned = false, $infOnly = false)
echo $returnHTML; echo $returnHTML;
} }
function show_rune($slot, $uid, $type = 0)
{
global $user;
$runes_exp = ['1' => 10500, '2' => 23500, '3' => 38500, '4' => 57000, '5' => 77000, '6' => 103000, '7' => 136500, '8' => 171500, '9' => 212500, '10' => 257500];
$us = db::c()->query('SELECT `id`, `rune_1`, `rune_2`, `rune_3` FROM `users` WHERE `id` = ?i', $uid)->fetch_assoc();
if (isset($us['id'])) {
if ($us['rune_' . $slot] > 0) {
$ruid = $us['rune_' . $slot];
$rtype = (23 + $slot);
$dress = db::c()->query('SELECT `id`, `img`, `name`, `duration`, `maxdur`, `rune_level`, `rune_exp` FROM `inventory` WHERE `id` = ?i AND `owner` = ?i', $ruid, $us['id'])->fetch_assoc();
if (isset($dress['id'])) {
if ($us['id'] == $user['id'] && $type == 1) {
$r = '<a href=\'main.php?edit=1&drop=' . $rtype . '\'><img class=\'tooltip\' src="i/sh/' . $dress['img'] . '" width="30" height="30" title="Снять <b>' . $dress['name'] . '</b><br />Уровень: ' . $dress['rune_level'] . '<br />Опыт: ' . $dress['rune_exp'] . '/' . $runes_exp[$dress['rune_level'] + 1] . '<br />Прочность: ' . $dress['duration'] . '/' . $dress['maxdur'] . '" /></a>';
} else {
$r = '<img class=\'tooltip\' src="i/sh/' . $dress['img'] . '" width="30" height="30" title="<b>' . $dress['name'] . '</b><br />Уровень: ' . $dress['rune_level'] . '<br />Прочность : ' . $dress['duration'] . '/' . $dress['maxdur'] . '" />';
}
} else {
$r = '<img class=\'tooltip\' src="i/none.gif" width="30" height="30" title="<b>Пустой слот Руна</b>" />';
}
} else {
$r = '<img class=\'tooltip\' src="i/none.gif" width="30" height="30" title="<b>Пустой слот Руна</b>" />';
}
} else {
$r = '<img class=\'tooltip\' src="i/none.gif" width="30" height="30" title="<b>Пустой слот Руна</b>" />';
}
return $r;
}
function undressall($id) function undressall($id)
{ {
for ($i = 1; $i <= 26; $i++) { for ($i = 1; $i <= 26; $i++) {

View File

@ -604,17 +604,6 @@ function showpersinv($id)
</TD> </TD>
</TR> </TR>
</TABLE> </TABLE>
<table cellspacing="0" cellpadding="0" border="0"
style="background: url('http://i.oldbk.com/i/runes_slots.jpg') no-repeat center bottom;">
<tbody>
<tr>
<td width="59" height="48" align="right"><? echo show_rune(1, $user['id'], 1); ?></td>
<td width="74" height="48" align="center"><? echo show_rune(2, $user['id'], 1); ?></td>
<td width="57" height="48" align="left"><? echo show_rune(3, $user['id'], 1); ?></td>
</tr>
</tbody>
</table>
</CENTER> <?php </CENTER> <?php
} }

View File

@ -413,7 +413,7 @@ if (input::post('goto') == 'gravirovka') {
?> ?>
</small> </small>
</TD> </TD>
<TD valign=top><?= showitem($row) ?></TD> <TD valign=top><?php #showitem($row) ?></TD>
</TR> </TR>
<?php <?php
} }
@ -432,7 +432,7 @@ if (input::post('goto') == 'gravirovka') {
за <?= $row['cost'] ?> кр.</A><BR> за <?= $row['cost'] ?> кр.</A><BR>
</small> </small>
</TD> </TD>
<TD valign=top><?= showitem($row) ?></TD> <TD valign=top><?php #showitem($row) ?></TD>
</TR> </TR>
<?php <?php
} }
@ -460,7 +460,7 @@ if (input::post('goto') == 'gravirovka') {
за <?= $babki ?> <?= $cost_t ?>.</A><BR> за <?= $babki ?> <?= $cost_t ?>.</A><BR>
</small> </small>
</TD> </TD>
<TD valign=top><?= showitem($row) ?></TD> <TD valign=top><?php #showitem($row) ?></TD>
</TR> </TR>
<?php <?php
} }