340 lines
15 KiB
Plaintext
340 lines
15 KiB
Plaintext
<?php
|
|
if(!defined('GAME'))
|
|
{
|
|
die();
|
|
}
|
|
|
|
session_start();
|
|
|
|
if($u->room['file']=='loto')
|
|
{
|
|
if($_GET['get']=='20')
|
|
{
|
|
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" ORDER BY `time` DESC LIMIT 1'));
|
|
if($_GET['get']=='10' && $titm==false)
|
|
{
|
|
|
|
$droplist = array(
|
|
0=>4514,
|
|
1=>4515,
|
|
2=>4688,
|
|
3=>4689,
|
|
4=>4690,
|
|
5=>5009,
|
|
6=>5008,
|
|
7=>5010,
|
|
8=>5239,
|
|
9=>5069,
|
|
10=>10035,
|
|
11=>10036,
|
|
12=>10037,
|
|
13=>10008,
|
|
14=>10020,
|
|
15=>6112,
|
|
16=>6113,
|
|
17=>6114,
|
|
18=>6115,
|
|
19=>6116,
|
|
20=>6360,
|
|
21=>6462,
|
|
22=>5022,
|
|
23=>5023,
|
|
24=>6445,
|
|
25=>6455,
|
|
26=>10009,
|
|
27=>1032,
|
|
28=>1031,
|
|
29=>1034
|
|
);
|
|
$idve=$droplist[rand(0,count($droplist)-1)];
|
|
$u->addItem($idve,$u->info['id'],'|frompisher=1|nosale=1'.$u->info['login']);
|
|
$inf = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$idve.'" LIMIT 1'));
|
|
$titm = mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`) VALUES ("'.$u->info['id'].'","'.time().'","'.loto.'","'.$u->info['room'].'","'.$idve.'","'.mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']).'","loto")');
|
|
echo json_encode($idve); // òóò ïåðåäà÷à è ïîïûòêà çàïóñêà
|
|
}
|
|
|
|
|
|
?>
|
|
<TABLE width="100%" cellspacing="0" cellpadding="0">
|
|
<tr><td valign="top"><div align="center" class="pH3"><h3>Ëîòî Áîéöîâñêîãî Êëóáà</h3></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){?><a href="?get=10">Êðóòèòü</a> <?} else {?> <a href="?get=20">Îáíîâèòü</a> <?}?>
|
|
<!--
|
|
<button class="buttonRuletka" onclick="(<?php //echo json_encode($idve) ?>)" formmethod="get">Çàïóñòèòü èãðó!</button>
|
|
-->
|
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
|
<script>
|
|
|
|
|
|
var $ulImg = document.getElementsByClassName("list")[0]
|
|
|
|
var $arrLiImg = [
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/ambosia_gora.gif" type="id1" title="Àìáðîçèÿ ïîäìàñòåðüÿ Âëàäûê"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/bag1291.gif" type="id2" title="Òóìàííàÿ Ñóìêà"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/otvar112.gif" type="id3" title="Îòâàð Êîãòåé ÏÃ"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/best.gif" type="id4" title="Õîðîøåå Æåëåçî"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/100ekkr.gif" type="id5" title="×åê íà 100 Åâðîêðåäèòîâ"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/50ekkr.gif" type="id6" title="×åê íà 50 Åâðîêðåäèòîâ"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/fine.gif" type="id7" title="Íîðìàëüíîå Æåëåçî"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/food_l10_e.gif" type="id8" title="ßáëîêî Ðàçäîðà"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/food_l11_e.gif" type="id9" title="Æåñòêàÿ Ðûáà"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/food_l5_eng.gif" type="id10" title="Áóòåðáðîä -The Best Friend-"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/invoke_plain_honor_attack_invul_any1.gif" type="id11" title="Çàùèòà îò Íàïàäåíèÿ [30]"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/jora10.gif" type="id12" title="Ñóìêà Êîïàòåëÿ Êàòàêîìá"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/jora101.gif" type="id13" title="Óëó÷øåííàÿ Ñóìêà Êîðîëÿ"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/jora7.gif" type="id14" title="Ñóìêà Êîïàòåëÿ Áåçäíû"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/jora8.gif" type="id15" title="Ñóìêà Çàùèòû"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/jora9.gif" type="id16" title="Ñóìêà Êîïàòåëÿ Ãîðû Ëåãèîíà"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/joust_rew_s.gif" type="id17" title="Æåòîí Óñïåõà"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/grib112.gif" type="id18" title="Ñóøåíûé Ìóõîìîð"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/voda112.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/poor.gif" type="id21" title="Ïëîõîå Æåëåçî"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/pot_base_1000_dex.gif" type="id22" title="Ñìàçêà äëÿ Ãîëåìîâ"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/pot_base_1000_inst.gif" type="id23" title="Óñêîðèòåëü äëÿ Ãîëåìîâ"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/pot_base_1000_str.gif" type="id24" title="Òîïëèâî äëÿ Ãîëåìîâ"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/pot_base_200_alldmg2_p1k.gif" type="id25" title="Çåëüå Êàìåííîé Ñòîéêîñòè"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/pot_base_200_allmag2_p1k.gif" type="id6" title="Çåëüå Ñòðàæà Ìàãèè"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/svitok1.png" type="id27" title="Ñâèòîê Ðåïóòàöèè Ïîòåðÿííîãî Âõîäà"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/svitok1.png" type="id28" title="Ñâèòîê Ðåïóòàöèè Ãîðû Ëåãèîíà"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/zolyaichko.gif" type="id29" title="ßéöî Äðàêîíà"></li>',
|
|
'<li><img src="https://new-combats.com/img.new-combats.com/i/items/ambosia_gora.gif" type="id30" 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}px`
|
|
$winWindow.style.left = `${($wrapper.offsetWidth / 2) - 326}px`
|
|
|
|
$winWindow.hidden = true
|
|
|
|
var timeOutWin
|
|
|
|
$(document).ready(function () {
|
|
for (i = 0; i < 3; i++) {
|
|
$(".list li").clone().appendTo(".list");
|
|
}
|
|
$button.onclick = () => {
|
|
|
|
if (timeOutWin) {
|
|
clearTimeout(timeOutWin)
|
|
$imgWin.innerHTML = ""
|
|
$winWindow.hidden = true
|
|
}
|
|
// console.log(timeOutWin)
|
|
$imgWin.innerHTML = ""
|
|
$button.textContent = "Îæèäàíèå..."
|
|
$button.disabled = true
|
|
|
|
$('.window').css({
|
|
right: "0"
|
|
})
|
|
$('.list li').css({
|
|
border: '4px solid transparent'
|
|
})
|
|
|
|
function selfRandom(min, max) {
|
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
}
|
|
|
|
var x = selfRandom(50, 100);
|
|
|
|
$('.window').animate({
|
|
right: ((x * 75) + (x * 8 - 12) - 435)
|
|
}, 1500, () => {
|
|
|
|
var $winImg = $('.list li:eq(' + x + ')')[0]
|
|
// console.log($winImg.children[0].getAttribute("src"))
|
|
|
|
setTimeout( () => {
|
|
|
|
var idThing = $winImg.children[0].getAttribute("type")
|
|
var titleThing = $winImg.children[0].getAttribute("title")
|
|
$button.disabled = false
|
|
$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
|
|
}, 10000)
|
|
}, 300)
|
|
})
|
|
// });
|
|
}
|
|
});
|
|
</script>
|
|
<style>
|
|
* {
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
|
|
li {
|
|
list-style: none;
|
|
display: inline-block;
|
|
float: left;
|
|
}
|
|
|
|
.window {
|
|
padding: 5px 0;
|
|
overflow: hidden;
|
|
position: relative;
|
|
width: 25000px;
|
|
height: 82px;
|
|
right: 0px;
|
|
}
|
|
|
|
.wraper {
|
|
position: relative;
|
|
margin: auto;
|
|
margin-top: 180px;
|
|
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: 485px;
|
|
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: 485px;
|
|
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: 150px;
|
|
border: 1px solid #1a96bf;
|
|
margin: 10px 0;
|
|
}
|
|
.buttonRuletka:hover {
|
|
background: rgba(0, 102, 149, 0.33);
|
|
}
|
|
#winDiv {
|
|
border: 1px solid #1a96bf;
|
|
border-radius: 3px;
|
|
position: fixed;
|
|
text-align: center;
|
|
width: 500px;
|
|
/* margin-left: auto;
|
|
margin-right: auto; */
|
|
padding: 7px;
|
|
}
|
|
.testDiv {
|
|
font-size: 16px;
|
|
}
|
|
#win {
|
|
font-weight: 600;
|
|
}
|
|
|
|
</style>
|
|
<td width="50" valign="top">
|
|
<TABLE cellspacing="0" cellpadding="0"><TD width="100%"> </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>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td></table>
|
|
</td></table>
|
|
<div><br />
|
|
</div></td>
|
|
</table>
|
|
<br>
|
|
<div id="textgo" style="visibility:hidden;"></div>
|
|
<?
|
|
}
|
|
?> |