game/modules_data/location/loto.php
2023-01-10 18:30:35 +02:00

543 lines
27 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
if(!defined('GAME'))
{
die();
}
session_start();
if($u->room['file']=='loto')
{
$titm = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vals` = "loto" ORDER BY `time` DESC LIMIT 1'));
if($_GET['get']=='20' && isset($titm['id']))
{
if ($u->info['money2']>5)
{
$u->info['money2'] = $u->info['money2'] - 5;
mysql_query('UPDATE `users` SET `money2`= `money2` - 5 WHERE `id` = "'.$u->info['id'].'"');
mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vals` = "loto"');
}
}
$titm = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vals` = "loto" AND `time` > '.(time()-24*60*60).' ORDER BY `time` DESC LIMIT 1'));
?>
<TABLE width="100%" cellspacing="0" cellpadding="0">
<tr><td valign="top" id="centerBlockLoto"><div align="center" class="pH3"><h1>Ежедневная Бесплатная Рулетка</h1></div>
<br />
<div id="winDiv">
<p class="testDiv">Ваш приз: <span id="win"></span></p>
<div id="imgWin"></div>
</div>
<div class="wraper">
<div class="arrowup"></div>
<div class="arrowdown"></div>
<div class="window">
<ul class="list"></ul>
</div>
</div>
<p style="text-align: center">
<?if ($titm==false){?><button class="buttonRuletka" onclick="(<?php echo json_encode($idve) ?>)" formmethod="get">Запустить игру!</button><?}
else
{?><button class="buttonRuletka" disabled onclick="(<?php echo json_encode($idve) ?>)" formmethod="get">Приходите Завтра!</button><?}?>
<button class="buttonsElements">Предметы и шансы</button>
<div id="tableItemChange" hidden>
<table>
<tr>
<th colspan="2">Предмет</th>
<!-- <th></th> -->
<th>Шанс выпадения</th>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/pot_base_200_alldmg2_p1k.gif"></td>
<td>Зелье Каменной Стойкости</td>
<td class="chanceItem">Частое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/pot_base_200_allmag2_p1k.gif"></td>
<td>Зелье Стража Магии</td>
<td>Частое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/pot_base_1000_str.gif"></td>
<td>Топливо для Големов</td>
<td>Частое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/pot_base_1000_dex.gif"></td>
<td>Смазка для Големов</td>
<td>Частое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/pot_base_1000_inst.gif"></td>
<td>Ускоритель для Големов</td>
<td>Частое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/voda112.gif"></td>
<td>Живая Вода</td>
<td>Частое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/otvar112.gif"></td>
<td>Отвар Когтей ПГ</td>
<td>Частое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/grib112.gif"></td>
<td>Сушеный Мухомор</td>
<td>Частое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/food_l11_e.gif"></td>
<td>Жёсткая Рыба</td>
<td class="chanceItem">Нормальное выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/food_l10_e.gif"></td>
<td>Яблоко Раздора</td>
<td>Нормальное выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/food_l5_eng.gif"></td>
<td>Бутерброд -The Best Friend-</td>
<td>Нормальное выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/ambosia_gora.gif"></td>
<td>Амброзия Скучающих Владык</td>
<td>Нормальное выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/poor.gif"></td>
<td>Плохое Железо</td>
<td>Нормальное выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/fine.gif"></td>
<td>Нормальное Железо</td>
<td>Нормальное выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/best.gif"></td>
<td>Хорошее Железо</td>
<td>Нормальное выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/invoke_plain_honor_attack_invul_any1.gif">
</td>
<td>Защита от Нападения [30]</td>
<td>Нормальное выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/joust_rew_s.gif"></td>
<td>Жетон Успеха</td>
<td class="chanceItem">Не частое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/ambosia_gora.gif"></td>
<td>Амброзия подмастерья Владык</td>
<td>Не частое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/jora10.gif"></td>
<td>Сумка Копателя Катакомб</td>
<td>Редкое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/jora9.gif"></td>
<td>Сумка Копателя Горы Легиона</td>
<td>Редкое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/jora7.gif"></td>
<td>Сумка Копателя Бездны</td>
<td>Редкое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/svitok1.png"></td>
<td>Свиток Репутации Горы Легиона</td>
<td>Редкое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/zolyaichko.gif"></td>
<td>Яйцо Дракона</td>
<td class="chanceItem">Очень редкое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/jora8.gif"></td>
<td>Сумка Защиты</td>
<td>Очень редкое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/svitok1.png"></td>
<td>Свиток Репутации Потерянного Входа</td>
<td>Очень редкое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/50ekkr.gif"></td>
<td>Чек на 50 Еврокредитов</td>
<td class="chanceItem">Невероятно редкое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/100ekkr.gif"></td>
<td>Чек на 100 Еврокредитов</td>
<td>Невероятно редкое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/lootbag_.gif"></td>
<td>Сумка Валлуара Великого</td>
<td>Невероятно редкое выпадение</td>
</tr>
<tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/jora101.gif"></td>
<td>Улучшенная Сумка Короля</td>
<td>Невероятно редкое выпадение</td>
</tr>
<td><img src="https://new-combats.com/img.new-combats.com/i/items/bag1291.gif"></td>
<td>Туманная Сумка</td>
<td>Невероятно редкое выпадение</td>
</table>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
var $ulImg = document.getElementsByClassName("list")[0]
var usedID = <?echo $u->info['id'];?>
var $arrLiImg = [
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/pot_base_200_alldmg2_p1k.gif" type="id0" title="Зелье Каменной Стойкости"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/pot_base_200_allmag2_p1k.gif" type="id1" title="Зелье Стража Магии"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/pot_base_1000_str.gif" type="id2" title="Топливо для Големов"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/pot_base_1000_dex.gif" type="id3" title="Смазка для Големов"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/pot_base_1000_inst.gif" type="id4" title="Ускоритель для Големов"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/food_l11_e.gif" type="id5" title="Жесткая Рыба"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/food_l10_e.gif" type="id6" title="Яблоко Раздора"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/food_l5_eng.gif" type="id7" title="Бутерброд -The Best Friend-"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/ambosia_gora.gif" type="id8" title="Амброзия подмастерья Владык"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/ambosia_gora.gif" type="id9" title="Амброзия Скучающих Владык"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/poor.gif" type="id10" title="Плохое Железо"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/fine.gif" type="id11" title="Нормальное Железо"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/best.gif" type="id12" title="Хорошее Железо"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/svitok1.png" type="id13" title="Свиток Репутации Потерянного Входа"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/joust_rew_s.gif" type="id14" title="Жетон Успеха"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/jora101.gif" type="id15" title="Улучшенная Сумка Короля"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/jora8.gif" type="id16" title="Сумка Защиты"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/jora10.gif" type="id17" title="Сумка Копателя Катакомб"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/jora9.gif" type="id18" title="Сумка Копателя Горы Легиона"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/jora7.gif" type="id19" title="Сумка Копателя Бездны"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/lootbag_.gif" type="id20" title="Сумка Валлуара Великого"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/bag1291.gif" type="id21" title="Туманная Сумка"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/50ekkr.gif" type="id22" title="Чек на 50 Еврокредитов"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/100ekkr.gif" type="id23" title="Чек на 100 Еврокредитов"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/zolyaichko.gif" type="id24" title="Яйцо Дракона"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/invoke_plain_honor_attack_invul_any1.gif" type="id25" title="Защита от Нападения [30]"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/svitok1.png" type="id26" title="Свиток Репутации Горы Легиона"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/voda112.gif" type="id27" title="Живая Вода"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/otvar112.gif" type="id28" title="Отвар Когтей ПГ"></li>',
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/grib112.gif" type="id29" title="Сушеный Мухомор"></li>'
]
function shuffle (array) {
var currentIndex = array.length, temporaryValue, randomIndex ;
while (0 !== currentIndex) {
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
temporaryValue = array[currentIndex];
array[currentIndex] = array[randomIndex];
array[randomIndex] = temporaryValue;
}
return array;
}
var $finallyLiImg = shuffle($arrLiImg)
for (let key of $finallyLiImg) {
var $htmlElementsMessage = new DOMParser().parseFromString(key, "text/html").getElementsByTagName("li")[0]
$ulImg.append($htmlElementsMessage)
}
var $button = document.getElementsByClassName("buttonRuletka")[0]
var $winWindow = document.getElementById("winDiv")
var $win = document.getElementById("win")
var $wrapper = document.getElementsByClassName("wraper")[0]
var $imgWin = document.getElementById("imgWin")
// $winWindow.style.top = `${$wrapper.offsetTop - 70}px`
// $winWindow.style.left = `${($wrapper.offsetWidth / 2) - 326}px`
$wrapper.style.marginTop = "110px"
$winWindow.hidden = true
var timeOutWin
$(document).ready(function () {
for (i = 0; i < 3; i++) {
$(".list li").clone().appendTo(".list");
}
$button.onclick = async function () {
$wrapper.style.marginTop = "110px"
if (timeOutWin) {
clearTimeout(timeOutWin)
$imgWin.innerHTML = ""
$winWindow.hidden = true
}
$imgWin.innerHTML = ""
$button.textContent = "Ожидание..."
$button.disabled = true
var response = await fetch("https://new-combats.com/lotowork.php", {
method: "POST",
body: usedID
})
$('.window').css({
right: "0"
})
$('.list li').css({
border: '4px solid transparent'
})
var textFromResponse = await response.text()
var resultRegexp = textFromResponse.match(/\b[0-9]{0,2}\b/);
var idItem = '';
if (resultRegexp && resultRegexp[0] && resultRegexp[0] >= 0 && resultRegexp[0] <= 29) {
idItem = resultRegexp[0];
} else {
return ($button.textContent = 'Ошибка, нажмите F5!');
}
var elemRul = 0
var $winImg
for (var i = 60; i < 90; i++) {
if ($('.list li:eq(' + i + ')')[0].children[0].getAttribute("type") === `id${idItem}`) {
elemRul = $('.list li:eq(' + i + ')')[0].children[0].offsetLeft
$winImg = $('.list li:eq(' + i + ')')[0]
}
}
$('.window').animate({
right: elemRul - 452.5
}, 10000, () => {
setTimeout( () => {
var idThing = $winImg.children[0].getAttribute("type")
var titleThing = $winImg.children[0].getAttribute("title")
$wrapper.style.marginTop = "0px"
$winWindow.hidden = false
$button.textContent = "Приходите завтра!"
$win.textContent = titleThing
var $img = document.createElement("img")
$img.src = $winImg.children[0].getAttribute("src")
$imgWin.append($img)
timeOutWin = setTimeout( () => {
$imgWin.innerHTML = ""
$winWindow.hidden = true
$wrapper.style.marginTop = "110px"
}, 10000)
}, 300)
})
// });
}
});
var $buttonsElements = document.getElementsByClassName("buttonsElements")[0]
var $tableItemChange = document.getElementById("tableItemChange")
$buttonsElements.onclick = function (event) {
var contentIsHidden = $tableItemChange.hidden;
$tableItemChange.hidden = !contentIsHidden;
event.target.textContent = !contentIsHidden ? 'Предметы и шансы' : 'Скрыть шансы';
}
</script>
<style>
#centerBlockLoto {
display: flex;
flex-direction: column;
}
* {
padding: 0;
margin: 0;
}
li {
list-style: none;
display: inline-block;
float: left;
}
#tableItemChange table {
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 14px;
text-align: center;
margin: auto;
}
#tableItemChange table td, th {
border-style: solid;
border-width: 1px;
border-collapse: collapse;
border-color: rgb(47, 1, 1);
padding: 3px 5px;
}
#tableItemChange table tr th {
font-size: 16px;
}
#tableItemChange {
text-align: center;
border: 1px solid #1a96bf;
width: 70%;
margin-left: auto;
margin-right: auto;
padding: 5px;
}
.buttonsElements {
font-size: 17px;
padding: 5px;
width: 200px;
border: 1px solid #1a96bf;
background: rgba(182, 114, 4, 0.3);
}
.window {
padding: 5px 0;
overflow: hidden;
position: relative;
width: 25000px;
height: 82px;
right: 0px;
}
.wraper {
position: relative;
margin: auto;
width: 982px;
overflow-x: hidden;
overflow-y: hidden;
border: 4px solid #1a96b7;
border-radius: 2px;
}
.list {
position: relative;
margin-left: 0;
display: inline-block;
}
.list li {
border: 4px solid transparent;
}
.list li img {
width: 75px;
height: 75px;
}
.arrowup {
position: absolute;
bottom: 0;
left: 487.5px;;
z-index: 1;
width: 0;
height: 0;
border-bottom: 20px solid #1a96bf;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
}
.arrowdown {
position: absolute;
top: 0;
left: 487.5px;;
z-index: 1;
width: 0;
height: 0;
border-top: 20px solid #1a96bf;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
}
.buttonRuletka {
font-size: 17px;
padding: 5px;
width: 200px;
border: 1px solid #1a96bf;
background: rgba(0, 149, 25, 0.33);
margin: 10px 0;
}
.buttonRuletka:hover, .buttonsElements:hover {
background: rgba(0, 102, 149, 0.33);
}
#winDiv {
text-align: center;
border-radius: 3px;
border: 1px solid #000;
width: auto;
margin: 10px auto 5px;
padding: 7px;
}
.testDiv {
font-size: 16px;
}
#win {
font-weight: 600;
}
</style>
<td width="50" valign="top">
<TABLE cellspacing="0" cellpadding="0"><TD width="100%">&nbsp;</TD><TD>
<table border="0" cellpadding="0" cellspacing="0">
<tr align="right" valign="top">
<td>
<!-- -->
<? echo $goLis; ?>
<!-- -->
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td nowrap="nowrap">
<tr>
<td bgcolor="#D3D3D3"><img src="https://img.new-combats.com/i/move/links.gif" width="9" height="7" /></td>
<td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.9&rnd=<? echo $code; ?>';" title="<? thisInfRm('1.180.0.9',1); ?>">Центральная площадь</a></td>
</tr>
<tr>
<td bgcolor="#D3D3D3"><img src="https://img.new-combats.com/i/move/links.gif" width="9" height="7" /></td>
<td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.449&rnd=<? echo $code; ?>';" title="<? thisInfRm('1.180.0.449',1); ?>">Платная Комната</a></td>
</td>
</tr>
</td>
</tr>
</table>
</td></table>
</td></table>
<br/>
</td>
</table>
<br>
<div id="textgo" style="visibility:hidden;"></div>
<?
}
?>