Файл: sumerki.mobi/sumerki.mobi/scroll.php
Строк: 264
<?
//////////////////////////////////////////////////////////////
//////////////////////Онлайн игра "Сумерки"///////////////////
//////////////////////Основатель: Mc Laren////////////////////
///////////////////Контакты: ICQ - 597687549//////////////////
/////////////////////Пример: Sumerki.Mobi/////////////////////
///////////Если ты это читаешь, значит скрипт слили :D////////
//////////////////////////////////////////////////////////////
define('PROTECTOR', 1);
$headmod = 'scroll';//фикс. места
$textl='Инвентарь';
include('files/path.php');
include('files/gzips.php');
include($path.'files/db.php');
include($path.'files/auth.php');
include($path.'files/func.php');
going();
include($path.'files/core.php');
include($path.'files/head.php');
include($path.'files/zag.php');
$req = mysql_query("SELECT * FROM `res` WHERE `usr` = '$log' and `id`='".mysql_real_escape_string($_GET['id'])."'");
$avto=mysql_num_rows($req);
if($avto==0){
echo '<div class="zagolovok"><div class="zagolovok1"> <div class="zagolovok2"><div class="zagolovok_right"></div><div class="zagolovok_left"></div><div class="ch_name">Стоп!</div><div class="clearFix"></div></div></div></div>';
echo '<div class="fon bg"><div class="bg1"><div class="bg2"><div class="bg3"><div class="bg4"><div class="bg5"><div class="bg6"><div class="bg7"><div class="bg8">';
echo"Ошибка! Такого свитка нет!<br/>";
echo '</div></div></div></div></div></div></div></div></div>';
include($path.'files/down.php');
include($path.'files/meny.php');
exit;
}
$mag = mysql_fetch_array($req);
if($mag[tip]!='scroll'){
echo '<div class="zagolovok"><div class="zagolovok1"> <div class="zagolovok2"><div class="zagolovok_right"></div><div class="zagolovok_left"></div><div class="ch_name">Стоп!</div><div class="clearFix"></div></div></div></div>';
echo '<div class="fon bg"><div class="bg1"><div class="bg2"><div class="bg3"><div class="bg4"><div class="bg5"><div class="bg6"><div class="bg7"><div class="bg8">';
echo"Ошибка! Доступ закрыт!<br/>";
echo '</div></div></div></div></div></div></div></div></div>';
include($path.'files/down.php');
include($path.'files/meny.php');
exit;
}
switch($mag[what]){
case 'scroll_weapon':
$req = mysql_query("SELECT * FROM `item` WHERE `usr` = '$log' and `tip`='weapon' and `image`='yes' LIMIT 1");
$avto=mysql_num_rows($req);
if($avto=='0'){
echo '<div class="zagolovok"><div class="zagolovok1"> <div class="zagolovok2"><div class="zagolovok_right"></div><div class="zagolovok_left"></div><div class="ch_name">Стоп!</div><div class="clearFix"></div></div></div></div>';
echo '<div class="fon bg"><div class="bg1"><div class="bg2"><div class="bg3"><div class="bg4"><div class="bg5"><div class="bg6"><div class="bg7"><div class="bg8">';
echo"Ошибка! Сначала возьмите оружие!<br/>";
echo '</div></div></div></div></div></div></div></div></div>';
include($path.'files/down.php');
include($path.'files/meny.php');
exit;
}
$it = mysql_fetch_array($req);
$u = explode("|",$mag[give]);
$numin=$u[0]+$udata[umin];
$numax=$u[1]+$udata[umax];
$w=explode("*",$it[name]);
if(empty($w[1])){
$nam="$w[0]*1";
}else{
$kol=$w[1]+1;
$nam="$w[0]*$kol";}
if(empty($w[1])){$stavka=100;}
if($w[1]==1){$stavka=50;}
if($w[1]==2){$stavka=45;}
if($w[1]==3){$stavka=40;}
if($w[1]==4){$stavka=35;}
if($w[1]==5){$stavka=25;}
if($w[1]==6){$stavka=20;}
if($w[1]==7){$stavka=15;}
if($w[1]==8){$stavka=10;}
if($w[1]==9){$stavka=5;}
if($w[1]>=10){
echo '<div class="zagolovok"><div class="zagolovok1"> <div class="zagolovok2"><div class="zagolovok_right"></div><div class="zagolovok_left"></div><div class="ch_name">Стоп!</div><div class="clearFix"></div></div></div></div>';
echo '<div class="fon bg"><div class="bg1"><div class="bg2"><div class="bg3"><div class="bg4"><div class="bg5"><div class="bg6"><div class="bg7"><div class="bg8">';
echo"Ошибка! Вещь заточена до максимума!<br/>";
echo '</div></div></div></div></div></div></div></div></div>';
include($path.'files/down.php');
exit;}
$priz=rand(1,100);
if($priz<=$stavka){
$num=$u[0]+$it[umin];
$nux=$u[1]+$it[umax];
mysql_query("UPDATE `users` SET `umin` = '$numin',`umax` = '$numax' WHERE usr = '$log'");
mysql_query("UPDATE `item` SET
`umin` = '$num',
`umax` = '$nux',
`name` = '$nam'
WHERE `usr` = '$log' and `tip`='weapon' and `image`='yes'");
$msg="Оружие модифицировано!";
}else{
$req = mysql_query("SELECT * FROM `item` WHERE `usr` = '$log' and `tip`='weapon' and `image`='yes'");
$it = mysql_fetch_array($req);
$numin=$udata[umin]-$it[umin];
$numax=$udata[umax]-$it[umax];
$npgolova=$udata[pgolova]-$it[pgolova];
$npbody=$udata[pbody]-$it[pbody];
$npnogi=$udata[pnogi]-$it[pnogi];
$nhp=$udata[hpall]-$it[hp];
$nmp=$udata[mpall]-$it[mp];
$nkrit=$udata[krit]-$it[krit];
$nukrit=$udata[ukrit]-$it[ukrit];
$nsila=$udata[sila]-$it[sila];
$nlovk=$udata[lovk]-$it[lovk];
$nprot=$udata[prot]-$it[prot];
$num=$udata[um]-$it[um];
$nanti=$udata[antikrit]-$it[antikrit];
mysql_query("UPDATE `users` SET
`umin` = '$numin',
`umax` = '$numax',
`pgolova` = '$npgolova',
`pbody` = '$npbody',
`pnogi` = '$npnogi',
`hpall` = '$nhp',
`mpall` = '$nmp',
`krit` = '$nkrit',
`ukrit` = '$nukrit',
`antikrit` = '$nanti',
`sila` = '$nsila',
`lovk` = '$nlovk',
`um` = '$num',
`prot` = '$nprot'
WHERE usr = '$log'");
mysql_query("DELETE FROM `item` WHERE `usr` = '$log' and `tip`='weapon' and `image`='yes'");
$msg="Оружие не выдержало очередной модификации магии из свитка!<br/><b>Оружие $it[name] сломано!</b><br/>";
}
//////////////
if($mag[kol]==1){
mysql_query("DELETE FROM `res` WHERE `usr` = '$log' and `id`='".mysql_real_escape_string($_GET['id'])."'");
}else{
$mag[kol]--;
mysql_query("UPDATE res SET kol = '$mag[kol]' WHERE `usr` = '$log' and `id`='".mysql_real_escape_string($_GET['id'])."'");
}
break;
/////////////////////
case 'scroll_armor':
if(empty($_GET[tip])){
echo '<div class="zagolovok"><div class="zagolovok1"><div class="zagolovok2"><div class="zagolovok_right"></div>
<div class="zagolovok_left"></div><div class="ch_name">Модифицируем...</div>
<div class="clearFix"></div></div></div></div>';
echo"<div class='button pad_bot_5 pad'><a href="scroll.php?tip=golova&id=$_GET[id]">    <img src='/theme/standart/images/galochka.png' alt=''/> Шлем</a></div>";
echo"<div class='button pad_bot_5 pad'><a href="scroll.php?tip=body&id=$_GET[id]">    <img src='/theme/standart/images/galochka.png' alt=''/> Доспехи</a></div>";
echo"<div class='button pad_bot_5 pad'><a href="scroll.php?tip=shit&id=$_GET[id]">    <img src='/theme/standart/images/galochka.png' alt=''/> Щит</a></div>";
echo"<div class='button pad_bot_5 pad'><a href="scroll.php?tip=plash&id=$_GET[id]">    <img src='/theme/standart/images/galochka.png' alt=''/> Плащ</a></div>";
echo"<div class='button pad_bot_5 pad'><a href="scroll.php?tip=poyas&id=$_GET[id]">    <img src='/theme/standart/images/galochka.png' alt=''/> Пояс</a></div>";
echo"<div class='button pad_bot_5 pad'><a href="scroll.php?tip=ruki&id=$_GET[id]">    <img src='/theme/standart/images/galochka.png' alt=''/> Рукавицы</a></div>";
echo"<div class='button pad_bot_5 pad'><a href="scroll.php?tip=nogi&id=$_GET[id]">    <img src='/theme/standart/images/galochka.png' alt=''/> Сапоги</a></div>";
echo"<div class='button pad_bot_5 pad'><a href="scroll.php?tip=amulet&id=$_GET[id]">    <img src='/theme/standart/images/galochka.png' alt=''/> Амулет</a></div>";
echo"<div class='button pad_bot_5 pad'><a href="scroll.php?tip=kolco&id=$_GET[id]">    <img src='/theme/standart/images/galochka.png' alt=''/> Кольцо</a></div>";
}elseif(isset($_GET[tip]) and empty($_GET[what])){
echo"<div class='button pad_bot_5 pad'><a href="scroll.php?tip=$_GET[tip]&what=pgolova&id=$_GET[id]">    <img src='/theme/standart/images/galochka.png' alt=''/> Защиту головы</a></div>";
echo"<div class='button pad_bot_5 pad'><a href="scroll.php?tip=$_GET[tip]&what=pbody&id=$_GET[id]">    <img src='/theme/standart/images/galochka.png' alt=''/> Защиту тела</a></div>";
echo"<div class='button pad_bot_5 pad'><a href="scroll.php?tip=$_GET[tip]&what=pnogi&id=$_GET[id]">    <img src='/theme/standart/images/galochka.png' alt=''/> Защиту ног</a></div>";
}else{
if($_GET[tip]!=golova and $_GET[tip]!=body and $_GET[tip]!=nogi and $_GET[tip]!=shit and $_GET[tip]!=plash and $_GET[tip]!=ruki and $_GET[tip]!=poyas and $_GET[tip]!=amulet and $_GET[tip]!=kolco){
echo'Ошибка, доступ закрыт!';
include($path.'files/down.php');
include($path.'files/meny.php');
exit;
}
if($_GET[what]!=pgolova and $_GET[what]!=pbody and $_GET[what]!=pnogi){
echo'Ошибка, доступ закрыт!';
include($path.'files/down.php');
include($path.'files/meny.php');
exit;
}
$req = mysql_query("SELECT * FROM `item` WHERE `usr` = '$log' and `tip`='$_GET[tip]' and `image`='yes' LIMIT 1");
$avto=mysql_num_rows($req);
if($avto=='0'){
echo'Ошибка, сначала наденьте вещь!';
include($path.'files/down.php');
include($path.'files/meny.php');
exit;
}
$it = mysql_fetch_array($req);
$nprotect=$mag[give]+$udata[$_GET[what]];
$w=explode("*",$it[name]);
if(empty($w[1])){
$nam="$w[0]*1";
}else{
$kol=$w[1]+1;
$nam="$w[0]*$kol";}
if(empty($w[1])){$stavka=100;}
if($w[1]==1){$stavka=50;}
if($w[1]==2){$stavka=45;}
if($w[1]==3){$stavka=40;}
if($w[1]==4){$stavka=35;}
if($w[1]==5){$stavka=25;}
if($w[1]==6){$stavka=20;}
if($w[1]==7){$stavka=15;}
if($w[1]==8){$stavka=10;}
if($w[1]==9){$stavka=5;}
if($w[1]>=10){
echo'Вещь заточена на максимум!';
include($path.'files/down.php');
exit;}
$priz=rand(1,100);
if($priz<=$stavka){
$num=$mag[give]+$it[$_GET[what]];
mysql_query("UPDATE `users` SET `$_GET[what]` = '$nprotect' WHERE usr = '$log'");
mysql_query("UPDATE `item` SET
`$_GET[what]` = '$num',
`name` = '$nam'
WHERE `usr` = '$log' and `tip`='$_GET[tip]' and `image`='yes'");
$msg="Защита модифицирована!";
}else{
$req = mysql_query("SELECT * FROM `item` WHERE `usr` = '$log' and `tip`='$_GET[tip]' and `image`='yes'");
$it = mysql_fetch_array($req);
$numin=$udata[umin]-$it[umin];
$numax=$udata[umax]-$it[umax];
$npgolova=$udata[pgolova]-$it[pgolova];
$npbody=$udata[pbody]-$it[pbody];
$npnogi=$udata[pnogi]-$it[pnogi];
$nhp=$udata[hpall]-$it[hp];
$nmp=$udata[mpall]-$it[mp];
$nkrit=$udata[krit]-$it[krit];
$nukrit=$udata[ukrit]-$it[ukrit];
$nsila=$udata[sila]-$it[sila];
$nlovk=$udata[lovk]-$it[lovk];
$nprot=$udata[prot]-$it[prot];
$num=$udata[um]-$it[um];
$nanti=$udata[antikrit]-$it[antikrit];
mysql_query("UPDATE `users` SET
`umin` = '$numin',
`umax` = '$numax',
`pgolova` = '$npgolova',
`pbody` = '$npbody',
`pnogi` = '$npnogi',
`hpall` = '$nhp',
`mpall` = '$nmp',
`krit` = '$nkrit',
`ukrit` = '$nukrit',
`antikrit` = '$nanti',
`sila` = '$nsila',
`lovk` = '$nlovk',
`um` = '$num',
`prot` = '$nprot'
WHERE usr = '$log'");
mysql_query("DELETE FROM `item` WHERE `usr` = '$log' and `tip`='$_GET[tip]' and `image`='yes'");
$msg="Вещь не выдержала очередной модификации магии из свитка!<br/><b>Вещь $it[name] сломана!</b><br/>";
}
//////////////
if($mag[kol]==1){
mysql_query("DELETE FROM `res` WHERE `usr` = '$log' and `id`='".mysql_real_escape_string($_GET['id'])."'");
}else{
$mag[kol]--;
mysql_query("UPDATE res SET kol = '$mag[kol]' WHERE `usr` = '$log' and `id`='".mysql_real_escape_string($_GET['id'])."'");
}
///////////////
}
break;
}
///////
echo '<div class="zagolovok"><div class="zagolovok1"> <div class="zagolovok2"><div class="zagolovok_right"></div><div class="zagolovok_left"></div><div class="ch_name">Модификаци</div><div class="clearFix"></div></div></div></div>';
echo '<div class="fon bg"><div class="bg1"><div class="bg2"><div class="bg3"><div class="bg4"><div class="bg5"><div class="bg6"><div class="bg7"><div class="bg8">';
echo"$msg";
echo '</div></div></div></div></div></div></div></div></div>';
echo"<div class="button pad_bot_5 pad"><a href="inventar.php?mod=res&tip=scroll">    <img src='/theme/standart/images/galochka.png' alt=''/> Вернуться</a></div>";
include($path.'files/down.php');
include($path.'files/meny.php');
?>