2023-03-31 18:42:06 +00:00
< ? php
2023-04-15 19:18:30 +00:00
use Core\Config ;
use Core\Db ;
echo "
< script >
var elem = document . getElementById ( 'se-pre-con' );
elem . parentNode . removeChild ( elem );
</ script >
" ;
if ( ! defined ( 'GAME' )) {
die ();
2022-06-06 21:30:34 +00:00
}
2023-04-15 19:18:30 +00:00
/** @var User $u */
if (
$u -> info [ 'room' ] == 214 ||
$u -> info [ 'room' ] == 217 ||
$u -> info [ 'room' ] == 218 ||
$u -> info [ 'room' ] == 219 ||
$u -> info [ 'battle' ] > 0
) {
header ( 'Location:main.php' );
die ();
2022-06-06 21:30:34 +00:00
}
2023-04-15 19:18:30 +00:00
$currentEffectList = '' ;
$effNow = Db :: getColumn (
'select img from eff_main where id2 in (select id_eff from eff_users where uid = ? and `delete` = 0)' ,
[ $u -> info [ 'id' ]]
);
foreach ( $effNow as $eff ) {
2023-06-11 11:45:36 +00:00
$img = Config :: img () . '/i/eff/' . $eff ;
$currentEffectList .= " <img src=' $img ' alt=' $eff '> " ;
2022-06-06 21:30:34 +00:00
}
2023-03-31 18:30:14 +00:00
2023-04-15 19:18:30 +00:00
function useItem ( $int ) : string
{
global $u ;
global $magic ;
$items = [
1 => [ 'cost' => 10 , 'id' => 4941 , 'name' => 'Защита от магии' ,],
[ 'cost' => 10 , 'id' => 4942 , 'name' => 'Магическое усиление' ,],
[ 'cost' => 10 , 'id' => 994 , 'name' => 'Сокрушение' ,],
[ 'cost' => 10 , 'id' => 1001 , 'name' => 'Защита от оружия' ,],
[ 'cost' => 10 , 'id' => 1460 , 'name' => 'Холодный разум' ,],
[ 'cost' => 12.50 , 'id' => 3102 , 'name' => 'Жажда Жизни +5' ,],
[ 'cost' => 1 , 'id' => 2418 , 'name' => 'Эликсир Восстановления' ,],
[ 'cost' => 1 , 'id' => 3140 , 'name' => 'Эликсир потока' ,],
[ 'cost' => 5 , 'id' => 4736 , 'name' => 'Эликсир Жизни' ,],
[ 'cost' => 5 , 'id' => 4737 , 'name' => 'Эликсир Маны' ,],
[ 'cost' => 10 , 'id' => 870 , 'name' => 'Зелье Могущества' ,],
[ 'cost' => 10 , 'id' => 872 , 'name' => 'Зелье Стремительности' ,],
[ 'cost' => 10 , 'id' => 871 , 'name' => 'Зелье Прозрения' ,],
[ 'cost' => 10 , 'id' => 873 , 'name' => 'Зелье Разума' ,],
[ 'cost' => 25 , 'id' => 2139 , 'name' => 'Нектар Неуязвимости' ,],
[ 'cost' => 25 , 'id' => 2140 , 'name' => 'Нектар Отрицания' ,],
17 => [ 'cost' => 0.5 , 'id' => 3101 , 'name' => 'Жажда Жизни +6' ,], // екровещи
[ 'cost' => 0.99 , 'id' => 1463 , 'name' => 'Звездное Сияние' ,],
[ 'cost' => 0.4 , 'id' => 4037 , 'name' => 'Нектар Великана' ,],
[ 'cost' => 0.4 , 'id' => 4040 , 'name' => 'Нектар Змеи' ,],
[ 'cost' => 0.4 , 'id' => 4038 , 'name' => 'Нектар Предчувствия' ,],
[ 'cost' => 0.4 , 'id' => 4039 , 'name' => 'Нектар Разума' ,],
[ 'cost' => 2.99 , 'id' => 5110 , 'name' => 'Эликсир Магического Искусства' ,],
[ 'cost' => 2.99 , 'id' => 5109 , 'name' => 'Снадобье Забытых Мастеров' ,],
[ 'cost' => 4.99 , 'id' => 5069 , 'name' => 'Амброзия Скучающих Владык' ,],
30 => [ 'cost' => 1 , 'id' => 6455 , 'name' => 'Защита от нападения [30]' ,],
];
$moneyType = 'money' ;
if ( $int > 16 ) {
$moneyType = 'money2' ;
}
if ( $u -> info [ $moneyType ] < $items [ $int ][ 'cost' ]) {
return 'Недостаточно денег!' ;
}
2023-04-15 23:54:34 +00:00
$additm = \User\ItemsModel :: addItem ( $items [ $int ][ 'id' ], $u -> info [ 'id' ]);
2023-04-15 19:18:30 +00:00
if ( empty ( $additm )) {
return 'Что-то пошло не так, каст не сработал...' ;
}
$u -> info [ $moneyType ] -= $items [ $int ][ 'cost' ];
$magic -> useItems ( $additm );
$query = " update users set $moneyType = ? where id = ? " ;
Db :: sql ( $query , [ $u -> info [ 'money' ], $u -> info [ 'id' ]]);
Db :: sql ( 'delete from items_users where id = ?' , [ $additm ]);
return 'Вы использовали "' . $items [ $int ][ 'name' ] . '".' ;
}
$msg = '' ;
if ( isset ( $_GET [ '1' ])) {
$msg = useItem ( 1 );
} elseif ( isset ( $_GET [ '2' ])) {
$msg = useItem ( 2 );
} elseif ( isset ( $_GET [ '3' ])) {
$msg = useItem ( 3 );
} elseif ( isset ( $_GET [ '4' ])) {
$msg = useItem ( 4 );
} elseif ( isset ( $_GET [ '5' ])) {
$msg = useItem ( 5 );
} elseif ( isset ( $_GET [ '6' ])) {
$msg = useItem ( 6 );
} elseif ( isset ( $_GET [ '7' ])) {
$msg = useItem ( 7 );
} elseif ( isset ( $_GET [ '8' ])) {
$msg = useItem ( 8 );
} elseif ( isset ( $_GET [ '9' ])) {
$msg = useItem ( 9 );
} elseif ( isset ( $_GET [ '10' ])) {
$msg = useItem ( 10 );
} elseif ( isset ( $_GET [ '11' ])) {
$msg = useItem ( 11 );
} elseif ( isset ( $_GET [ '12' ])) {
$msg = useItem ( 12 );
} elseif ( isset ( $_GET [ '13' ])) {
$msg = useItem ( 13 );
} elseif ( isset ( $_GET [ '14' ])) {
$msg = useItem ( 14 );
} elseif ( isset ( $_GET [ '15' ])) {
$msg = useItem ( 15 );
} elseif ( isset ( $_GET [ '16' ])) {
$msg = useItem ( 16 );
} elseif ( isset ( $_GET [ '17' ])) {
$msg = useItem ( 17 );
} elseif ( isset ( $_GET [ '18' ])) {
$msg = useItem ( 18 );
} elseif ( isset ( $_GET [ '19' ])) {
$msg = useItem ( 19 );
} elseif ( isset ( $_GET [ '20' ])) {
$msg = useItem ( 20 );
} elseif ( isset ( $_GET [ '21' ])) {
$msg = useItem ( 21 );
} elseif ( isset ( $_GET [ '22' ])) {
$msg = useItem ( 22 );
} elseif ( isset ( $_GET [ '23' ])) {
$msg = useItem ( 23 );
} elseif ( isset ( $_GET [ '24' ])) {
$msg = useItem ( 24 );
} elseif ( isset ( $_GET [ '25' ])) {
$msg = useItem ( 25 );
} elseif ( isset ( $_GET [ '30' ])) {
$msg = useItem ( 30 );
}
2023-03-31 18:30:14 +00:00
2022-06-06 21:30:34 +00:00
?>
2023-04-15 19:18:30 +00:00
< style >
fieldset {
border : 1 px solid black ;
- webkit - border - radius : 50 px ;
- moz - border - radius : 50 px ;
border - radius : 50 px ;
}
. red {
color : red ;
}
. green {
color : green ;
}
. ac {
text - align : center ;
}
</ style >
< ? php if ( $msg ) {
echo " <b class='red'> $msg </b><br> " ;
} ?>
< h3 > Купить временные усиления </ h3 >
< div class = " ac " >
< b > Деньги : < span class = " green " >< ? = $u -> info [ 'money' ] ?> </span> кр. |
< span class = " green " >< ? = $u -> info [ 'money2' ] ?> </span> екр.</b><br>
< ? php if ( $currentEffectList ) {
echo 'Текущие эффекты:<br>' . $currentEffectList ;
} ?>
< br >
< input class = " btn btn-success " onClick = " location.href='/main.php?add_eff'; " type = " button " value = " Обновить " >
< input class = " btn btn-success " onClick = " location.href='/main.php'; " type = " button " value = " Вернуться " >< br >< br >
< fieldset >
< h3 > Усиления за кредиты :</ h3 >
< img onclick = " location.href='/main.php?add_eff&1'; "
onMouseOver = " top.hi(this, \ '<b>Защита от магии<hr>Цена: 10 кредитов<hr>Увеличивает защиту от магии на 100 едениц, продолжительностью 3 часа.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/magearmor.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&2'; "
onMouseOver = " top.hi(this, \ '<b>Магическое усиление<hr>Цена: 10 кредитов<hr>Увеличивает мощность магии на 25 единиц, продолжительностью 3 часа.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/invoke_spell_godintel100.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&3'; "
onMouseOver = " top.hi(this, \ '<b>Сокрушение<hr>Цена: 10 кредитов<hr>Увеличивает мощность урона на 25 единиц, продолжительностью 1 часа.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/spell_powerup10.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&4'; "
onMouseOver = " top.hi(this, \ '<b>Защита от оружия<hr>Цена: 10 кредитов<hr>Увеличивает защиту от урона на 100 едениц, продолжительностью 3 часа.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/spell_protect10.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&5'; "
onMouseOver = " top.hi(this, \ '<b>Холодный Разум<hr>Цена: 10 кредитов<hr>Увеличивает Интелект продолжительностью 3 часа.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/spell_stat_intel.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&6'; "
onMouseOver = " top.hi(this, \ '<b>Жажда Жизни +5<hr>Цена: 10 кредитов<hr>Увеличивает колличество жизней продолжительностью 6 часов.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/spell_powerHPup5.gif " alt = " " >
< br >< br >
< img onclick = " location.href='/main.php?add_eff&9'; "
onMouseOver = " top.hi(this, \ '<b>Эликсир Жизни<hr>Цена: 5 кредитов.<hr>Мгновенно восстанавливает 500 жизней.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/pot_cureHP250_20.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&10'; "
onMouseOver = " top.hi(this, \ '<b>Эликсир Маны<hr>Цена: 5 кредитов.<hr>Мгновенно восстанавливает 1000 маны.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/pot_curemana500_20.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&11'; "
onMouseOver = " top.hi(this, \ '<b>Зелье Могущества<hr>Цена: 10 кредитов<hr>Добавит игроку 10 силы на 6 часов.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/pot_base_50_str.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&12'; "
onMouseOver = " top.hi(this, \ '<b>Зелье Стремительности<hr>Цена: 10 кредитов<hr>Добавит игроку 10 ловкости на 6 часов.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/pot_base_50_dex.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&13'; "
onMouseOver = " top.hi(this, \ '<b>Зелье Прозрения<hr>Цена: 10 кредитов<hr>Добавит игроку 10 интуиции на 6 часов.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/pot_base_50_inst.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&14'; "
onMouseOver = " top.hi(this, \ '<b>Зелье Разума<hr>Цена: 10 кредитов<hr>Добавит игроку 10 интеллекта на 6 часов.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/pot_base_50_intel.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&15'; "
onMouseOver = " top.hi(this, \ '<b>Нектар Неуязвимости<hr>Цена: 25 кредитов<hr>Добавит игроку 160 защиты от урона на 3 часа.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/pot_base_200_alldmg3.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&16'; "
onMouseOver = " top.hi(this, \ '<b>Нектар Отрицания<hr>Цена: 25 кредитов<hr>Добавит игроку 160 защиты от магии на 3 часа.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/pot_base_200_allmag3.gif " alt = " " >
< hr >
< h3 > Усиления за Е К Р :</ h3 >
< img onclick = " location.href='/main.php?add_eff&17'; "
onMouseOver = " top.hi(this, \ '<b>Жажда Жизни +6<hr><font color=green>Цена: 0.5 Е К Р </font><hr>Увеличивает колличество жизней продолжительностью 6 часов.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/spell_powerHPup6.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&30'; "
onMouseOver = " top.hi(this, \ '<b>Защита от нападения<hr><font color=green>Цена: 1 Е К Р </font><hr>Защитит В а с от любых нападений на протяжении 5 минут.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/eff/wis_light_shield.gif " alt = " " >
< br >< br >
< img onclick = " location.href='/main.php?add_eff&19'; "
onMouseOver = " top.hi(this, \ '<b>Нектар Великана<hr><font color=green>Цена: 0.4 Е К Р </font><hr>Продолжительность действия: 6 ч.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/pot_base_50_str2.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&20'; "
onMouseOver = " top.hi(this, \ '<b>Нектар Змеи<hr><font color=green>Цена: 0.4 Е К Р </font><hr>Продолжительность действия: 6 ч.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/pot_base_50_dex2.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&21'; "
onMouseOver = " top.hi(this, \ '<b>Нектар Предчувствия<hr><font color=green>Цена: 0.4 Е К Р </font><hr>Продолжительность действия: 6 ч.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/pot_base_50_inst2.gif " alt = " " >
< img onclick = " location.href='/main.php?add_eff&22'; "
onMouseOver = " top.hi(this, \ '<b>Нектар Разума<hr><font color=green>Цена: 0.4 Е К Р </font><hr>Продолжительность действия: 6 ч.</b> \ ',event,2,0,1,1, \ 'max-width:307px \ ') "
onMouseOut = " top.hic(); " onMouseDown = " top.hic(); " class = " cp "
src = " //img.new-combats.tech/i/items/pot_base_50_intel2.gif " alt = " " >
</ fieldset >
</ div >