remove unused not working magic item blinking visual effect

This commit is contained in:
lopar 2019-01-12 23:35:48 +02:00
parent 4f99781622
commit 2ffd272f48
4 changed files with 68 additions and 83 deletions

View File

@ -125,21 +125,48 @@ abstract class Item
$this->mfauvorot = $row['mfauvorot'];
switch ($this->type) {
case 1: $this->typename = 'Серьги'; break;
case 2: $this->typename = 'Ожерелье'; break;
case 3: $this->typename = 'Оружие'; break;
case 4: $this->typename = 'Броня'; break;
case 5: $this->typename = 'Кольцо'; break;
case 1:
$this->typename = 'Серьги';
break;
case 2:
$this->typename = 'Ожерелье';
break;
case 3:
$this->typename = 'Оружие';
break;
case 4:
$this->typename = 'Броня';
break;
case 5:
$this->typename = 'Кольцо';
break;
case 8: $this->typename = 'Шлем'; break;
case 9: $this->typename = 'Перчатки'; break;
case 10: $this->typename = 'Щит'; break;
case 11: $this->typename = 'Обувь'; break;
case 12: $this->typename = 'Магический свиток'; break;
case 22: $this->typename = 'Рубашка'; break;
case 50: $this->typename = 'Волшебное зелье'; break;
case 200: $this->typename = 'Сувенир'; break;
default: $this->typename = 'Хлам';
case 8:
$this->typename = 'Шлем';
break;
case 9:
$this->typename = 'Перчатки';
break;
case 10:
$this->typename = 'Щит';
break;
case 11:
$this->typename = 'Обувь';
break;
case 12:
$this->typename = 'Магический свиток';
break;
case 22:
$this->typename = 'Рубашка';
break;
case 50:
$this->typename = 'Волшебное зелье';
break;
case 200:
$this->typename = 'Сувенир';
break;
default:
$this->typename = 'Хлам';
}
}

View File

@ -780,7 +780,7 @@ function showhrefmagic($dress)
$r .= "if (confirm('Использовать сейчас?')) window.location='" . $script . ".php?use=" . $dress['id'] . "';";
}
$r .= "\"href='#'>";
$r .= "<img class=\"tooltip\" src='mg2.php?p=" . ($dress['includemagicdex'] / $dress['includemagicmax'] * 100) . "&i={$dress['img']}' style=\"filter:shadow(color=red, direction=90, strength=3);\" title=\"<b>" . $dress['name'] . "</b><br />Прочность " . $dress['duration'] . "/" . $dress['maxdur'] . "" . (($dress['ghp'] > 0) ? "<br />Уровень жизни +{$dress['ghp']}" : "") . (($dress['minu'] > 0) ? "<br />Урон {$dress['minu']}-{$dress['maxu']}" : "") . (($dress['text'] != null) ? "<br />На оружии выгравировано '{$dress['text']}'" : "") . "<br />Встроена магия: <b>" . $magic['name'] . "</b>\" /><br />";
$r .= "<img src=\"i/sh/{$dress['img']}\" style=\"filter:shadow(color=red, direction=90, strength=3);\" title=\"" . $dress['name'] . (($dress['text'] != null) ? "<br />На оружии выгравировано '{$dress['text']}'" : "") . "\"><br>";
return $r;
}
@ -1648,11 +1648,8 @@ function showitem($row, $type = null, $returned = false, $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 (!empty($incmagic['max'])) {
$returnHTML .= "<img class=\"tooltip\" src='mg2.php?p=" . ($incmagic['cur'] / $incmagic['max'] * 100) . "&i={$row['img']}' style=\"filter:shadow(color=red, direction=90, strength=3);\"><BR>";
} else {
$returnHTML .= "<img " . ((($row['maxdur'] - 2) <= $row['duration'] && $row['duration'] > 2) ? " style='background-image:url(i/blink.gif);' " : "") . " src='i/sh/{$row['img']}'><BR>";
}
if (($user['sila'] >= $row['nsila']) &&
($user['lovk'] >= $row['nlovk']) &&

10
mg2.php
View File

@ -1,10 +0,0 @@
<?php
$im1=imageCreateFromGIF("i/sh/".$_GET['i']);
$colorcount = imagecolorstotal($im1);
$size_x=imageSX($im1);
$size_y=imageSY($im1);
imageColorSet($im1, 1, 198, 64, 1);
$transparentcolor = imagecolortransparent($im1);
imagefilledrectangle($im1,2,($size_y-$size_y*$_GET['p']/100),4,$size_y,1);
Header("Content-type: image/gif");
imageGIF($im1);

View File

@ -215,50 +215,21 @@ if ($sellItemId && is_numeric($sellItemId)) {
echo "<b style='color: red;'>Вы продали \"{$dress['name']}\" $kols за " . $allcost . " кр.</b>";
}
if (isset($_GET['set']) OR isset($_POST['set'])) {
$set = empty($_GET['set']) ?: $_GET['set'];
$set = empty($_POST['set']) ?: $_POST['set'];
if (!empty($_GET['buy'])) {
$count = isset($_GET['count']) && is_numeric($_GET['count']) ? $_GET['count'] : 0;
$count = isset($_POST['count']) && is_numeric($_POST['count']) ? $_POST['count'] : 0;
if ($count < 1) {
if (!empty($_GET['count']) AND is_numeric($_GET['count']) AND $_GET['count'] < 1) {
$count = 0;
$count_ok = 0;
} else $count_ok = 1;
$dress = db::c()->query('SELECT * FROM `shop` WHERE `id`=?i', $set)->fetch_assoc();
// db::c()->query('
// INSERT INTO `inventory` (
// name, maxdur, cost, img, goden, dategoden, massa, prototype, owner,
// nlevel, nsila, nlovk, ninta, nvinos, nintel, nmudra,
// nnoj, ntopor, ndubina, nmech, nalign, nfire, nwater, nair, nearth, nlight, ngray, ndark,
// minu, maxu,
// gsila, glovk, ginta, gintel, ghp, gfire, gwater, gair, gearth, glight, ggray, gdark,
// mfkrit, mfakrit, mfuvorot, mfauvorot,
// gnoj, gtopor, gdubina, gmech,
// bron1, bron2, bron3, bron4, magic, needident,
// gmp, gmeshok, artefact, encicl, koll)
// SELECT
// name, maxdur, cost, img, goden, dategoden, massa, id, ?i,
// nlevel, nsila, nlovk, ninta, nvinos, nintel, nmudra,
// nnoj, ntopor, ndubina, nmech, nalign, nfire, nwater, nair, nearth, nlight, ngray, ndark,
// minu, maxu,
// gsila, glovk, ginta, gintel, ghp, gfire, gwater, gair, gearth, glight, ggray, gdark,
// mfkrit, mfakrit, mfuvorot, mfauvorot,
// gnoj, gtopor, gdubina, gmech,
// bron1, bron2, bron3, bron4, magic, needident,
// gmp, gmeshok, artefact, encicl, koll
// FROM shop WHERE id = inventory.prototype;
//
// ', $user['id']);
if ($count_ok == 0) {
err('Неправильно введено количество.');
} elseif (($dress['massa'] * $count + $itemWeight['m']) > (get_meshok())) {
err('Недостаточно места в рюкзаке.');
} elseif ($count_ok == 1 && ($user['money'] >= ($dress['cost'] * $count)) && ($dress['count'] >= $count)) {
} elseif ($count_ok == 1 && ($user['money'] >= ($dress['cost'] * $count)) && (($dress['count'] >= $count) OR $dress['count'] == -1)) {
$newItem = [
'prototype' => $dress['id'],
@ -318,7 +289,7 @@ if (isset($_GET['set']) OR isset($_POST['set'])) {
for ($k = 1; $k <= $_GET['count']; $k++) {
db::c()->query('INSERT INTO `inventory` SET ?A[?i,?i,"?s",?i,?i,?i,"?s",?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,"?s",?i,?i,"?s",?i,?i]', $newItem);
db::c()->query('UPDATE `shop` SET `count` = `count` - ?i WHERE `id` =?i', $count, $set);
if ($dress['count'] != -1) db::c()->query('UPDATE `shop` SET `count` = `count` - ?i WHERE `id` = ?i', $count, $set);
echo "<b style='color: red'>Вы купили {$count} шт. \"{$dress['name']}\".</b>";
$user['money'] -= $count * $dress['cost'];
db::c()->query('UPDATE `users` set `money` = ?i WHERE `id` = ?i', $user['money'], $user['id']);
@ -507,7 +478,7 @@ switch ($shopCategoryTypeNumber) {
<td align=center style='width: 150px;'>
<img src="i/sh/<?= $row['img'] ?>" border=0>
<br>
<a href="shop.php?otdel=<?= $_GET['otdel'] ?>&set=<?= $row['id'] ?>&rnd=<?= mt_rand() ?>">купить</a>
<a href="shop.php?buy=<?= $row['id'] ?>&rnd=<?= mt_rand() ?>">купить</a>
<IMG SRC="i/up.gif" WIDTH=11 HEIGHT=11 BORDER=0 ALT="Купить несколько штук"
style="cursor:hand"
onclick="addCountItems('<?= $row['id'] ?>', '<?= $row['name'] ?>')">