Файл: public_html/modules/skills/info.php
Строк: 61
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
include_once($root . '/core/base.php');
falseauth();
$header = "Навык";
include_once($root . '/core/head.php');
$skill = fl($_GET['skill']);
$names = [null, 'Исцеление', 'Разряд '];
$ids = [null, 'heal_skill', 'arrow_skill'];
$heal_percent = ceil(get_health($u['id'])*0.1);
$hh_percent = ceil(get_health($u['id'])*0.01);
$heal_bonus = $heal_percent+($hh_percent*(($u[$ids[$skill]] == 1) ? 0 : ($u[$ids[$skill]]-1)));
$arrow_percent = ceil(get_power($u['id'])*0.03);
$arrow_bonus = (get_power($u['id'])*2)+($arrow_percent*(($u[$ids[$skill]] == 1) ? 0 : ($u[$ids[$skill]]-1)));
$description = [null, 'Исцеляет до '.$heal_bonus.' здоровья', 'Наносит до '.$arrow_bonus.' урона'];
$desc_main = [null, ' Исцеление: '
.$heal_bonus.''.
($u[$ids[$skill]] < 30 ? '<font color="lime"><small> +'.$hh_percent.'</small></font>' : ''), ' Урон: '.$arrow_bonus.''.($u[$ids[$skill]] < 30 ? '<font color="lime"><small> +'.$arrow_percent.'</font></small>' : '')];
$levels_cost = [2 => ['cost' => 200, 'curr' => 'silver'], 3 => ['cost' => 500, 'curr' => 'silver'], 4 => ['cost' => 10, 'curr' => 'gold'], 5 => ['cost' => 1000, 'curr' => 'silver'], 6 => ['cost' => 2000, 'curr' => 'silver'], 7 => ['cost' => 25, 'curr' => 'gold'], 8 => ['cost' => 3500, 'curr' => 'silver'], 9 => ['cost' => 5000, 'curr' => 'silver'], 10 => ['cost' => 50, 'curr' => 'gold'], 11 => ['cost' => 7500, 'curr' => 'silver'], 12 => ['cost' => 10000, 'curr' => 'silver'], 13 => ['cost' => 100, 'curr' => 'gold'], 14 => ['cost' => 20000, 'curr' => 'silver'], 15 => ['cost' => 30000, 'curr' => 'silver'], 16 => ['cost' => 250, 'curr' => 'gold'], 17 => ['cost' => 500000, 'curr' => 'silver'], 18 => ['cost' => 75000, 'curr' => 'silver'], 19 => ['cost' => 500, 'curr' => 'gold'], 20 => ['cost' => 900000, 'curr' => 'silver'], 21 => ['cost' => 700, 'curr' => 'gold'], 22 => ['cost' => 120000, 'curr' => 'silver'], 23 => ['cost' => 150000, 'curr' => 'silver'], 24 => ['cost' => 1000, 'curr' => 'gold'], 25 => ['cost' => 250000, 'curr' => 'silver'], 26 => ['cost' => 350000, 'curr' => 'silver'], 27 => ['cost' => 1500, 'curr' => 'gold'], 28 => ['cost' => 500000, 'curr' => 'silver'], 29 => ['cost' => 750000, 'curr' => 'silver'], 30 => ['cost' => 1500, 'curr' => 'gold']];
$currs = ['silver' => ' серебра', 'gold' => ' гемов'];
if(isset($_GET['up']))
{
if(!in_array($skill,[1,2])) redirect('/skills');
if($u[$levels_cost[$u[$ids[$skill]]+1]['curr']] < $levels_cost[$u[$ids[$skill]]+1]['cost']) redirect('/skills/'
.$skill, 'Недостаточно'.$currs[$levels_cost[$u[$ids[$skill]]+1]['curr']]);
if($u[$ids[$skill]] >= 30) redirect('/skills', 'Уровень навыка максимальный!');
$db->query("UPDATE `users` SET `".$ids[$skill]."` = `".$ids[$skill]."` + '1', `"
.$levels_cost[$u[$ids[$skill]]+1]['curr']."` = `".$levels_cost[$u[$ids[$skill]]+1]['curr']."` - '".$levels_cost[$u[$ids[$skill]]+1]['cost']."' WHERE `id` = '".$u['id']."'");
redirect('/skills/'.$skill, 'Навык улучшен!');
}
echo '<div class="notice_container"><div class = "gborder notice_alert alert-success">'.$names[$skill].' ('.$u[$ids[$skill]].' ур. из 30)</div></div>';
echo '
<div class="b">
<table width="100%">
<tr>
<td width="50px" valign="top">
<img width="50px" src="/images/skills/'.$skill.'.png">
</td>
<td valign="top">
<font color="white"><big>'.$desc_main[$skill].'</big></font></br>
<small><font color = "white">'.$description[$skill].'</font></small>
</td>
</tr>
</table> </br>
'.($u[$ids[$skill]] < 30 ? '<center><a href="/skills/'.$skill.'/up">
<input type="submit" value="Улучшить за '.$levels_cost[$u[$ids[$skill]]+1]['cost'].''.$currs[$levels_cost[$u[$ids[$skill]]+1]['curr']].'"></a></center>' : '').'
</div>';
if($skill == 1) echo '<div class="notice_container"><div class = "gborder notice_alert alert-success"> Исцеление - это навык который срабатывает только в подземелье, при взаимодействии с этим навыком у вас есть возможность восстановить свое здоровье.</div></div>';
else echo '<div class="notice_container"><div class = "gborder notice_alert alert-success"> Разряд - это навык, который дает дополнительный урон, в зависимости от уровня этого навыка.</div></div>';
echo '<center><a class="link" href="/skills">Вернуться к навыкам</a></center>';
include_once($root . '/core/foot.php');