game/modules_data/location/loto.php
2022-06-07 00:30:34 +03:00

551 lines
26 KiB
PHP

<?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 idItem = await response.text()
idItem = idItem.match(/\b[0-9]{0,2}\b/)
if (idItem[0]) {
// Åñëè àéäèøíèê íå ðàâåí â äèàïàçîíå îò 0 äî 29
if (idItem[0] > 29) {
return $button.textContent = "Îøèáêà, íàæìèòå F5!"
}
idItem = idItem[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) {
if ($tableItemChange.hidden) {
$tableItemChange.hidden = !$tableItemChange.hidden
event.target.textContent = "Ñêðûòü øàíñû"
return
}
$tableItemChange.hidden = !$tableItemChange.hidden
event.target.textContent = "Ïðåäìåòû è øàíñû"
}
</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>
<?
}
?>