Убрал дубликаты файлов.

This commit is contained in:
lopar
2020-08-30 18:39:27 +03:00
parent bbe631b69f
commit c5a7dc4b58
7 changed files with 86 additions and 86 deletions

View File

@@ -1,9 +1,4 @@
<?php
/**
* Author: lopiu
* Date: 30.08.2020
* Time: 13:07
*/
class UserInfo extends User
{

View File

@@ -1625,7 +1625,7 @@ class fbattle
}
$winers .= implode("</B>, <B>", $this->t1);
$lomka = $this->t2;
include('../cave/win.php');
//include('../cave/win.php');
} elseif (in_array($ss[0], $this->t2)) {
$flag = 2;
foreach ($this->t2 as $k => $v) {
@@ -1727,7 +1727,7 @@ class fbattle
if ($this->battle_data['x'] > 0 || $this->battle_data['y'] > 0 && $this->user['laba'] > 0) {
mysql_query('UPDATE `users` SET `x` = "' . $this->user['xf'] . '", `y` = "' . $this->user['yr'] . '" WHERE `laba` = "' . $this->user['laba'] . '" AND `x` = "' . $this->battle_data['x'] . '" AND `y` = "' . $this->battle_data['y'] . '" AND `battle` = "' . $this->battle_data['id'] . '" LIMIT 1');
}
include("../cave/lose.php");
//include("../cave/lose.php");
}

View File

@@ -1,4 +1,4 @@
<?
<?php
function getchance($p)
{
@@ -21,61 +21,62 @@ function cavesys($text)
}
}
if(in_array($user['room'], $caverooms)) {
include("caveitems.php");
mysql_query('LOCK TABLES `cavebots` WRITE, `caveitems` WRITE, `shop` WRITE, `caveparties` WRITE');
$location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir`, `floor` FROM `caveparties` WHERE `user` = '$user[id]' LIMIT 1"));
if (in_array($user['room'], $caverooms)) {
include("CaveItems.php");
mysql_query('LOCK TABLES `cavebots` WRITE, `caveitems` WRITE, `shop` WRITE, `caveparties` WRITE');
$location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir`, `floor` FROM `caveparties` WHERE `user` = '$user[id]' LIMIT 1"));
if($location['dir'] == 0) {
$y = $location['y']*2;
$x = ($location['x']-1)*2;
}
if ($location['dir'] == 0) {
$y = $location['y'] * 2;
$x = ($location['x'] - 1) * 2;
}
if($location['dir'] == 1) {
$y = ($location['y']-1)*2;
$x = $location['x']*2;
}
if ($location['dir'] == 1) {
$y = ($location['y'] - 1) * 2;
$x = $location['x'] * 2;
}
if($location['dir'] == 2) {
$y = $location['y']*2;
$x = ($location['x']+1)*2;
}
if ($location['dir'] == 2) {
$y = $location['y'] * 2;
$x = ($location['x'] + 1) * 2;
}
if($location['dir'] == 3) {
$y = ($location['y']+1)*2;
$x = $location['x']*2;
}
if ($location['dir'] == 3) {
$y = ($location['y'] + 1) * 2;
$x = $location['x'] * 2;
}
$floor = $location['floor'];
$floor = $location['floor'];
$r = mysql_query("SELECT `bot`, `x`, `y`, `cnt` FROM `cavebots` WHERE `battle` = '".$this->battle_data["id"]."'");
$i = 0; $cnt = 0;
while($rec = mysql_fetch_assoc($r)) {
$bot = $rec['bot'];
$cnt = $rec['cnt'];
if(@$caveitems[$bot]) {
if($user['room'] == 621) {
$i = mt_rand(0, (count($caveitems[$bot]) - 1));
$item = $caveitems[$bot][$i];
if(getchance($item['chance'])) {
$it = mysql_fetch_array(mysql_query("SELECT `id`, `name`, `img` FROM `$item[from]` WHERE `id` = $item[id] LIMIT 1"));
$podz = 1;
mysql_query('INSERT INTO `caveitems` SET `podzem` = "'.$item['podzem'].'", `leader` = "'.$user['caveleader'].'", `x` = "'.$rec['x'].'", `y` = "'.$rec['y'].'", `floor` = "'.$floor.'", `name` = "'.$it['name'].'", `img` = "'.$it['img'].'", `item` = "'.$item['id'].'"'.($item['foronetrip'] ? ", `foronetrip` = 1" : ""));
cavesys("У <b>".$cavebots[$bot]."</b> был предмет <b>$it[name]</b> и кто угодно может подобрать его.");
$this->AddToLog('<span class=date>'.date("H:i")."</span> У <b>".$cavebots[$bot]."</b> был предмет <b>$it[name]</b>.<BR>");
$r = mysql_query("SELECT `bot`, `x`, `y`, `cnt` FROM `cavebots` WHERE `battle` = '" . $this->battle_data["id"] . "'");
$i = 0;
$cnt = 0;
while ($rec = mysql_fetch_assoc($r)) {
$bot = $rec['bot'];
$cnt = $rec['cnt'];
if (@$caveitems[$bot]) {
if ($user['room'] == 621) {
$i = mt_rand(0, (count($caveitems[$bot]) - 1));
$item = $caveitems[$bot][$i];
if (getchance($item['chance'])) {
$it = mysql_fetch_array(mysql_query("SELECT `id`, `name`, `img` FROM `$item[from]` WHERE `id` = $item[id] LIMIT 1"));
$podz = 1;
mysql_query('INSERT INTO `caveitems` SET `podzem` = "' . $item['podzem'] . '", `leader` = "' . $user['caveleader'] . '", `x` = "' . $rec['x'] . '", `y` = "' . $rec['y'] . '", `floor` = "' . $floor . '", `name` = "' . $it['name'] . '", `img` = "' . $it['img'] . '", `item` = "' . $item['id'] . '"' . ($item['foronetrip'] ? ", `foronetrip` = 1" : ""));
cavesys("У <b>" . $cavebots[$bot] . "</b> был предмет <b>$it[name]</b> и кто угодно может подобрать его.");
$this->AddToLog('<span class=date>' . date("H:i") . "</span> У <b>" . $cavebots[$bot] . "</b> был предмет <b>$it[name]</b>.<BR>");
}
}
}
}
}
}
if($user['caveleader'] > 0) {
$bots = array(1 => 10025, 2 => 10026, 3 => 10027, 4 => 10028, 5 => 10031, 6 => 10032, 7 => 10033, 8 => 10034);
$tp = 1;
while($tp <= $cnt) {
addActions(time(), 'win_bot_'.$bots[$bot], 0, $user['id']);
$tp++;
if ($user['caveleader'] > 0) {
$bots = [1 => 10025, 2 => 10026, 3 => 10027, 4 => 10028, 5 => 10031, 6 => 10032, 7 => 10033, 8 => 10034];
$tp = 1;
while ($tp <= $cnt) {
addActions(time(), 'win_bot_' . $bots[$bot], 0, $user['id']);
$tp++;
}
}
}
mysql_query("DELETE FROM `cavebots` WHERE `battle` = '".$this->battle_data["id"]."'");
mysql_query('UNLOCK TABLES');
mysql_query("DELETE FROM `cavebots` WHERE `battle` = '" . $this->battle_data["id"] . "'");
mysql_query('UNLOCK TABLES');
}