Изменил отображение приёмов

This commit is contained in:
2023-01-23 07:33:19 +01:00
parent d9ec810f7f
commit 1fbd8d6de2
6 changed files with 239 additions and 116 deletions
+33 -47
View File
@@ -2020,11 +2020,9 @@ class Priems
public function uns($id)
{
global $u, $c, $code;
$pl = mysql_fetch_assoc(
mysql_query(
'SELECT * FROM `priems` WHERE `level`<="' . $this->u->info['level'] . '" AND `activ` > "0" AND `id` = "' . $id . '" LIMIT 1'
)
);
$pl = $this->getTechniquesInfo($id);
if (!isset($pl['id']) || $this->testpriem($pl, 1) != 0) {
return;
}
@@ -2129,13 +2127,13 @@ class Priems
$cli2 = ' class="nopriemuse" ';
}
$pr .= '<a onMouseOver="top.hi(this,\'<b>' . $pl['name'] . '</b><Br>' . $lvar . '\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" ' . $cl . '><img ' . $cli2 . ' style="margin-top:3px; ' . $cl2 . ' margin-left:4px;" src="https://img.new-combats.com/i/eff/' . $pl['img'] . '.gif" width="40" height="25" /></a>';
$pr .= '<a onMouseOver="top.hi(this,\'<b>' . $pl['name'] . '</b><Br>' . $lvar . '\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" ' . $cl . '><img ' . $cli2 . ' style="margin-top:3px; ' . $cl2 . ' margin-left:4px;" src="https://img.new-combats.com/i/eff/' . $pl['img'] . '.gif" width="55" height="35" /></a>';
} else {
if (isset($_GET['inv'])) {
$pr .= '<a title="Перейти к настройкам приемов" href="javascript:void(0)" onclick="location.href=\'main.php?all=' . ((int)$_GET['all']) . '&skills=1&rz=4&p_raz=all\'"><img style="margin-top:4px; margin-left:4px;" src="https://img.new-combats.com/i/items/w/clearPriem.gif" width="40" height="25" /></a>';
$pr .= '<a title="Перейти к настройкам приемов" href="javascript:void(0)" onclick="location.href=\'main.php?all=' . ((int)$_GET['all']) . '&skills=1&rz=4&p_raz=all\'"><img style="margin-top:4px; margin-left:4px;" src="https://img.new-combats.com/i/items/w/clearPriem.gif" width="55" height="35" /></a>';
} else {
$pr .= '<img style="margin-top:4px; margin-left:4px;" src="https://img.new-combats.com/i/items/w/clearPriem.gif" width="40" height="25" />';
$pr .= '<img style="margin-top:4px; margin-left:4px;" src="https://img.new-combats.com/i/items/w/clearPriem.gif" width="55" height="35" />';
}
}
@@ -2516,50 +2514,38 @@ class Priems
return $r;
}
//выводим все доступные приемы игроку на его уровне - 1, выводим все доступные приемы только игроку - 2
public function seePriems($mt)
public function getTechniquesInfo(?int $id = null): array
{
global $code;
$t = $this->u->items['tr'];
$nm = [1 => 'hit', 2 => 'krit', 3 => 'counter', 4 => 'block', 5 => 'parry', 6 => 'hp', 7 => 'spirit'];
$lvlfe = $this->u->info['level'];
if (isset($_GET['all'])) {
$lvlfe = 21;
if(isset($id)) {
return Db::getRow('SELECT * FROM techniques_categories LEFT JOIN priems ON techniques_categories.technique_id = priems.id
WHERE priems.level <= ? AND priems.activ > 0 AND priems.id = ? ORDER BY priems.img,priems.level', [User::start()->info['level'], $id]);
}
$sp = mysql_query(
'SELECT * FROM `priems` WHERE `level`<="' . $lvlfe . '" AND `activ` > "0" ORDER BY `img`,`level` ASC'
);
$this->u->info['lvl'] = $this->u->info['level'];
$lvar = '';
while ($pl = mysql_fetch_assoc($sp)) {
$noaki = 0;
if ($pl['activ'] == 1 || $this->testActiv($pl['activ']) == 1) {
$lvar = $this->priemInfo($pl, 1);
$lvar = $lvar[0];
$cl = '';
$a1 = '<a href="javascript:void(0)" onclick="location.href=\'main.php?skills=1&all=' . ((int)$_GET['all']) . '&rz=4&use_priem=' . $pl['id'] . '&rnd=' . $code . '&p_raz=\' + p_raz;">';
$a2 = '</a>';
if ($this->pyes($pl['id']) || $this->testpriem($pl, 1) > 0) {
if ((isset($_GET['all']) && $_GET['all'] == 1) || $this->pyes($pl['id'])) {
$cl = 'filter: alpha(opacity=35); -moz-opacity: 0.35; -khtml-opacity: 0.35; opacity: 0.35;';
$a1 = '';
$a2 = '';
} else {
$noaki = 1;
}
}
if ($noaki == 0) {
$mtnu = explode('_', $pl['img']);
if ($mtnu[0] != 'wis') {
$mtnu = $mtnu[0];
} else {
$mtnu = 'wis_' . $mtnu[1];
}
echo $a1 . '<img class="pwq' . $mtnu . ' pwqall" onMouseOver="top.hi(this,\'(#' . $pl['id'] . ') <b>' . $pl['name'] . '</b><Br>' . $lvar . '\',event,3,0,1,1,\'width:240px\');" onMouseOut="top.hic();" onMouseDown="top.hic();" style="margin-top:2px; ' . $cl . ' margin-left:1px;" src="https://img.new-combats.com/i/eff/' . $pl['img'] . '.gif" width="40" height="25" />' . $a2;
}
return Db::getRows('SELECT * FROM techniques_categories LEFT JOIN priems ON techniques_categories.technique_id = priems.id
WHERE priems.level <= ? AND priems.activ > 0 ORDER BY priems.img,priems.level', [User::start()->info['level']]);
}
public function getByCategory(?int $category_id = null)
{
$priems = $this->getTechniquesInfo();
$cl = '';
foreach ($priems as $priem) {
if ($this->pyes($priem['id']) || $this->testpriem($priem, 1) > 0) {
$cl = 'filter: alpha(opacity=35); -moz-opacity: 0.35; -khtml-opacity: 0.35; opacity: 0.35;';
}
echo
<<< HTML
<a href="javascript:void(0)" onclick="location.href='main.php?skills=1&rz=4&use_priem=$priem[id]';">
<img class="pwq$priem[category_id] pwqall" onMouseOver="top.popup(this, '(#$priem[id]) <b>$priem[name]</b><Br>{$this->priemInfo($priem, 1)[0]}');" onMouseOut="top.hic();" onMouseDown="top.hic();" style="display:none;margin-top:2px; $cl margin-left:1px;" src="https://img.new-combats.com/i/eff/$priem[img].gif" width="40" height="25" />
</a>
HTML;
}
}
private function zeromax($num, $max)