Merge remote-tracking branch 'origin/feature/priems' into dev
# Conflicts: # modules_data/_umenie.php
This commit is contained in:
+34
-48
@@ -2021,11 +2021,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;
|
||||
}
|
||||
@@ -2134,13 +2132,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" />';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2160,7 +2158,7 @@ class Priems
|
||||
}
|
||||
}
|
||||
if ($t == 1) {
|
||||
echo '<div style="width:230px;">' . $pr . '</div>';
|
||||
echo '<div>' . $pr . '</div>';
|
||||
} elseif ($t == 2) {
|
||||
return str_replace('"', '\\"', $pr);
|
||||
}
|
||||
@@ -2521,50 +2519,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)
|
||||
|
||||
Reference in New Issue
Block a user