Проверки с перенаправлениями переехали в functions.php. Глобальный выход если нет сессии в config.php.
This commit is contained in:
parent
2024a6fac7
commit
32c72e3413
15
akadem.php
15
akadem.php
@ -1,20 +1,7 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once 'functions.php';
|
||||
$user = $user ?? null;
|
||||
if ($user->room != 61) {
|
||||
header("Location: main.php");
|
||||
exit;
|
||||
}
|
||||
if ($user->battle) {
|
||||
header('location: fight.php');
|
||||
exit;
|
||||
}
|
||||
$user = $user ?? new \Battles\User($_SESSION['uid']);
|
||||
const SMITH = 'оружейник';
|
||||
const MERCENARY = 'наёмник';
|
||||
const MEDIC = 'лекарь';
|
||||
|
@ -1,10 +1,5 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once "functions.php";
|
||||
|
||||
$start = db::c()->query('SELECT `value` FROM `variables` WHERE `var` = "arena_of_gods"')->fetch_assoc();
|
||||
|
15
bank.php
15
bank.php
@ -1,21 +1,8 @@
|
||||
<?php
|
||||
ob_start("ob_gzhandler");
|
||||
session_start();
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
require_once "functions.php";
|
||||
$user = $user ?? [];
|
||||
if ($user->room != 29) {
|
||||
header("Location: main.php");
|
||||
exit;
|
||||
}
|
||||
if ($user->battle != 0) {
|
||||
header('location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
$user = $user ?? new \Battles\User($_SESSION['uid']);
|
||||
const SUCCESS = "Успешная операция!";
|
||||
|
||||
$bank = new \Battles\Bank($user->id);
|
||||
|
@ -1,9 +1,5 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
require_once "functions.php";
|
||||
$header = $_GET['header'] ?? null;
|
||||
$ch = $_GET['ch'] ?? null;
|
||||
|
@ -1,10 +1,6 @@
|
||||
<?
|
||||
<?php
|
||||
session_start();
|
||||
require_once('functions.php');
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
if ($user->room == 51) {
|
||||
header('location: city.php');
|
||||
exit;
|
||||
|
15
c_haos.php
15
c_haos.php
@ -1,19 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
include "functions.php";
|
||||
if ($user->room != 600) {
|
||||
header("Location: main.php");
|
||||
exit;
|
||||
}
|
||||
if ($user->battle) {
|
||||
header('location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once "functions.php";
|
||||
$in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}';"));
|
||||
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = " . $user['id'] . " AND (type=13 OR type=12 OR type=14) limit 1;"));
|
||||
$wait_msg = "Ждем подтверждения от всей группы...";
|
||||
|
@ -1,11 +1,5 @@
|
||||
<?php
|
||||
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
include "functions.php";
|
||||
require_once "functions.php";
|
||||
$in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}' LIMIT 1;"));
|
||||
$wait_msg = "Ждем готовности всей группы...";
|
||||
//rooms
|
||||
@ -108,14 +102,6 @@ $ch_bots[2]=array
|
||||
"1"=>"Босс глубин"
|
||||
);*/
|
||||
|
||||
if ($user->room != 601) {
|
||||
header("Location: main.php");
|
||||
exit;
|
||||
}
|
||||
if ($user->battle) {
|
||||
header('location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
if ($in_haos['status'] == 4) {
|
||||
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '600',`online`.`room` = '600' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
|
||||
mysql_query("UPDATE `cit_haos_status` SET room='0',bot='0',group='0' WHERE id = '{$user['id']}'; ");
|
||||
|
17
c_park.php
17
c_park.php
@ -1,9 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
require_once "functions.php";
|
||||
$in_park = mysql_fetch_array(mysql_query("SELECT * FROM `cit_park` WHERE `id` = '{$user['id']}' LIMIT 1;"));
|
||||
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = " . $user['id'] . " AND (type=13 OR type=12 OR type=14) limit 1;"));
|
||||
|
||||
@ -12,19 +9,7 @@ if (!$in_park) {
|
||||
$in_park = mysql_fetch_array(mysql_query("SELECT * FROM `cit_park` WHERE `id` = '{$user['id']}' LIMIT 1;"));
|
||||
}
|
||||
|
||||
include "functions.php";
|
||||
|
||||
if ($user->room != 602) {
|
||||
header("Location: main.php");
|
||||
exit;
|
||||
}
|
||||
if ($user->battle) {
|
||||
header('location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
//комнаты парка
|
||||
|
||||
$ch_rooms = [
|
||||
// 0 - empty
|
||||
"1" => "Площадь (1)",
|
||||
|
@ -1,18 +1,9 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
require_once "functions.php";
|
||||
$user = $user ?? null;
|
||||
$user = $user ?? new \Battles\User($_SESSION['uid']);
|
||||
if ($user->room == 403) {
|
||||
include "startpodzemel.php";
|
||||
if ($user->battle != 0) {
|
||||
header('location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($_GET['act'] == "cexit") {
|
||||
$das = mysql_query("select glava,glav_id from `labirint` where user_id='" . $user['id'] . "'");
|
||||
$rf = mysql_fetch_array($das);
|
||||
|
9
cave.php
9
cave.php
@ -1,9 +1,5 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header('Location: index.php');
|
||||
exit();
|
||||
}
|
||||
require_once 'functions.php';
|
||||
//require_once 'cave/cave_bots.php';
|
||||
|
||||
@ -447,11 +443,6 @@ function getcavedata($caveleader, $floor)
|
||||
return unserialize(implode("", file("cavedata/$caveleader-$floor.dat")));
|
||||
}
|
||||
|
||||
if (!in_array($user->room, Config::$caverooms)) {
|
||||
header("Location: main.php");
|
||||
exit('Not in this life ...');
|
||||
}
|
||||
|
||||
if (isset($_GET['direction'])) {
|
||||
$dir = (int)$_GET['direction'];
|
||||
if ($dir >= 0 && $dir <= 3) {
|
||||
|
4
ch.php
4
ch.php
@ -1,9 +1,5 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
require_once 'functions.php';
|
||||
|
||||
db::c()->query('UPDATE `online` SET `real_time` = ?i WHERE `id` = ?i', time(), $u->i()['id']);
|
||||
|
4
chat.php
4
chat.php
@ -6,10 +6,6 @@
|
||||
*/
|
||||
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
require_once "config.php";
|
||||
|
||||
$msg = $_POST['msg'] ?? null;
|
||||
|
15
city.php
15
city.php
@ -3,22 +3,9 @@
|
||||
* Центральная площадь
|
||||
*/
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once "functions.php";
|
||||
$user = $user ?? [];
|
||||
$user = $user ?? new \Battles\User($_SESSION['uid']);
|
||||
|
||||
if ($user->battle) {
|
||||
header('location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
if ($user->in_tower == 1) {
|
||||
header('Location: towerin.php');
|
||||
exit;
|
||||
}
|
||||
if ($user->zayavka) {
|
||||
exit;
|
||||
}
|
||||
|
6
clan.php
6
clan.php
@ -1,11 +1,7 @@
|
||||
<?php
|
||||
ob_start("ob_gzhandler");
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
include_once 'functions.php';
|
||||
require_once 'functions.php';
|
||||
if (!$user->clan) {
|
||||
exit(err('Вы не состоите в клане!'));
|
||||
}
|
||||
|
@ -1,24 +1,8 @@
|
||||
<?php
|
||||
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once "functions.php";
|
||||
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = " . $user['id'] . " AND (type=13 OR type=12 OR type=14) limit 1;"));
|
||||
$klan = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '{$user['klan']}' LIMIT 1;"));
|
||||
|
||||
include "functions.php";
|
||||
if ($user->room != 45) {
|
||||
header("Location: main.php");
|
||||
exit;
|
||||
}
|
||||
if ($user->battle) {
|
||||
header('location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$cc_date = mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var`='cc_time' LIMIT 1;"));
|
||||
$ccd = $cc_date['value'];
|
||||
|
||||
|
@ -1,15 +1,7 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
require_once 'functions.php';
|
||||
$user = $user ?? [];
|
||||
if ($user->room != 30) {
|
||||
header("Location: main.php");
|
||||
exit;
|
||||
}
|
||||
$user = $user ?? new \Battles\User($_SESSION['uid']);
|
||||
$userClan = db::c()->query('SELECT short_name, full_name, info FROM clans where owner_id = ?i', $user->id)->fetch_object();
|
||||
$clanFullName = $_POST['clan_full_name'] ?? '';
|
||||
$clanShortName = $_POST['clan_short_name'] ?? '';
|
||||
@ -42,7 +34,7 @@ if ($clanFullName && $clanShortName && $clanInfo && !$userClan) {
|
||||
try {
|
||||
db::c()->query('INSERT INTO clans (owner_id, full_name, short_name, info) VALUES (?i,"?s","?s","?s")', $user->id, $clanFullName, $clanShortName, $clanInfo);
|
||||
$userBank->setMoney($userBank->getMoney() - Config::$clan_register_cost);
|
||||
Bank::setBankMoney($userBank->getMoney(), $user->id, 'clanRegister');
|
||||
Battles\Bank::setBankMoney($userBank->getMoney(), $user->id, 'clanRegister');
|
||||
// Заглушка для отображения данных по только что зарегистрированному клану, когда запрос в базу в начале файла ещё не проходит.
|
||||
$userClan = new stdClass();
|
||||
$userClan->full_name = $clanFullName;
|
||||
@ -59,8 +51,8 @@ if ($clanFullName && $clanShortName && $clanInfo && !$userClan) {
|
||||
}
|
||||
}
|
||||
}
|
||||
\Battles\Template::header(Rooms::$roomNames[30]);
|
||||
\Battles\Template::buildingTop(Rooms::$roomNames[30], 'strah');
|
||||
\Battles\Template::header(\Battles\Rooms::$roomNames[30]);
|
||||
\Battles\Template::buildingTop(\Battles\Rooms::$roomNames[30], 'strah');
|
||||
if ($userClan): ?>
|
||||
<div>
|
||||
<fieldset style="display: inline;">
|
||||
|
@ -25,15 +25,15 @@ class DressedItems
|
||||
private function getDressedItems()
|
||||
{
|
||||
try {
|
||||
$this->DB = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->USERID);
|
||||
} catch (Exception $e) {
|
||||
$this->DB = \db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->USERID);
|
||||
} catch (\Exception $e) {
|
||||
echo '<div class="debug">Не прогрузилась таблица inventory (*) для класса DressedItems.</div>';
|
||||
}
|
||||
}
|
||||
|
||||
private function getDressedItemById($item_id)
|
||||
{
|
||||
return db::c()->query('SELECT * FROM inventory WHERE item_id = ?i AND dressed_slot > 0', $item_id)->fetch_assoc();
|
||||
return \db::c()->query('SELECT * FROM inventory WHERE item_id = ?i AND dressed_slot > 0', $item_id)->fetch_assoc();
|
||||
}
|
||||
|
||||
private function getBonusesFromDressedItems()
|
||||
@ -53,8 +53,8 @@ SELECT SUM(add_strength) as sum_strength,
|
||||
SUM(add_max_physical_damage) as sum_max_phys_damage
|
||||
FROM inventory WHERE owner_id = ?i AND dressed_slot > 0
|
||||
SQL;
|
||||
$this->DBSUM = db::c()->query($query, $this->USERID)->fetch_assoc();
|
||||
} catch (Exception $e) {
|
||||
$this->DBSUM = \db::c()->query($query, $this->USERID)->fetch_assoc();
|
||||
} catch (\Exception $e) {
|
||||
echo '<div class="debug">Не прогрузилась таблица inventory (SUM) для класса DressedItems:' . $e . '</div>';
|
||||
}
|
||||
}
|
||||
@ -134,7 +134,7 @@ SQL;
|
||||
self::getItemsInSlots();
|
||||
// Проверяем, что используется один из 12 слотов и наличие предмета в слоте.
|
||||
if (in_array($slot_id, Item::ITEM_TYPES_ALLOWED_IN_SLOTS) && $this->dressedItem[$slot_id]) {
|
||||
db::c()->query('UPDATE inventory SET dressed_slot = 0 WHERE dressed_slot = ?i AND owner_id = ?i', $slot_id, $this->USERID);
|
||||
\db::c()->query('UPDATE inventory SET dressed_slot = 0 WHERE dressed_slot = ?i AND owner_id = ?i', $slot_id, $this->USERID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,9 +15,6 @@ class PresentsModel
|
||||
{
|
||||
if (!$this->DB) {
|
||||
$this->DB = \db::c()->query('SELECT sender_id, image FROM `users_presents` WHERE owner_id = ?i', $user_id);
|
||||
if ($this->DB->getNumRows() == 0) {
|
||||
throw new GameException("<div class='debug'>class PresentsModel: Не прогрузилась база!</div>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ class Travel
|
||||
* Соответствие ID комнаты игровому файлу.
|
||||
* @var string[]
|
||||
*/
|
||||
private static $roomFileName = [
|
||||
public static $roomFileName = [
|
||||
1 => 'main.php',
|
||||
20 => 'city.php',
|
||||
21 => 'city.php',
|
||||
@ -21,18 +21,31 @@ class Travel
|
||||
31 => 'tower.php',
|
||||
34 => 'fshop.php',
|
||||
37 => 'gotzamok.php',
|
||||
38 => 'gotzamok.php',
|
||||
39 => 'gotzamok.php',
|
||||
40 => 'gotzamok.php',
|
||||
41 => 'gotzamok.php',
|
||||
51 => 'city.php',
|
||||
61 => 'akadem.php',
|
||||
401 => 'hell.php',
|
||||
402 => 'lab_chaos_enter.php',
|
||||
404 => 'vxod.php',
|
||||
402 => 'vxod.php',
|
||||
403 => 'canalizaciya.php',
|
||||
//404 => 'vxod.php',
|
||||
600 => 'c_haos.php',
|
||||
601 => 'c_haos_in.php',
|
||||
602 => 'c_park.php',
|
||||
603 => 'aren_of_angels.php',
|
||||
620 => 'enter_cave.php',
|
||||
621 => 'cave.php',
|
||||
650 => 'ul_clans.php',
|
||||
660 => 'hostel.php',
|
||||
661 => 'hostel_room.php',
|
||||
662 => 'quest_room.php',
|
||||
666 => 'jail.php',
|
||||
760 => 'c_forest.php',
|
||||
777 => 'obshaga.php',
|
||||
1051 => 'lab_enter.php',
|
||||
1052 => 'labirint.php',
|
||||
1055 => 'group_arena.php',
|
||||
2111 => 'city.php',
|
||||
2601 => 'city.php',
|
||||
|
@ -20,8 +20,6 @@ class UserInfo extends User
|
||||
*/
|
||||
private function UserInfoDoll($isBattle = 0, $isMain = 0)
|
||||
{
|
||||
//https://jsfiddle.net/ngx0yvhc
|
||||
//TODO переверстать grid, чтобы он касался только куклы.
|
||||
$di = new DressedItems($this->id);
|
||||
$dressedItems = $di->getItemsInSlots();
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
@ -103,7 +101,6 @@ class UserInfo extends User
|
||||
echo $variables;
|
||||
echo '</div><!-- column -->';
|
||||
echo '</div><!-- stats-container -->';
|
||||
echo '<div class="debug">TODO: Сделать рассчёт модификаторов. Вывести полоску здоровья когда будет от чего отталкиваться.</div>';
|
||||
echo '</div><!-- user-info -->';
|
||||
}
|
||||
|
||||
@ -172,7 +169,7 @@ class UserInfo extends User
|
||||
|
||||
private function WatcherStatus()
|
||||
{
|
||||
$query = db::c()->query('SELECT `align`,`admin` FROM `users` WHERE `id` = ?i', $this->watcher_id)->fetch_assoc();
|
||||
$query = \db::c()->query('SELECT `align`,`admin` FROM `users` WHERE `id` = ?i', $this->watcher_id)->fetch_assoc();
|
||||
if ($query['admin']) {
|
||||
$this->watcherIsAdmin = 1;
|
||||
}
|
||||
|
@ -1,27 +1,8 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!$_SESSION['uid']) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
require_once 'functions.php';
|
||||
$user = $user ?? 0;
|
||||
|
||||
if ($user->level < 1) {
|
||||
header("Location: main.php");
|
||||
exit;
|
||||
}
|
||||
if ($user->room != 25) {
|
||||
header("Location: main.php");
|
||||
exit;
|
||||
}
|
||||
if ($user->battle) {
|
||||
header('location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$user = $user ?? new \Battles\User($_SESSION['uid']);
|
||||
$get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
|
||||
|
||||
$putItemCost = (int)filter_input(INPUT_POST, 'cost', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]);
|
||||
$putItemId = (int)filter_input(INPUT_POST, 'putId', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]);
|
||||
$returningItemId = (int)filter_input(INPUT_GET, 'back', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]);
|
||||
|
17
config.php
17
config.php
@ -4,7 +4,10 @@
|
||||
* Author: Igor Barkov <lopar.4ever@gmail.com>
|
||||
* Project name: Battles-Game
|
||||
*/
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
ini_set('display_errors', 'On');
|
||||
error_reporting(E_ALL);
|
||||
define("GAMEDOMAIN", "battles.lan");
|
||||
@ -28,7 +31,7 @@ require_once 'classes/Database/db.php';
|
||||
* Автозагрузка классов с учётом неймспейсов.
|
||||
*/
|
||||
|
||||
spl_autoload_register(function ($className){
|
||||
spl_autoload_register(function ($className) {
|
||||
$fileName = __DIR__ . '/classes/' . str_replace('\\', '/', $className . '.php');
|
||||
if (file_exists($fileName)) {
|
||||
require_once $fileName;
|
||||
@ -204,4 +207,14 @@ trait Config
|
||||
1500000000 => [10, 1, 5, 8000, 1, 9999999999], # Это тринадцатый уровень
|
||||
];
|
||||
public static $cavedata = [621 => ['x1' => 6, 'y1' => 11, 'dir1' => 1, 'x2' => 10, 'y2' => 8, 'dir2' => 1, 'x3' => 20, 'y3' => 4, 'dir3' => 1, 'x4' => 10, 'y4' => 10, 'dir4' => 1, 'delay' => 360, 'name1' => 'Проклятый Рудник', 'name2' => 'Проклятого Рудника']];
|
||||
|
||||
//DB
|
||||
protected static $db = [
|
||||
'host' => '192.168.20.5',
|
||||
'name' => 'battles',
|
||||
'user' => 'battles',
|
||||
'password' => 'bottle-neck-horse',
|
||||
'port' => 32101,
|
||||
'charset' => 'utf8',
|
||||
];
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
include("config.php");
|
||||
require_once "config.php";
|
||||
define('ERROR_NO_SUCH_USER', 'Такого пользователя не существует!');
|
||||
define('ERROR_USER_IS_BLOCKED', 'Пользователь заблокирован!');
|
||||
define('ERROR_WRONG_PASSWORD', 'Неверный пароль!');
|
||||
|
@ -1,16 +1,7 @@
|
||||
<?php
|
||||
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
require_once "functions.php";
|
||||
$user = $user ?? [];
|
||||
if ($user->battle) {
|
||||
header('location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
$user = $user ?? new \Battles\User($_SESSION['uid']);
|
||||
|
||||
function secs2hrs($s, $short = 0)
|
||||
{
|
||||
|
@ -1,10 +1,6 @@
|
||||
<?php
|
||||
ob_start("ob_gzhandler");
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
if (isset($_POST['end'])) {
|
||||
header("Location: main.php");
|
||||
exit;
|
||||
|
67
fight.php
67
fight.php
@ -1,10 +1,5 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once 'config.php';
|
||||
$userLoginStatus = db::c()->query('SELECT enter_game FROM users WHERE id = ?i', $_SESSION['uid'])->getNumRows() ?? 0;
|
||||
if (empty($userLoginStatus)) {
|
||||
@ -15,40 +10,40 @@ if (empty($userLoginStatus)) {
|
||||
|
||||
\Battles\Template::header('Окно игры');
|
||||
?>
|
||||
<script>
|
||||
if (!navigator.cookieEnabled) {
|
||||
document.write('Внимание! В вашем браузере отключена поддержка Cookies. Включите чтобы играть.');
|
||||
try {
|
||||
window.stop();
|
||||
} catch (exception) {
|
||||
document.execCommand('Stop');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
IFRAME.FRAME {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0 solid;
|
||||
<script>
|
||||
if (!navigator.cookieEnabled) {
|
||||
document.write('Внимание! В вашем браузере отключена поддержка Cookies. Включите чтобы играть.');
|
||||
try {
|
||||
window.stop();
|
||||
} catch (exception) {
|
||||
document.execCommand('Stop');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
IFRAME.FRAME {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0 solid;
|
||||
}
|
||||
|
||||
.frametable {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border: 0 solid;
|
||||
border-spacing: 0;
|
||||
}
|
||||
.frametable {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border: 0 solid;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
.frametd {
|
||||
height: inherit;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
.frametd {
|
||||
height: inherit;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
<table class="frametable">
|
||||
<tr style="height: 25px;">
|
||||
<td class="frametd">
|
||||
|
@ -63,11 +63,6 @@ if ($rand < 15 && $user['battle'] == 0) {
|
||||
addchp('<b style="color:#990000">Внимание!</b> На вас напал "' . $bots[$rbot] . '". ', '{[]}' . Nick::id($user["id"])->short() . '{[]}');
|
||||
}
|
||||
|
||||
if ($user['battle'] > 0) {
|
||||
header('location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$les_login = mysql_fetch_array(mysql_query("SELECT * FROM `les_game` WHERE `owner` = '" . $user['id'] . "' LIMIT 1"));
|
||||
|
||||
$rooms = ["A1" => ['20', '', 'A2', '', 'B1'], "A2" => ['15', 'A1', 'A3', '', ''], "A3" => ['15', 'A2', '', '', ''], "A4" => ['15', '', 'A5', '', 'B4'], "A5" => ['15', 'A4', '', '', 'B5'], "A6" => ['15', '', 'A7', '', 'B6'], "A7" => ['15', 'A6', 'A8', '', ''], "A8" => ['15', 'A7', '', '', 'B8'], "B1" => ['20', '', '', 'A1', ''], "B2" => ['15', '', 'B3', '', 'C2'], "B3" => ['15', 'B2', 'B4', '', ''], "B4" => ['15', 'B3', '', 'A4', ''], "B5" => ['15', '', 'B6', 'A5', ''], "B6" => ['15', 'B5', 'B7', 'A6', ''], "B7" => ['15', 'B6', '', '', 'C7'], "B8" => ['15', '', '', 'A8', 'C8'], "C1" => ['20', '', '', '', 'D1'], "C2" => ['15', '', 'C3', 'B2', 'D2'], "C3" => ['15', 'C2', '', '', 'D3'], "C4" => ['15', '', '', '', 'D4'], "C5" => ['15', '', '', '', 'D5'], "C6" => ['15', '', 'C7', '', ''], "C7" => ['15', 'C6', 'C8', 'B7', ''], "C8" => ['15', 'C7', '', 'B8', 'D8'], "D1" => ['20', '', 'D2', 'C1', 'E1'], "D2" => ['15', 'D1', 'D3', 'C2', 'E2'], "D3" => ['15', 'D2', 'D4', 'C3', 'E3'], "D4" => ['15', 'D3', 'D5', 'C4', 'E4'], "D5" => ['15', 'D4', '', 'C5', ''], "D6" => ['15', '', 'D7', '', 'E6'], "D7" => ['15', 'D6', '', '', ''], "D8" => ['15', '', '', 'C8', 'E8'], "E1" => ['20', '', 'E2', 'D1', 'F1'], "E2" => ['15', 'E1', 'E3', 'D2', 'F2'], "E3" => ['15', 'E2', 'E4', 'D3', 'F3'], "E4" => ['15', 'E3', 'E5', 'D4', 'F4'], "E5" => ['15', 'E4', 'E6', '', 'F5'], "E6" => ['15', 'E5', '', 'D6', ''], "E7" => ['15', '', 'E8', '', 'F7'], "E8" => ['15', 'E7', '', 'D8', 'F8'], "F1" => ['20', '', 'F2', 'E1', 'G1'], "F2" => ['15', 'F1', 'F3', 'E2', 'G2'], "F3" => ['15', 'F2', 'F4', 'E3', 'G3'], "F4" => ['15', 'F3', 'F5', 'E4', 'G4'], "F5" => ['15', 'F4', '', 'E5', 'G5'], "F6" => ['15', '', '', '', 'G6'], "F7" => ['15', '', '', 'E7', 'G7'], "F8" => ['15', '', '', 'E8', 'G8'], "G1" => ['20', '', '', 'F1', 'H1'], "G2" => ['15', '', '', 'F2', ''], "G3" => ['15', '', '', 'F3', ''], "G4" => ['15', '', '', 'F4', ''], "G5" => ['15', '', 'G6', 'F5', ''], "G6" => ['15', 'G5', 'G7', 'F6', ''], "G7" => ['15', 'G6', 'G8', 'F7', ''], "G8" => ['15', 'G7', '', 'F8', 'H8'], "H1" => ['20', '', 'H2', 'G1', 'I1'], "H2" => ['15', 'H1', '', '', 'I2'], "H3" => ['15', '', '', '', 'I3'], "H4" => ['15', '', 'H5', '', 'I4'], "H5" => ['15', 'H4', '', '', 'I5'], "H6" => ['15', '', 'H7', '', 'I6'], "H7" => ['15', 'H6', '', '', 'I7'], "H8" => ['15', 'H7', '', 'G8', 'I8'], "I1" => ['20', '', 'I2', 'H1', ''], "I2" => ['15', 'I1', 'I3', 'H2', ''], "I3" => ['15', 'I2', 'I4', 'H3', ''], "I4" => ['15', 'I3', 'I5', 'H4', ''], "I5" => ['15', 'I4', 'I6', 'H5', ''], "I6" => ['15', 'I5', 'I7', 'H6', ''], "I7" => ['15', 'I6', 'I8', 'H7', ''], "I8" => ['15', 'I7', '', 'H8', '']];
|
||||
|
@ -1,10 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once 'config.php';
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
$user = new \Battles\User($_SESSION['uid']);
|
||||
$sleep = db::c()->query('SELECT `id` FROM `effects` WHERE `owner` = ?i AND `time` > ?i AND `type` = 3', $user['id'], time())->fetch_assoc();
|
||||
$ps = $_GET['page'] ?? 0;
|
||||
|
@ -1,19 +1,69 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copyright (c) 2018.
|
||||
* Author: Igor Barkov <lopar.4ever@gmail.com>
|
||||
* Project name: Battles-Game
|
||||
*/
|
||||
require_once 'config.php';
|
||||
if (empty($_SESSION['uid'])) {
|
||||
throw new \Exceptions\GameException('Не могу проинициализировать игрока!');
|
||||
}
|
||||
|
||||
$user = new \Battles\User($_SESSION['uid']);
|
||||
if ($user->id && $user->block) {
|
||||
exit('user blocked!');
|
||||
}
|
||||
|
||||
/*
|
||||
* Проверки на соответствие скрипта и комнаты, которые были натыканы по всем файлам.
|
||||
*/
|
||||
$fbattleCheckFiles = [
|
||||
'c_haos_in.php',
|
||||
'c_haos.php',
|
||||
'c_park.php',
|
||||
'city.php',
|
||||
'clan_castle.php',
|
||||
'comission.php',
|
||||
'enter_cave.php',
|
||||
'library.php',
|
||||
'atk.php',
|
||||
'podzem_dialog.php',
|
||||
'post.php',
|
||||
'shop.php',
|
||||
'tournament.php',
|
||||
'vxod.php',
|
||||
'bank.php',
|
||||
'canalizaciya,php',
|
||||
'forest.php',
|
||||
'main.php',
|
||||
'repair.php',
|
||||
'towerstamp.php',
|
||||
'hell.php',
|
||||
'ul_clans.php',
|
||||
'labirint.php',
|
||||
'akadem.php',
|
||||
'towerin.php',
|
||||
'user_anketa.php',
|
||||
'zayavka.php',
|
||||
];
|
||||
//Может просто отовсюду? О_о
|
||||
if ($user->battle && in_array(pathinfo(debug_backtrace()[0]['file'])['basename'], $fbattleCheckFiles)) {
|
||||
header('location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
$towerinCheckFiles = ['main.php', 'city.php', 'tower.php'];
|
||||
if ($user->in_tower && in_array(pathinfo(debug_backtrace()[0]['file'])['basename'], $towerinCheckFiles)) {
|
||||
header('location: towerin.php');
|
||||
exit;
|
||||
}
|
||||
$roomsCheck = [22, 23, 25, 27, 29, 30, 31, 37, 38, 39, 40, 41, 45, 53, 61, 401, 402, 600, 601, 602, 621, 650, 1051, 1052];
|
||||
// Если я в одной из этих комнат,
|
||||
// [И] Имя файла который инклюдит файл с проверкой не совпадает с именем файла локации в которой я нахожусь
|
||||
// [И] Номер комнаты который я пытаюсь открыть есть в списке проверяемых
|
||||
if (in_array($user->room, $roomsCheck)
|
||||
&& pathinfo(debug_backtrace()[0]['file'])['basename'] != \Battles\Travel::$roomFileName[$user->room]
|
||||
&& in_array(array_search(pathinfo(debug_backtrace()[0]['file'])['basename'], \Battles\Travel::$roomFileName), $roomsCheck)) {
|
||||
header('location: main.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$ip = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP);
|
||||
if (isset($_GET['goto']) && isset($_GET['tStamp']) && isset($_GET['vcode']) && $_GET['vcode'] == md5(sha1($_GET['goto'] . $_GET['tStamp']))) {
|
||||
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i, `online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_GET['goto'], $_GET['goto'], $_SESSION['uid']);
|
||||
|
102
game.php
102
game.php
@ -1,102 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (c) 2018.
|
||||
* Author: Igor Barkov <lopar.4ever@gmail.com>
|
||||
* Project name: Battles-Game
|
||||
*/
|
||||
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) header("Location: index.php");
|
||||
//include("config.php");
|
||||
|
||||
//$msg = filter_input(INPUT_POST,'msg');
|
||||
//$uid = $_SESSION['uid'];
|
||||
//if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg);
|
||||
\Battles\Template::header('Окно игры');
|
||||
?>
|
||||
<style>
|
||||
form {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
form input {
|
||||
border: 1px solid silver;
|
||||
width: 80%;
|
||||
margin-right: .5%;
|
||||
}
|
||||
|
||||
form input[type="submit"] {
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
display: grid;
|
||||
height: 100vh;
|
||||
grid-template-rows: 45px /* Шапка */ 2fr /* Окно игры */ 1fr /* Окно чата*/ 30px; /* Подвал */
|
||||
}
|
||||
|
||||
header {
|
||||
text-align: right;
|
||||
box-shadow: 0 3px 2px -2px slategray;
|
||||
}
|
||||
|
||||
footer {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
#game, #chat {
|
||||
overflow: auto;
|
||||
box-shadow: 0 3px 2px -2px slategray;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
a img {
|
||||
border: 1px solid #fff;
|
||||
transition: box-shadow 0.5s ease;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
a img:hover {
|
||||
box-shadow: 0 0 7px slategray;
|
||||
}
|
||||
</style>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<div class="wrap">
|
||||
<header>
|
||||
<a href="/user_anketa.php" title="Анкета" target="main"><img src="http://placehold.it/32x32/33ff33?text=A"/></a>
|
||||
<a href="/friend.php" title="Друзья" target="main"><img src="http://placehold.it/32x32/33ff33?text=F"/></a>
|
||||
<a href="/main.php?edit=1" title="Инвентарь" target="main"><img src="http://placehold.it/32x32/33ff33?text=I"/></a>
|
||||
<a href="/relikt.php?edit=1" title="Реликты" target="main"><img src="http://placehold.it/32x32?text=R"/></a>
|
||||
<a href="/clan.php" title="Клан" target="main"><img src="http://placehold.it/32x32/33ff33?text=K"/></a>
|
||||
<a href="/orden.php" title="Особые умения" target="main"><img
|
||||
src="http://placehold.it/32x32/33ff33?text=O"/></a>
|
||||
<a href="/moderators.php" title="Модераторы" target="main"><img src="http://placehold.it/32x32/33ff33?text=M"/></a>
|
||||
<a href="/forum.php" title="Форум" target="main"><img src="http://placehold.it/32x32?text=F"/></a>
|
||||
<a href="javascript:$('#game').load('/forum.php')"><img src="http://placehold.it/32x32?text=F"/></a>
|
||||
</header>
|
||||
<div id="game"></div>
|
||||
<div id="chat"></div>
|
||||
<footer>
|
||||
<form action="chat.php" method="post" target="chat">
|
||||
<input id="msg" name="msg" size="100" placeholder="Введите сообщение...">
|
||||
<input type="submit" value="Отправить">
|
||||
</form>
|
||||
</footer>
|
||||
</div>
|
||||
<script>
|
||||
$("#game").load("main.php");
|
||||
|
||||
function loadlink() {
|
||||
$('#chat').load('chat.php');
|
||||
}
|
||||
|
||||
loadlink(); // This will run on page load
|
||||
setInterval(function () {
|
||||
loadlink() // this will run after every 5 seconds
|
||||
}, 5000);
|
||||
</script>
|
206
game2.php
206
game2.php
@ -1,206 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (c) 2018.
|
||||
* Author: Igor Barkov <lopar.4ever@gmail.com>
|
||||
* Project name: Battles-Game
|
||||
*/
|
||||
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) header("Location: index.php");
|
||||
//include("config.php");
|
||||
|
||||
//$msg = filter_input(INPUT_POST,'msg');
|
||||
//$uid = $_SESSION['uid'];
|
||||
//if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg);
|
||||
\Battles\Template::header('Окно игры');
|
||||
?>
|
||||
<style>
|
||||
form {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
form input {
|
||||
border: 1px solid silver;
|
||||
width: 80%;
|
||||
margin-right: .5%;
|
||||
}
|
||||
|
||||
form input[type="submit"] {
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
display: grid;
|
||||
height: 100vh;
|
||||
grid-template-rows: 45px /* Шапка */ 2fr /* Окно игры */ 1fr /* Окно чата*/ 30px; /* Подвал */
|
||||
}
|
||||
|
||||
header {
|
||||
text-align: right;
|
||||
box-shadow: 0 3px 2px -2px slategray;
|
||||
}
|
||||
|
||||
footer {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
#game, #chat {
|
||||
overflow: auto;
|
||||
box-shadow: 0 3px 2px -2px slategray;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
a img {
|
||||
border: 1px solid #fff;
|
||||
transition: box-shadow 0.5s ease;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
a img:hover {
|
||||
box-shadow: 0 0 7px slategray;
|
||||
}
|
||||
|
||||
|
||||
.chat {
|
||||
border: 1px solid #333;
|
||||
margin: 15px;
|
||||
width: 40%;
|
||||
height: 70%;
|
||||
background: #555;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.chat-messages {
|
||||
min-height: 93%;
|
||||
max-height: 93%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.chat-messages__content {
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.chat__message {
|
||||
border-left: 3px solid #333;
|
||||
margin-top: 2px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.chat__message_black {
|
||||
border-color: #000;
|
||||
}
|
||||
|
||||
.chat__message_blue {
|
||||
border-color: blue;
|
||||
}
|
||||
|
||||
.chat__message_green {
|
||||
border-color: green;
|
||||
}
|
||||
|
||||
.chat__message_red {
|
||||
border-color: red;
|
||||
}
|
||||
|
||||
.chat-input {
|
||||
min-height: 6%;
|
||||
}
|
||||
|
||||
input {
|
||||
font-family: arial;
|
||||
font-size: 16px;
|
||||
vertical-align: middle;
|
||||
background: #333;
|
||||
color: #fff;
|
||||
border: 0;
|
||||
display: inline-block;
|
||||
margin: 1px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.chat-form__input {
|
||||
width: 79%;
|
||||
}
|
||||
|
||||
.chat-form__submit {
|
||||
width: 18%;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="wrap">
|
||||
<header>
|
||||
Всякие заголовки, кнопки, ссылки, etc...
|
||||
</header>
|
||||
<div id="game"></div>
|
||||
|
||||
<div class='chat'>
|
||||
<div class='chat-messages'>
|
||||
<div class='chat-messages__content' id='messages'>
|
||||
Загрузка...
|
||||
</div>
|
||||
</div>
|
||||
<div class='chat-input'>
|
||||
<form method='post' id='chat-form'>
|
||||
<input id='message-text' class='chat-form__input' placeholder='Введите сообщение'> <input type='submit'
|
||||
class='chat-form__submit'
|
||||
value='=>'>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<script>
|
||||
$("#game").load("main.php");
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var messages__container = document.getElementById('messages');
|
||||
//Контейнер сообщений — скрипт будет добавлять в него сообщения
|
||||
var interval = null; //Переменная с интервалом подгрузки сообщений
|
||||
var sendForm = document.getElementById('chat-form'); //Форма отправки
|
||||
var messageInput = document.getElementById('message-text'); //Инпут для текста сообщения
|
||||
|
||||
function send_request(act, login = null, password = null) {//Основная функция
|
||||
//Переменные, которые будут отправляться
|
||||
var var1 = null;
|
||||
var var2 = null;
|
||||
if (act == 'auth') {
|
||||
//Если нужно авторизоваться, получаем логин и пароль, которые были переданы в функцию
|
||||
var1 = login;
|
||||
var2 = password;
|
||||
} else if (act == 'send') {
|
||||
//Если нужно отправить сообщение, то получаем текст из поля ввода
|
||||
var1 = messageInput.value;
|
||||
}
|
||||
$.post('includes/chat.php', { //Отправляем переменные
|
||||
act: act,
|
||||
var1: var1,
|
||||
var2: var2
|
||||
}).done(function (data) {
|
||||
//Заносим в контейнер ответ от сервера
|
||||
messages__container.innerHTML = data;
|
||||
if (act == 'send') {
|
||||
//Если нужно было отправить сообщение, очищаем поле ввода
|
||||
messageInput.value = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function update() {
|
||||
send_request('load');
|
||||
}
|
||||
|
||||
interval = setInterval(update, 500);
|
||||
|
||||
//отлавливается событие отправки формы — это поможет отказаться от обновления страницы:
|
||||
sendForm.onsubmit = function () {
|
||||
send_request('send');
|
||||
return false; //Возвращаем ложь, чтобы остановить классическую отправку формы
|
||||
};
|
||||
</script>
|
16
gotzamok.php
16
gotzamok.php
@ -1,20 +1,8 @@
|
||||
<?php /** @noinspection SqlResolve */
|
||||
/* Разрушенный замок на замковой улице.
|
||||
* */
|
||||
<?php
|
||||
/* Разрушенный замок на замковой улице. */
|
||||
session_start();
|
||||
define("CASTLE_MAX_LEVEL", 10);
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once 'functions.php';
|
||||
|
||||
if (!($user->room >= 37 && $user->room <= 41)) {
|
||||
header("Location: main.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$castleOwners = db::c()->query('SELECT * FROM `clans` WHERE `short` = (SELECT * FROM `variables` WHERE `var` = "?s")', 'gotzamok');
|
||||
|
||||
if ($castleOwners['id'] == $user['klan']) {
|
||||
|
15
hell.php
15
hell.php
@ -1,20 +1,7 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!$_SESSION['uid']) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
require_once "functions.php";
|
||||
$user = $user ?? [];
|
||||
if ($user->room != 401) {
|
||||
header("Location: main.php");
|
||||
exit;
|
||||
}
|
||||
if ($user->battle) {
|
||||
header('Location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$user = $user ?? new \Battles\User($_SESSION['uid']);
|
||||
class hellround
|
||||
{
|
||||
|
||||
|
@ -1,10 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
include('config.php');
|
||||
require_once 'config.php';
|
||||
$user = new \Battles\User($_SESSION['uid']);
|
||||
$hostel = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `type`, `time` FROM `hostel` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
|
||||
#include('functions.php');
|
||||
|
@ -1,9 +1,5 @@
|
||||
<?
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
require_once "functions.php";
|
||||
$hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
|
||||
$base = [1 => [8, 16, 24, 32], 2 => [15, 30, 45, 60], 3 => [25, 50, 75, 100], 4 => [40, 80, 120, 160]];
|
||||
|
@ -1,9 +1,5 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
require_once "functions.php";
|
||||
|
||||
$d = mysql_fetch_array(mysql_query("SELECT SUM(`massa`) AS `mass` FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0 AND `setsale` = 0"));
|
||||
|
8
lab.php
8
lab.php
@ -1,11 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
include "functions.php";
|
||||
require_once "functions.php";
|
||||
if ($user['lab'] == 0) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
@ -18,6 +13,7 @@ $u_res = mysql_fetch_array(mysql_query("select * from `lab_user` where `id_user`
|
||||
function cut() {
|
||||
document.getElementById('buy').disabled = 'disabled';
|
||||
}
|
||||
|
||||
setTimeout("document.all['b1'].disabled=false;document.all['b2'].disabled=false;document.all['b3'].disabled=false;document.all['b4'].disabled=false;", <?=(3 - $tt)?>000);
|
||||
</script>
|
||||
|
||||
|
6
lab2.php
6
lab2.php
@ -1,10 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
include "functions.php";
|
||||
require_once "functions.php";
|
||||
if ($user['lab'] == 0) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
|
836
lab_enter.php
836
lab_enter.php
@ -1,306 +1,301 @@
|
||||
<?php
|
||||
ob_start("ob_gzhandler");
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
require_once "functions.php";
|
||||
$errkom = '';
|
||||
if ($user->room == 1051) {
|
||||
mysql_query('DELETE FROM `laba_zv` WHERE `time` < "' . (time() - 1 * 60 * 60) . '"');
|
||||
$var = mysql_fetch_array(mysql_query('SELECT `id`, `vals` FROM `actions` WHERE `vals` > "' . time() . '" AND `uid` = "' . $user['id'] . '" AND `vars` = "go_labirint" LIMIT 1'));
|
||||
$zv = mysql_fetch_array(mysql_query('SELECT * FROM `laba_zv` WHERE `uid1` = "' . $user['id'] . '" OR `uid2` = "' . $user['id'] . '" OR `uid3` = "' . $user['id'] . '" OR `uid4` = "' . $user['id'] . '" LIMIT 1'));
|
||||
$re = '';
|
||||
if (isset($_GET['exitlaba'])) {
|
||||
if (isset($zv['id'])) {
|
||||
$re = 'Подали заявку и убегаем? Не хорошо!';
|
||||
mysql_query('DELETE FROM `laba_zv` WHERE `time` < "' . (time() - 1 * 60 * 60) . '"');
|
||||
$var = mysql_fetch_array(mysql_query('SELECT `id`, `vals` FROM `actions` WHERE `vals` > "' . time() . '" AND `uid` = "' . $user['id'] . '" AND `vars` = "go_labirint" LIMIT 1'));
|
||||
$zv = mysql_fetch_array(mysql_query('SELECT * FROM `laba_zv` WHERE `uid1` = "' . $user['id'] . '" OR `uid2` = "' . $user['id'] . '" OR `uid3` = "' . $user['id'] . '" OR `uid4` = "' . $user['id'] . '" LIMIT 1'));
|
||||
$re = '';
|
||||
if (isset($_GET['exitlaba'])) {
|
||||
if (isset($zv['id'])) {
|
||||
$re = 'Подали заявку и убегаем? Не хорошо!';
|
||||
} else {
|
||||
mysql_query("UPDATE `users`, `online` SET `users`.`room` = '2601', `online`.`room` = '2601' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$user['id']}'");
|
||||
header('Location: city.php');
|
||||
}
|
||||
} elseif (isset($_GET['pz1'])) {
|
||||
if (isset($zv['id'])) {
|
||||
$re = 'Вы уже подали заявку...';
|
||||
} else {
|
||||
if ($user['level'] < 4) {
|
||||
$re = 'Персонажам до 4-го уровня запрещается посещать лабиринт!';
|
||||
} elseif (isset($var['id'])) {
|
||||
$tm = timeOut($var['vals'] - time());
|
||||
$re = 'Следующий поход через: ' . $tm;
|
||||
} else {
|
||||
mysql_query("UPDATE `users`, `online` SET `users`.`room` = '2601', `online`.`room` = '2601' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$user['id']}'");
|
||||
header('Location: city.php');
|
||||
}
|
||||
} elseif (isset($_GET['pz1'])) {
|
||||
if (isset($zv['id'])) {
|
||||
$re = 'Вы уже подали заявку...';
|
||||
} else {
|
||||
if ($user['level'] < 4) {
|
||||
$re = 'Персонажам до 4-го уровня запрещается посещать лабиринт!';
|
||||
} elseif (isset($var['id'])) {
|
||||
$tm = timeOut($var['vals'] - time());
|
||||
$re = 'Следующий поход через: ' . $tm;
|
||||
$_POST['type_gors'] = (int)$_POST['type_gors'];
|
||||
if ($_POST['type_gors'] == 0 && $user['level'] > 6) {
|
||||
$re = 'Лабиринт для новичков доступен для 4-6 уровней!';
|
||||
} elseif ($_POST['type_gors'] == 1 && $user['level'] < 7) {
|
||||
$re = 'Лабиринт для опытных доступен с 7 уровня!';
|
||||
} elseif ($_POST['type_gors'] == 2 && ($user['level'] < 9 || $user['rep_laba'] < 20000)) {
|
||||
$re = 'Легендарный Лабиринт доступен с 9 уровня!<br />Так-же требуется 20000 репутации Лабиринтов! У Вас : ' . $user['rep_laba'] . ' репутации Лабиринтов.';
|
||||
} else {
|
||||
$_POST['type_gors'] = (int)$_POST['type_gors'];
|
||||
if ($_POST['type_gors'] == 0 && $user['level'] > 6) {
|
||||
$re = 'Лабиринт для новичков доступен для 4-6 уровней!';
|
||||
} elseif ($_POST['type_gors'] == 1 && $user['level'] < 7) {
|
||||
$re = 'Лабиринт для опытных доступен с 7 уровня!';
|
||||
} elseif ($_POST['type_gors'] == 2 && ($user['level'] < 9 || $user['rep_laba'] < 20000)) {
|
||||
$re = 'Легендарный Лабиринт доступен с 9 уровня!<br />Так-же требуется 20000 репутации Лабиринтов! У Вас : ' . $user['rep_laba'] . ' репутации Лабиринтов.';
|
||||
} else {
|
||||
mysql_query('INSERT INTO `laba_zv` (`uid1`, `time`, `com`, `pass`, `type`, `level`) VALUES ("' . $user['id'] . '", "' . time() . '", "' . mysql_real_escape_string(htmlspecialchars($_POST['text'])) . '", "' . mysql_real_escape_string($_POST['text']) . '", "' . mysql_real_escape_string($_POST['type_gors']) . '", "' . $user['level'] . '")');
|
||||
header('Location: lab_enter.php');
|
||||
}
|
||||
mysql_query('INSERT INTO `laba_zv` (`uid1`, `time`, `com`, `pass`, `type`, `level`) VALUES ("' . $user['id'] . '", "' . time() . '", "' . mysql_real_escape_string(htmlspecialchars($_POST['text'])) . '", "' . mysql_real_escape_string($_POST['text']) . '", "' . mysql_real_escape_string($_POST['type_gors']) . '", "' . $user['level'] . '")');
|
||||
header('Location: lab_enter.php');
|
||||
}
|
||||
}
|
||||
} elseif (isset($_GET['cancelzv'])) {
|
||||
if (!isset($zv['id'])) {
|
||||
$re = 'Вы не участвуете ни в одной из заявок!<br />';
|
||||
} else {
|
||||
$i = 1;
|
||||
$j = 4;
|
||||
$k = 0;
|
||||
$h = 0;
|
||||
while ($i <= 4) {
|
||||
if ($k == 0 && $zv['uid' . $i] != $user['id']) {
|
||||
$k = $zv['uid' . $i];
|
||||
$h = $i;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$i = 1;
|
||||
while ($i <= 4) {
|
||||
if ($zv['uid' . $i] == $user['id']) {
|
||||
if ($i > 1) {
|
||||
$zv['uid' . $i] = 0;
|
||||
} else {
|
||||
$zv['uid' . $i] = $k;
|
||||
$zv['uid' . $h] = 0;
|
||||
}
|
||||
}
|
||||
if ($zv['uid' . $i] == 0) {
|
||||
$j--;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if ($j < 1) {
|
||||
mysql_query('DELETE FROM `laba_zv` WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
|
||||
} else {
|
||||
mysql_query('UPDATE `laba_zv` SET `uid1` = "' . $zv['uid1'] . '", `uid2` = "' . $zv['uid2'] . '", `uid3` = "' . $zv['uid3'] . '", `uid4` = "' . $zv['uid4'] . '" WHERE `id` = "' . $zv['id'] . '" lIMIT 1');
|
||||
}
|
||||
$re = 'Заявка успешно отменена!<br />';
|
||||
unset($zv);
|
||||
}
|
||||
} elseif (isset($_GET['priemzv'])) {
|
||||
if (isset($zv['id'])) {
|
||||
$re = 'Вы уже состоите в одной из заявок!';
|
||||
} else {
|
||||
$tozv = mysql_fetch_array(mysql_query('SELECT * FROM `laba_zv` WHERE `id` = "' . mysql_real_escape_string($_GET['priemzv']) . '" LIMIT 1'));
|
||||
if (!isset($tozv['id'])) {
|
||||
$re = 'Заявка не найдена!';
|
||||
} elseif (isset($var['id'])) {
|
||||
$tm = timeOut($var['vals'] - time());
|
||||
$re = 'Следующий поход через: ' . $tm;
|
||||
} else {
|
||||
if ($tozv['uid1'] > 0 && $tozv['uid2'] > 0 && $tozv['uid3'] > 0 && $tozv['uid4'] > 0) {
|
||||
$re = 'В заявке нет свободных мест!';
|
||||
} else {
|
||||
$i = 1;
|
||||
$j = 0;
|
||||
while ($i <= 4) {
|
||||
if ($tozv['uid' . $i] == 0 && $j == 0) {
|
||||
$j = $i;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
mysql_query('UPDATE `laba_zv` SET `uid' . $j . '` = "' . $user['id'] . '" WHERE `id` = "' . $tozv['id'] . '" LIMIT 1');
|
||||
header('Location: lab_enter.php');
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif (isset($_GET['startzv'])) {
|
||||
if (!isset($zv['id'])) {
|
||||
$re = 'Вы должны сначала подать заявку!';
|
||||
} elseif ($zv['uid1'] != $user['id']) {
|
||||
$re = 'Вы должны являться лидером группы!';
|
||||
} else {
|
||||
if ($zv['type'] == 0) {
|
||||
$level = 5;
|
||||
} elseif ($zv['type'] == 1) {
|
||||
$level = 8;
|
||||
} elseif ($zv['type'] == 2) {
|
||||
$level = 10;
|
||||
}
|
||||
|
||||
$k = floor(2.5 * $level);
|
||||
$s = $k * 2 + 3;
|
||||
$r = 10;
|
||||
$count = 1;
|
||||
$a = [];
|
||||
for ($y = 0; $y < $s; $y++) {
|
||||
for ($x = 0; $x < $s; $x++) {
|
||||
$a[$y][$x] = 1;
|
||||
}
|
||||
}
|
||||
for ($x = 0; $x < $s; $x++) {
|
||||
$a[0][$x] = 0;
|
||||
$a[$s - 1][$x] = 0;
|
||||
$a[$x][0] = 0;
|
||||
$a[$x][$s - 1] = 0;
|
||||
}
|
||||
$x = $y = ($k - 1) >> 1;
|
||||
$a[$y * 2 + 2][$x * 2 + 2] = 0;
|
||||
while (1) {
|
||||
do {
|
||||
$d = rand(0, 3);
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
if ($d == 0 && $a[$y * 2 + 2][$x * 2 + 4]) {
|
||||
$a[$y * 2 + 2][$x++ * 2 + 3] = 0;
|
||||
$a[$y * 2 + 2][$x * 2 + 2] = 0;
|
||||
$i = 5;
|
||||
$count++;
|
||||
break;
|
||||
} elseif ($d == 1 && $a[$y * 2][$x * 2 + 2]) {
|
||||
$a[$y-- * 2 + 1][$x * 2 + 2] = 0;
|
||||
$a[$y * 2 + 2][$x * 2 + 2] = 0;
|
||||
$i = 5;
|
||||
$count++;
|
||||
break;
|
||||
} elseif ($d == 2 && $a[$y * 2 + 2][$x * 2]) {
|
||||
$a[$y * 2 + 2][$x-- * 2 + 1] = 0;
|
||||
$a[$y * 2 + 2][$x * 2 + 2] = 0;
|
||||
$i = 5;
|
||||
$count++;
|
||||
break;
|
||||
} elseif ($d == 3 && $a[$y * 2 + 4][$x * 2 + 2]) {
|
||||
$a[$y++ * 2 + 3][$x * 2 + 2] = 0;
|
||||
$a[$y * 2 + 2][$x * 2 + 2] = 0;
|
||||
$i = 5;
|
||||
$count++;
|
||||
break;
|
||||
}
|
||||
$d = ($d + 1) % 4;
|
||||
}
|
||||
} while ($i != 4);
|
||||
if ($count >= $k * $k) {
|
||||
break;
|
||||
}
|
||||
$x = rand(0, $k - 1);
|
||||
$y = rand(0, $k - 1);
|
||||
while ($a[$y * 2 + 2][$x * 2 + 2] || !$a[$y * 2 + 2][$x * 2 + 4] && !$a[$y * 2][$x * 2 + 2] && !$a[$y * 2 + 2][$x * 2] && !$a[$y * 2 + 4][$x * 2 + 2]) {
|
||||
if (++$x >= $k) {
|
||||
$x = 0;
|
||||
if (++$y >= $k) {
|
||||
$y = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$rnds = [rand(1, 3), rand(1, 3)];
|
||||
$srg = [];
|
||||
$objects = [];
|
||||
if ($rnds[0] == 1) {
|
||||
$a[2][1] = 0;
|
||||
$a[2][2] = 0;
|
||||
$srg = [2, 1];
|
||||
$objects[2][1] = '<div title="Вход в подземелье" class="ddpStart"></div>';
|
||||
} elseif ($rnds[0] == 2) {
|
||||
$a[$k][1] = 0;
|
||||
$a[$k][2] = 0;
|
||||
$srg = [$k, 1];
|
||||
$objects[$k][1] = '<div title="Вход в подземелье" class="ddpStart"></div>';
|
||||
} elseif ($rnds[0] == 3) {
|
||||
$a[$k * 2][1] = 0;
|
||||
$a[$k * 2][2] = 0;
|
||||
$srg = [$k * 2, 1];
|
||||
$objects[$k * 2][1] = '<div title="Вход в подземелье" class="ddpStart"></div>';
|
||||
}
|
||||
|
||||
if ($rnds[1] == 1) {
|
||||
$a[2][$k * 2 + 1] = 0;
|
||||
$a[2][$k * 2] = 0;
|
||||
$objects[2][$k * 2 + 1] = '<div title="Выход из подземелье" class="ddpExit"></div>';
|
||||
} elseif ($rnds[1] == 2) {
|
||||
$a[$k][$k * 2 + 1] = 0;
|
||||
$a[$k][$k * 2] = 0;
|
||||
$objects[$k][$k * 2 + 1] = '<div title="Выход из подземелье" class="ddpExit"></div>';
|
||||
} elseif ($rnds[1] == 3) {
|
||||
$a[$k * 2][$k * 2 + 1] = 0;
|
||||
$a[$k * 2][$k * 2] = 0;
|
||||
$objects[$k * 2][$k * 2 + 1] = '<div title="Выход из подземелье" class="ddpExit"></div>';
|
||||
}
|
||||
|
||||
$map = [];
|
||||
$i = 1;
|
||||
while ($i < count($a) - 1) {
|
||||
$j = 1;
|
||||
while ($j < count($a[$i]) - 1) {
|
||||
if ($a[$i][$j] == 0 && $i > 1 && $j > 1 && $i <= $k * 2 && $j <= $k * 2) {
|
||||
$map[] = [$i, $j];
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$proc1 = round(1.7 * $level); //Сколько % занимают сундуки
|
||||
$proc2 = round(2.5 * $level); //Сколько % занимают монстры
|
||||
$proc3 = round(1.35 * $level); //Сколько % занимают хилки
|
||||
$proc4 = round(0.5 * $level); //Сколько % занимают ловушки
|
||||
$proc5 = round(0.1 * $level); //Сколько % занимают пандоры
|
||||
$proc6 = round(0.2 * $level); // Сколько занимает Антидот
|
||||
|
||||
$proc1 = round($proc1 / 2);
|
||||
$proc1 = round(count($map) / 100 * $proc1);
|
||||
$proc2 = round($proc2 / 2);
|
||||
$proc2 = round(count($map) / 100 * $proc2);
|
||||
$proc3 = round($proc3 / 2);
|
||||
$proc3 = round(count($map) / 100 * $proc3);
|
||||
$proc4 = round($proc4 / 2);
|
||||
$proc4 = round(count($map) / 100 * $proc4);
|
||||
$proc5 = round($proc5 / 2);
|
||||
$proc5 = round(count($map) / 100 * $proc5);
|
||||
$proc6 = round($proc6 / 2);
|
||||
$proc6 = round(count($map) / 100 * $proc6);
|
||||
|
||||
$usi = 0;
|
||||
mysql_query('INSERT INTO `laba_now` (`time`, `uid`, `users`, `map_id`, `end`, `type`) VALUES ("' . time() . '", "' . $user['id'] . '", "-1", "0", "0", "' . $zv['type'] . '")');
|
||||
$ding = mysql_insert_id();
|
||||
$i = 1;
|
||||
while ($i <= 4) {
|
||||
if ($zv['uid' . $i] > 0) {
|
||||
$plu = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `id` = "' . $zv['uid' . $i] . '" LIMIT 1'));
|
||||
if (isset($plu['id'])) {
|
||||
mysql_query("UPDATE `users`, `online` SET `users`.`room` = '1052', `online`.`room` = '1052', `users`.`x` = '" . $srg[0] . "', `users`.`y` = '" . $srg[1] . "', `users`.`xf` = '" . $srg[0] . "', `users`.`yr` = '" . $srg[1] . "', `users`.`laba` = '" . $ding . "' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $plu['id'] . "'");
|
||||
$usi++;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
mysql_query('UPDATE `laba_now` SET `users` = "' . $usi . '" WHERE `id` = "' . $ding . '" LIMIT 1');
|
||||
mysql_query('INSERT INTO `laba_map` (`id`, `data`, `update`) VALUES ("' . $ding . '", "' . json_encode($a) . '", "' . time() . '")');
|
||||
mysql_query('DELETE FROM `laba_zv` WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
|
||||
|
||||
$i = 1;
|
||||
while ($i <= 6) {
|
||||
if (${'proc' . $i} > 0) {
|
||||
$j = 0;
|
||||
while ($j < ${'proc' . $i}) {
|
||||
$cord = $map[rand(0, count($map) - 1)];
|
||||
$obj = '';
|
||||
if ($i == 1) {
|
||||
$obj = 'ddp1s';
|
||||
} elseif ($i == 2) {
|
||||
$obj = 'ddp1m';
|
||||
} elseif ($i == 3) {
|
||||
$obj = 'ddp1h';
|
||||
} elseif ($i == 4) {
|
||||
$obj = 'ddp1l';
|
||||
} elseif ($i == 5) {
|
||||
$obj = 'ddp1p';
|
||||
} elseif ($i == 6) {
|
||||
$obj = 'ddp1a';
|
||||
}
|
||||
mysql_query('INSERT INTO `laba_obj` (`lib`, `x`, `y`, `type`, `img`, `name`, `time`, `use`) VALUES ("' . $ding . '", "' . $cord[0] . '", "' . $cord[1] . '", "' . $i . '", "' . $obj . '", "{standart}", "' . time() . '", "0")');
|
||||
$j++;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
mysql_query('DELETE FROM `laba_zv` WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
|
||||
header('Location: labirint.php');
|
||||
}
|
||||
}
|
||||
\Battles\Template::header('Вход в Лабиринты');
|
||||
?>
|
||||
} elseif (isset($_GET['cancelzv'])) {
|
||||
if (!isset($zv['id'])) {
|
||||
$re = 'Вы не участвуете ни в одной из заявок!<br />';
|
||||
} else {
|
||||
$i = 1;
|
||||
$j = 4;
|
||||
$k = 0;
|
||||
$h = 0;
|
||||
while ($i <= 4) {
|
||||
if ($k == 0 && $zv['uid' . $i] != $user['id']) {
|
||||
$k = $zv['uid' . $i];
|
||||
$h = $i;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$i = 1;
|
||||
while ($i <= 4) {
|
||||
if ($zv['uid' . $i] == $user['id']) {
|
||||
if ($i > 1) {
|
||||
$zv['uid' . $i] = 0;
|
||||
} else {
|
||||
$zv['uid' . $i] = $k;
|
||||
$zv['uid' . $h] = 0;
|
||||
}
|
||||
}
|
||||
if ($zv['uid' . $i] == 0) {
|
||||
$j--;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if ($j < 1) {
|
||||
mysql_query('DELETE FROM `laba_zv` WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
|
||||
} else {
|
||||
mysql_query('UPDATE `laba_zv` SET `uid1` = "' . $zv['uid1'] . '", `uid2` = "' . $zv['uid2'] . '", `uid3` = "' . $zv['uid3'] . '", `uid4` = "' . $zv['uid4'] . '" WHERE `id` = "' . $zv['id'] . '" lIMIT 1');
|
||||
}
|
||||
$re = 'Заявка успешно отменена!<br />';
|
||||
unset($zv);
|
||||
}
|
||||
} elseif (isset($_GET['priemzv'])) {
|
||||
if (isset($zv['id'])) {
|
||||
$re = 'Вы уже состоите в одной из заявок!';
|
||||
} else {
|
||||
$tozv = mysql_fetch_array(mysql_query('SELECT * FROM `laba_zv` WHERE `id` = "' . mysql_real_escape_string($_GET['priemzv']) . '" LIMIT 1'));
|
||||
if (!isset($tozv['id'])) {
|
||||
$re = 'Заявка не найдена!';
|
||||
} elseif (isset($var['id'])) {
|
||||
$tm = timeOut($var['vals'] - time());
|
||||
$re = 'Следующий поход через: ' . $tm;
|
||||
} else {
|
||||
if ($tozv['uid1'] > 0 && $tozv['uid2'] > 0 && $tozv['uid3'] > 0 && $tozv['uid4'] > 0) {
|
||||
$re = 'В заявке нет свободных мест!';
|
||||
} else {
|
||||
$i = 1;
|
||||
$j = 0;
|
||||
while ($i <= 4) {
|
||||
if ($tozv['uid' . $i] == 0 && $j == 0) {
|
||||
$j = $i;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
mysql_query('UPDATE `laba_zv` SET `uid' . $j . '` = "' . $user['id'] . '" WHERE `id` = "' . $tozv['id'] . '" LIMIT 1');
|
||||
header('Location: lab_enter.php');
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif (isset($_GET['startzv'])) {
|
||||
if (!isset($zv['id'])) {
|
||||
$re = 'Вы должны сначала подать заявку!';
|
||||
} elseif ($zv['uid1'] != $user['id']) {
|
||||
$re = 'Вы должны являться лидером группы!';
|
||||
} else {
|
||||
if ($zv['type'] == 0) {
|
||||
$level = 5;
|
||||
} elseif ($zv['type'] == 1) {
|
||||
$level = 8;
|
||||
} elseif ($zv['type'] == 2) {
|
||||
$level = 10;
|
||||
}
|
||||
|
||||
$k = floor(2.5 * $level);
|
||||
$s = $k * 2 + 3;
|
||||
$r = 10;
|
||||
$count = 1;
|
||||
$a = [];
|
||||
for ($y = 0; $y < $s; $y++) {
|
||||
for ($x = 0; $x < $s; $x++) {
|
||||
$a[$y][$x] = 1;
|
||||
}
|
||||
}
|
||||
for ($x = 0; $x < $s; $x++) {
|
||||
$a[0][$x] = 0;
|
||||
$a[$s - 1][$x] = 0;
|
||||
$a[$x][0] = 0;
|
||||
$a[$x][$s - 1] = 0;
|
||||
}
|
||||
$x = $y = ($k - 1) >> 1;
|
||||
$a[$y * 2 + 2][$x * 2 + 2] = 0;
|
||||
while (1) {
|
||||
do {
|
||||
$d = rand(0, 3);
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
if ($d == 0 && $a[$y * 2 + 2][$x * 2 + 4]) {
|
||||
$a[$y * 2 + 2][$x++ * 2 + 3] = 0;
|
||||
$a[$y * 2 + 2][$x * 2 + 2] = 0;
|
||||
$i = 5;
|
||||
$count++;
|
||||
break;
|
||||
} elseif ($d == 1 && $a[$y * 2][$x * 2 + 2]) {
|
||||
$a[$y-- * 2 + 1][$x * 2 + 2] = 0;
|
||||
$a[$y * 2 + 2][$x * 2 + 2] = 0;
|
||||
$i = 5;
|
||||
$count++;
|
||||
break;
|
||||
} elseif ($d == 2 && $a[$y * 2 + 2][$x * 2]) {
|
||||
$a[$y * 2 + 2][$x-- * 2 + 1] = 0;
|
||||
$a[$y * 2 + 2][$x * 2 + 2] = 0;
|
||||
$i = 5;
|
||||
$count++;
|
||||
break;
|
||||
} elseif ($d == 3 && $a[$y * 2 + 4][$x * 2 + 2]) {
|
||||
$a[$y++ * 2 + 3][$x * 2 + 2] = 0;
|
||||
$a[$y * 2 + 2][$x * 2 + 2] = 0;
|
||||
$i = 5;
|
||||
$count++;
|
||||
break;
|
||||
}
|
||||
$d = ($d + 1) % 4;
|
||||
}
|
||||
} while ($i != 4);
|
||||
if ($count >= $k * $k) {
|
||||
break;
|
||||
}
|
||||
$x = rand(0, $k - 1);
|
||||
$y = rand(0, $k - 1);
|
||||
while ($a[$y * 2 + 2][$x * 2 + 2] || !$a[$y * 2 + 2][$x * 2 + 4] && !$a[$y * 2][$x * 2 + 2] && !$a[$y * 2 + 2][$x * 2] && !$a[$y * 2 + 4][$x * 2 + 2]) {
|
||||
if (++$x >= $k) {
|
||||
$x = 0;
|
||||
if (++$y >= $k) {
|
||||
$y = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$rnds = [rand(1, 3), rand(1, 3)];
|
||||
$srg = [];
|
||||
$objects = [];
|
||||
if ($rnds[0] == 1) {
|
||||
$a[2][1] = 0;
|
||||
$a[2][2] = 0;
|
||||
$srg = [2, 1];
|
||||
$objects[2][1] = '<div title="Вход в подземелье" class="ddpStart"></div>';
|
||||
} elseif ($rnds[0] == 2) {
|
||||
$a[$k][1] = 0;
|
||||
$a[$k][2] = 0;
|
||||
$srg = [$k, 1];
|
||||
$objects[$k][1] = '<div title="Вход в подземелье" class="ddpStart"></div>';
|
||||
} elseif ($rnds[0] == 3) {
|
||||
$a[$k * 2][1] = 0;
|
||||
$a[$k * 2][2] = 0;
|
||||
$srg = [$k * 2, 1];
|
||||
$objects[$k * 2][1] = '<div title="Вход в подземелье" class="ddpStart"></div>';
|
||||
}
|
||||
|
||||
if ($rnds[1] == 1) {
|
||||
$a[2][$k * 2 + 1] = 0;
|
||||
$a[2][$k * 2] = 0;
|
||||
$objects[2][$k * 2 + 1] = '<div title="Выход из подземелье" class="ddpExit"></div>';
|
||||
} elseif ($rnds[1] == 2) {
|
||||
$a[$k][$k * 2 + 1] = 0;
|
||||
$a[$k][$k * 2] = 0;
|
||||
$objects[$k][$k * 2 + 1] = '<div title="Выход из подземелье" class="ddpExit"></div>';
|
||||
} elseif ($rnds[1] == 3) {
|
||||
$a[$k * 2][$k * 2 + 1] = 0;
|
||||
$a[$k * 2][$k * 2] = 0;
|
||||
$objects[$k * 2][$k * 2 + 1] = '<div title="Выход из подземелье" class="ddpExit"></div>';
|
||||
}
|
||||
|
||||
$map = [];
|
||||
$i = 1;
|
||||
while ($i < count($a) - 1) {
|
||||
$j = 1;
|
||||
while ($j < count($a[$i]) - 1) {
|
||||
if ($a[$i][$j] == 0 && $i > 1 && $j > 1 && $i <= $k * 2 && $j <= $k * 2) {
|
||||
$map[] = [$i, $j];
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$proc1 = round(1.7 * $level); //Сколько % занимают сундуки
|
||||
$proc2 = round(2.5 * $level); //Сколько % занимают монстры
|
||||
$proc3 = round(1.35 * $level); //Сколько % занимают хилки
|
||||
$proc4 = round(0.5 * $level); //Сколько % занимают ловушки
|
||||
$proc5 = round(0.1 * $level); //Сколько % занимают пандоры
|
||||
$proc6 = round(0.2 * $level); // Сколько занимает Антидот
|
||||
|
||||
$proc1 = round($proc1 / 2);
|
||||
$proc1 = round(count($map) / 100 * $proc1);
|
||||
$proc2 = round($proc2 / 2);
|
||||
$proc2 = round(count($map) / 100 * $proc2);
|
||||
$proc3 = round($proc3 / 2);
|
||||
$proc3 = round(count($map) / 100 * $proc3);
|
||||
$proc4 = round($proc4 / 2);
|
||||
$proc4 = round(count($map) / 100 * $proc4);
|
||||
$proc5 = round($proc5 / 2);
|
||||
$proc5 = round(count($map) / 100 * $proc5);
|
||||
$proc6 = round($proc6 / 2);
|
||||
$proc6 = round(count($map) / 100 * $proc6);
|
||||
|
||||
$usi = 0;
|
||||
mysql_query('INSERT INTO `laba_now` (`time`, `uid`, `users`, `map_id`, `end`, `type`) VALUES ("' . time() . '", "' . $user['id'] . '", "-1", "0", "0", "' . $zv['type'] . '")');
|
||||
$ding = mysql_insert_id();
|
||||
$i = 1;
|
||||
while ($i <= 4) {
|
||||
if ($zv['uid' . $i] > 0) {
|
||||
$plu = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `id` = "' . $zv['uid' . $i] . '" LIMIT 1'));
|
||||
if (isset($plu['id'])) {
|
||||
mysql_query("UPDATE `users`, `online` SET `users`.`room` = '1052', `online`.`room` = '1052', `users`.`x` = '" . $srg[0] . "', `users`.`y` = '" . $srg[1] . "', `users`.`xf` = '" . $srg[0] . "', `users`.`yr` = '" . $srg[1] . "', `users`.`laba` = '" . $ding . "' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $plu['id'] . "'");
|
||||
$usi++;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
mysql_query('UPDATE `laba_now` SET `users` = "' . $usi . '" WHERE `id` = "' . $ding . '" LIMIT 1');
|
||||
mysql_query('INSERT INTO `laba_map` (`id`, `data`, `update`) VALUES ("' . $ding . '", "' . json_encode($a) . '", "' . time() . '")');
|
||||
mysql_query('DELETE FROM `laba_zv` WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
|
||||
|
||||
$i = 1;
|
||||
while ($i <= 6) {
|
||||
if (${'proc' . $i} > 0) {
|
||||
$j = 0;
|
||||
while ($j < ${'proc' . $i}) {
|
||||
$cord = $map[rand(0, count($map) - 1)];
|
||||
$obj = '';
|
||||
if ($i == 1) {
|
||||
$obj = 'ddp1s';
|
||||
} elseif ($i == 2) {
|
||||
$obj = 'ddp1m';
|
||||
} elseif ($i == 3) {
|
||||
$obj = 'ddp1h';
|
||||
} elseif ($i == 4) {
|
||||
$obj = 'ddp1l';
|
||||
} elseif ($i == 5) {
|
||||
$obj = 'ddp1p';
|
||||
} elseif ($i == 6) {
|
||||
$obj = 'ddp1a';
|
||||
}
|
||||
mysql_query('INSERT INTO `laba_obj` (`lib`, `x`, `y`, `type`, `img`, `name`, `time`, `use`) VALUES ("' . $ding . '", "' . $cord[0] . '", "' . $cord[1] . '", "' . $i . '", "' . $obj . '", "{standart}", "' . time() . '", "0")');
|
||||
$j++;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
mysql_query('DELETE FROM `laba_zv` WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
|
||||
header('Location: labirint.php');
|
||||
}
|
||||
}
|
||||
\Battles\Template::header('Вход в Лабиринты');
|
||||
?>
|
||||
<div style="float: right;">
|
||||
<input type="button" onclick="location.href='lab_enter.php';" value="Обновить">
|
||||
<input type="button" onclick="location.href='?exitlaba=1';" value="Покинуть вход">
|
||||
@ -308,146 +303,145 @@ if ($user->room == 1051) {
|
||||
<div style="padding-left: 0;" align="center">
|
||||
<h3>Вход в Лабиринты</h3>
|
||||
</div>
|
||||
<?
|
||||
if (isset($_GET['del_com'])) {
|
||||
if ($user->admin) {
|
||||
mysql_query('UPDATE `laba_zv` SET `com` = "" WHERE `id` = "' . (int)$_GET['del_com'] . '" LIMIT 1');
|
||||
$re = 'Комментарий удалён';
|
||||
} else {
|
||||
$re = 'Вы не можете удалять комментарии.';
|
||||
}
|
||||
<?
|
||||
if (isset($_GET['del_com'])) {
|
||||
if ($user->admin) {
|
||||
mysql_query('UPDATE `laba_zv` SET `com` = "" WHERE `id` = "' . (int)$_GET['del_com'] . '" LIMIT 1');
|
||||
$re = 'Комментарий удалён';
|
||||
} else {
|
||||
$re = 'Вы не можете удалять комментарии.';
|
||||
}
|
||||
}
|
||||
|
||||
if ($user['level'] >= 4) {
|
||||
if (isset($_GET['quest'])) {
|
||||
$q2 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "' . $user['id'] . '" AND `cancel` = "0" AND `finish` = "0" LIMIT 1'));
|
||||
if (!isset($q2['id'])) {
|
||||
$q3 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "' . $user['id'] . '" AND (`cancel` > "' . time() . '" OR `finish` > "' . time() . '") LIMIT 1'));
|
||||
if (isset($q3['id'])) {
|
||||
if ($q3['cancel'] > time()) {
|
||||
$tm = timeOut($q3['cancel'] - time());
|
||||
} else {
|
||||
$tm = timeOut($q3['finish'] - time());
|
||||
}
|
||||
$re = 'Нельзя брать задания так часто, разрешенный лимит: Один раз в 12 часов.<br /> Следующее задание можно взять через : ' . $tm;
|
||||
} else {
|
||||
$rand = [];
|
||||
$sp = mysql_query('SELECT `id`, `name` FROM `qst` WHERE `level` = "' . $user['level'] . '"');
|
||||
while ($pl = mysql_fetch_array($sp)) {
|
||||
$rand[] = $pl;
|
||||
}
|
||||
$rand = $rand[rand(0, count($rand) - 1)];
|
||||
if ($rand['id'] > 0) {
|
||||
$re = 'Вы успешно взяли задание "' . $rand['name'] . '"!<br />';
|
||||
mysql_query('INSERT INTO `qst_user` (`uid`, `time`, `qid`) VALUES ("' . $user['id'] . '", "' . time() . '", "' . $rand['id'] . '")');
|
||||
} else {
|
||||
$re = 'Неудалось взять задание, нет подходящих заданий у Хранителя Лабиринта<br />';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$re = 'У вас уже есть задание.';
|
||||
}
|
||||
}
|
||||
|
||||
if ($user['level'] >= 4) {
|
||||
if (isset($_GET['quest'])) {
|
||||
$q2 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "' . $user['id'] . '" AND `cancel` = "0" AND `finish` = "0" LIMIT 1'));
|
||||
$q1 = mysql_fetch_array(mysql_query('SELECT * FROM `qst` WHERE `id` = "' . $q2['qid'] . '" LIMIT 1'));
|
||||
|
||||
if (isset($q2['id']) && isset($_GET['cancelqst'])) {
|
||||
mysql_query('UPDATE `qst_user` SET `cancel` = "' . (time() + 6 * 3600) . '" WHERE `id` = "' . $q2['id'] . '" LIMIT 1');
|
||||
unset($q1, $q2);
|
||||
$re = 'Вы успешно отказались от задания...<br />';
|
||||
}
|
||||
|
||||
if (isset($q1['id'])) {
|
||||
$re .= '<br /><b>Задание : </b> ' . $q1['name'] . ' [' . $q2['val'] . '/' . $q1['obj_val'] . ']<br /><a href="?cancelqst=1">• Отказаться (Следующее можно будет взять через 12 часов)</a><br />';
|
||||
if ($q2['val'] >= $q1['obj_val']) {
|
||||
if (isset($_GET['finishqst'])) {
|
||||
$re = 'Вы успешно завершили задание и получили: ';
|
||||
if ($q1['cr'] > 0) {
|
||||
$re .= ' ' . $q1['cr'] . ' кр. ';
|
||||
}
|
||||
if ($q1['rep'] > 0) {
|
||||
$re .= ' ' . $q1['rep'] . ' репутации. ';
|
||||
}
|
||||
$re .= '<br />';
|
||||
$user['money'] += $q1['cr'];
|
||||
$user['doblest'] += $q1['rep'];
|
||||
$user['rep_laba'] += $q1['rep'];
|
||||
mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '", `doblest` = "' . $user['doblest'] . '", `rep_laba` = "' . $user['rep_laba'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
|
||||
mysql_query('UPDATE `qst_user` SET `finish` = "' . (time() + 60 * 60 * 12) . '" WHERE `id` = "' . $q2['id'] . '" AND `uid` = "' . $user['id'] . '" LIMIT 1');
|
||||
unset($q1, $q2);
|
||||
if (!isset($q2['id'])) {
|
||||
$q3 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "' . $user['id'] . '" AND (`cancel` > "' . time() . '" OR `finish` > "' . time() . '") LIMIT 1'));
|
||||
if (isset($q3['id'])) {
|
||||
if ($q3['cancel'] > time()) {
|
||||
$tm = timeOut($q3['cancel'] - time());
|
||||
} else {
|
||||
$tm = timeOut($q3['finish'] - time());
|
||||
}
|
||||
$re = 'Нельзя брать задания так часто, разрешенный лимит: Один раз в 12 часов.<br /> Следующее задание можно взять через : ' . $tm;
|
||||
} else {
|
||||
$rand = [];
|
||||
$sp = mysql_query('SELECT `id`, `name` FROM `qst` WHERE `level` = "' . $user['level'] . '"');
|
||||
while ($pl = mysql_fetch_array($sp)) {
|
||||
$rand[] = $pl;
|
||||
}
|
||||
$rand = $rand[rand(0, count($rand) - 1)];
|
||||
if ($rand['id'] > 0) {
|
||||
$re = 'Вы успешно взяли задание "' . $rand['name'] . '"!<br />';
|
||||
mysql_query('INSERT INTO `qst_user` (`uid`, `time`, `qid`) VALUES ("' . $user['id'] . '", "' . time() . '", "' . $rand['id'] . '")');
|
||||
} else {
|
||||
$re = 'Неудалось взять задание, нет подходящих заданий у Хранителя Лабиринта<br />';
|
||||
}
|
||||
$re .= ' <a href="?finishqst=1">• Завершить задание и получить награду!</a>';
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<input onclick="location.href='lab_enter.php?quest=1'" type="submit" name="quest"
|
||||
value='Взять квестовое задание' style="background-color:#A9AFC0"/>
|
||||
<? }
|
||||
} ?>
|
||||
<?
|
||||
$sp = mysql_query('SELECT * FROM `laba_zv` ORDER BY `id` DESC');
|
||||
$typez = [0 => 'Для новичков', 1 => 'Для опытных', 2 => 'Для легендарных'];
|
||||
while ($pl = mysql_fetch_array($sp)) {
|
||||
$userszv = '';
|
||||
$i = 1;
|
||||
while ($i <= 4) {
|
||||
if ($pl['uid' . $i] > 0) {
|
||||
$plu = mysql_fetch_array(mysql_query('SELECT `id`, `align`, `login`, `level` FROM `users` WHERE `id` = "' . $pl['uid' . $i] . '" LIMIT 1'));
|
||||
if (isset($plu['id'])) {
|
||||
$userszv .= ', <img src="i/align_' . $plu['align'] . '.gif"><b>' . $plu['login'] . '</b> [' . $plu['level'] . ']';
|
||||
$re = 'У вас уже есть задание.';
|
||||
}
|
||||
}
|
||||
|
||||
$q2 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "' . $user['id'] . '" AND `cancel` = "0" AND `finish` = "0" LIMIT 1'));
|
||||
$q1 = mysql_fetch_array(mysql_query('SELECT * FROM `qst` WHERE `id` = "' . $q2['qid'] . '" LIMIT 1'));
|
||||
|
||||
if (isset($q2['id']) && isset($_GET['cancelqst'])) {
|
||||
mysql_query('UPDATE `qst_user` SET `cancel` = "' . (time() + 6 * 3600) . '" WHERE `id` = "' . $q2['id'] . '" LIMIT 1');
|
||||
unset($q1, $q2);
|
||||
$re = 'Вы успешно отказались от задания...<br />';
|
||||
}
|
||||
|
||||
if (isset($q1['id'])) {
|
||||
$re .= '<br /><b>Задание : </b> ' . $q1['name'] . ' [' . $q2['val'] . '/' . $q1['obj_val'] . ']<br /><a href="?cancelqst=1">• Отказаться (Следующее можно будет взять через 12 часов)</a><br />';
|
||||
if ($q2['val'] >= $q1['obj_val']) {
|
||||
if (isset($_GET['finishqst'])) {
|
||||
$re = 'Вы успешно завершили задание и получили: ';
|
||||
if ($q1['cr'] > 0) {
|
||||
$re .= ' ' . $q1['cr'] . ' кр. ';
|
||||
}
|
||||
if ($q1['rep'] > 0) {
|
||||
$re .= ' ' . $q1['rep'] . ' репутации. ';
|
||||
}
|
||||
$re .= '<br />';
|
||||
$user['money'] += $q1['cr'];
|
||||
$user['doblest'] += $q1['rep'];
|
||||
$user['rep_laba'] += $q1['rep'];
|
||||
mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '", `doblest` = "' . $user['doblest'] . '", `rep_laba` = "' . $user['rep_laba'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
|
||||
mysql_query('UPDATE `qst_user` SET `finish` = "' . (time() + 60 * 60 * 12) . '" WHERE `id` = "' . $q2['id'] . '" AND `uid` = "' . $user['id'] . '" LIMIT 1');
|
||||
unset($q1, $q2);
|
||||
}
|
||||
$i++;
|
||||
$re .= ' <a href="?finishqst=1">• Завершить задание и получить награду!</a>';
|
||||
}
|
||||
$userszv = ltrim($userszv, ', ');
|
||||
if ($pl['com'] != '') {
|
||||
if ($user->admin) {
|
||||
$del = ' <a href=\'lab_enter.php?del_com=' . $pl['id'] . '\'>Удалить комментарий</a>';
|
||||
} else {
|
||||
$del = '';
|
||||
} else {
|
||||
?>
|
||||
<input onclick="location.href='lab_enter.php?quest=1'" type="submit" name="quest"
|
||||
value='Взять квестовое задание' style="background-color:#A9AFC0"/>
|
||||
<? }
|
||||
} ?>
|
||||
<?
|
||||
$sp = mysql_query('SELECT * FROM `laba_zv` ORDER BY `id` DESC');
|
||||
$typez = [0 => 'Для новичков', 1 => 'Для опытных', 2 => 'Для легендарных'];
|
||||
while ($pl = mysql_fetch_array($sp)) {
|
||||
$userszv = '';
|
||||
$i = 1;
|
||||
while ($i <= 4) {
|
||||
if ($pl['uid' . $i] > 0) {
|
||||
$plu = mysql_fetch_array(mysql_query('SELECT `id`, `align`, `login`, `level` FROM `users` WHERE `id` = "' . $pl['uid' . $i] . '" LIMIT 1'));
|
||||
if (isset($plu['id'])) {
|
||||
$userszv .= ', <img src="i/align_' . $plu['align'] . '.gif"><b>' . $plu['login'] . '</b> [' . $plu['level'] . ']';
|
||||
}
|
||||
$userszv .= ' (Комментарий: ' . $pl['com'] . '' . $del . ')';
|
||||
}
|
||||
if (!isset($zv['id'])) {
|
||||
$userszv .= ' <input onclick="location.href=\'?priemzv=' . $pl['id'] . '\'" type="button" value="Принять">';
|
||||
}
|
||||
echo '<div><span class=date>' . date('H:i', $pl['time']) . '</span> Тип : <b>' . $typez[$pl['type']] . '</b> | ' . $userszv . '</div>';
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
$userszv = ltrim($userszv, ', ');
|
||||
if ($pl['com'] != '') {
|
||||
if ($user->admin) {
|
||||
$del = ' <a href=\'lab_enter.php?del_com=' . $pl['id'] . '\'>Удалить комментарий</a>';
|
||||
} else {
|
||||
$del = '';
|
||||
}
|
||||
$userszv .= ' (Комментарий: ' . $pl['com'] . '' . $del . ')';
|
||||
}
|
||||
if (!isset($zv['id'])) {
|
||||
$userszv .= ' <input onclick="location.href=\'?priemzv=' . $pl['id'] . '\'" type="button" value="Принять">';
|
||||
}
|
||||
echo '<div><span class=date>' . date('H:i', $pl['time']) . '</span> Тип : <b>' . $typez[$pl['type']] . '</b> | ' . $userszv . '</div>';
|
||||
}
|
||||
?>
|
||||
<hr>
|
||||
<? if (!isset($zv['id'])) { ?>
|
||||
<table width="350" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<form id="from" autocomplete="off" name="from"
|
||||
action="lab_enter.php?pz1=<? echo mt_rand(1000000, 99999999); ?>" method="post">
|
||||
<fieldset style='padding-left: 5; width=50%'>
|
||||
<legend><b> Группа </b></legend>
|
||||
Тип похода:
|
||||
<select name="type_gors" style="margin-left:7px;" id="type_gors">
|
||||
<option value="0">Новичок</option>
|
||||
<option value="1">Опытный</option>
|
||||
<option value="2">Легендарный</option>
|
||||
</select>
|
||||
<br/>
|
||||
Комментарий
|
||||
<input type="text" name="text" maxlength="40" size="40"/>
|
||||
<br/>
|
||||
<input type="submit" name="add" value="Создать группу"/>
|
||||
<br/>
|
||||
</fieldset>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<? } else { ?>
|
||||
<? if ($zv['uid1'] == $user['id']) { ?>
|
||||
<input type="button" onclick="location.href='lab_enter.php?startzv=1';" value="Начать поход">
|
||||
<? } ?>
|
||||
<input type="button" onclick="location.href='lab_enter.php?cancelzv=1';" value="Отозвать заявку">
|
||||
<? if (!isset($zv['id'])) { ?>
|
||||
<table width="350" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<form id="from" autocomplete="off" name="from"
|
||||
action="lab_enter.php?pz1=<? echo mt_rand(1000000, 99999999); ?>" method="post">
|
||||
<fieldset style='padding-left: 5; width=50%'>
|
||||
<legend><b> Группа </b></legend>
|
||||
Тип похода:
|
||||
<select name="type_gors" style="margin-left:7px;" id="type_gors">
|
||||
<option value="0">Новичок</option>
|
||||
<option value="1">Опытный</option>
|
||||
<option value="2">Легендарный</option>
|
||||
</select>
|
||||
<br/>
|
||||
Комментарий
|
||||
<input type="text" name="text" maxlength="40" size="40"/>
|
||||
<br/>
|
||||
<input type="submit" name="add" value="Создать группу"/>
|
||||
<br/>
|
||||
</fieldset>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<? } else { ?>
|
||||
<? if ($zv['uid1'] == $user['id']) { ?>
|
||||
<input type="button" onclick="location.href='lab_enter.php?startzv=1';" value="Начать поход">
|
||||
<? } ?>
|
||||
<? if ($re != '') {
|
||||
echo '<br /><font color=red>' . $re . '</font>';
|
||||
}
|
||||
<input type="button" onclick="location.href='lab_enter.php?cancelzv=1';" value="Отозвать заявку">
|
||||
<? } ?>
|
||||
<? if ($re != '') {
|
||||
echo '<br /><font color=red>' . $re . '</font>';
|
||||
}
|
1589
labirint.php
1589
labirint.php
File diff suppressed because it is too large
Load Diff
15
library.php
15
library.php
@ -1,19 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
include "functions.php";
|
||||
|
||||
if ($user->room != 53) {
|
||||
header("Location: main.php");
|
||||
exit;
|
||||
}
|
||||
if ($user->battle) {
|
||||
header('location: fbattle.php');
|
||||
exit;
|
||||
}
|
||||
require_once "functions.php";
|
||||
\Battles\Template::header('Библиотека Просвещения');
|
||||
?>
|
||||
<TABLE border=0 width=600 cellspacing="0" cellpadding="0" align=left>
|
||||
|
@ -5,59 +5,57 @@ if (empty($_SESSION['uid'])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$raid_t=mysql_fetch_array(mysql_query("SELECT * FROM variables WHERE var='raid_on_status' LIMIT 1;"));
|
||||
$raid_t = mysql_fetch_array(mysql_query("SELECT * FROM variables WHERE var='raid_on_status' LIMIT 1;"));
|
||||
|
||||
if ($user['battle'] == 0) {
|
||||
echo "Это боевая магия...";
|
||||
} elseif ($user->room==600 || $user->room==601 || $user->room==602 || $us['room'] == 43 || $us['room'] == 45) {
|
||||
echo "В этой локации выход из боя запрещен!";
|
||||
} elseif ($user['battle']==$raid_t['value']) {
|
||||
echo "Вы защищаете весь город, а не только себя. Победа или смерть!";
|
||||
echo "Это боевая магия...";
|
||||
} elseif ($user->room == 600 || $user->room == 601 || $user->room == 602 || $us['room'] == 43 || $us['room'] == 45) {
|
||||
echo "В этой локации выход из боя запрещен!";
|
||||
} elseif ($user['battle'] == $raid_t['value']) {
|
||||
echo "Вы защищаете весь город, а не только себя. Победа или смерть!";
|
||||
} else {
|
||||
|
||||
|
||||
//unset($fbattle->battle[$user['id']]);
|
||||
if ($us['sex'] == 1) {
|
||||
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вышла из боя!<BR>');
|
||||
} else {
|
||||
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вышел из боя!<BR>');
|
||||
}
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = ' . $user['battle'] . ' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
//$ak = array_keys($battle[$user['id']]);
|
||||
//$battle[$user['id']] = $battle[$ak[0]];
|
||||
unset($battle[$user['id']]);
|
||||
foreach ($battle as $k => $v) {
|
||||
unset($battle[$user['id']][$k]);// =array(0,0,time());
|
||||
unset($battle[$k][$user['id']]);// = array(0,0,time());
|
||||
}
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
// проставляем кто-где
|
||||
if (in_array($user['id'], $t1)) {
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
unset ($t1[array_search($user['id'], $t1)]);
|
||||
$tu = $t1;
|
||||
$ttt = 1;
|
||||
|
||||
//unset($fbattle->battle[$user['id']]);
|
||||
if($us['sex'] == 1) {
|
||||
addlog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' вышла из боя!<BR>');
|
||||
} else {
|
||||
addlog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' вышел из боя!<BR>');
|
||||
}
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query ('SELECT * FROM `battle` WHERE `id` = '.$user['battle'].' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
//$ak = array_keys($battle[$user['id']]);
|
||||
//$battle[$user['id']] = $battle[$ak[0]];
|
||||
unset($battle[$user['id']]);
|
||||
foreach($battle as $k => $v) {
|
||||
unset( $battle[$user['id']][$k]);// =array(0,0,time());
|
||||
unset( $battle[$k][$user['id']]);// = array(0,0,time());
|
||||
}
|
||||
$t1 = explode(";",$bd['t1']);
|
||||
// проставляем кто-где
|
||||
if (in_array ($user['id'],$t1)) {
|
||||
$t1 = explode(";",$bd['t1']);
|
||||
unset ($t1[array_search($user['id'],$t1)]);
|
||||
$tu=$t1;
|
||||
$ttt=1;
|
||||
|
||||
} else {
|
||||
$t2 = explode(";",$bd['t2']);
|
||||
unset ($t2[array_search($user['id'],$t2)]);
|
||||
$tu=$t2;
|
||||
$ttt=2;
|
||||
}
|
||||
mysql_query("UPDATE `inventory` SET `duration`=`duration`+1 WHERE `type` <>12 AND `dressed` = 1 AND `owner` = '{$user['id']}';");
|
||||
$magictime=time()+(10*60);
|
||||
mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('".$user['id']."','Путы','$magictime',10);");
|
||||
addchp ('<font color=red>Внимание!</font> Вы вышли из боя! ','{[]}'.Nick::id($user['id'])->short().'{[]}');
|
||||
mysql_query("UPDATE `battle` SET `teams` = '".serialize($battle)."', `t".$ttt."`='".implode(";",$tu)."' WHERE `id` = ".$user['battle']." ;");
|
||||
mysql_query('UPDATE users SET `battle` =0, `hp` = 0 WHERE `id` = '.$user['id'].';');
|
||||
header("Location:fbattle.php");
|
||||
} else {
|
||||
$t2 = explode(";", $bd['t2']);
|
||||
unset ($t2[array_search($user['id'], $t2)]);
|
||||
$tu = $t2;
|
||||
$ttt = 2;
|
||||
}
|
||||
mysql_query("UPDATE `inventory` SET `duration`=`duration`+1 WHERE `type` <>12 AND `dressed` = 1 AND `owner` = '{$user['id']}';");
|
||||
$magictime = time() + (10 * 60);
|
||||
mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('" . $user['id'] . "','Путы','$magictime',10);");
|
||||
addchp('<font color=red>Внимание!</font> Вы вышли из боя! ', '{[]}' . Nick::id($user['id'])->short() . '{[]}');
|
||||
mysql_query("UPDATE `battle` SET `teams` = '" . serialize($battle) . "', `t" . $ttt . "`='" . implode(";", $tu) . "' WHERE `id` = " . $user['battle'] . " ;");
|
||||
mysql_query('UPDATE users SET `battle` =0, `hp` = 0 WHERE `id` = ' . $user['id'] . ';');
|
||||
header("Location:fbattle.php");
|
||||
|
||||
$bet=1;
|
||||
echo "Вы вышли из боя";
|
||||
$bet = 1;
|
||||
echo "Вы вышли из боя";
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,47 +1,39 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
//if (rand(1,2)==1) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$target=$_POST['target'];
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$magictime=time()+259200;
|
||||
if ($tar['id']) {
|
||||
if ($tar['klan'] || $tar['align'] ) {
|
||||
echo "<font color=red><b>Персонаж \"$target\" состоит в клане, либо имеет склонность!</b></font>";
|
||||
}
|
||||
else {
|
||||
$ok=0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok=1;
|
||||
}
|
||||
elseif ($user['align'] > '1.6' && $user['align'] < '2') {
|
||||
$ok=1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('".$tar['id']."','Проверка Паладинов','".$magictime."','20');")) {
|
||||
$messtel="Помечено, что персонаж чист перед законом";
|
||||
$mess="".$user['login']." сделал пометку что ".$_POST['target']." чист перед законом";
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
|
||||
/*Тут была привязка к телеграфу*/
|
||||
|
||||
echo "<font color=red><b>Успешно поставлена проверка персонажу \"$target\"</b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете поставить проверку!<b></font>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
$target = $_POST['target'];
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$magictime = time() + 259200;
|
||||
if ($tar['id']) {
|
||||
if ($tar['klan'] || $tar['align']) {
|
||||
echo "<font color=red><b>Персонаж \"$target\" состоит в клане, либо имеет склонность!</b></font>";
|
||||
} else {
|
||||
$ok = 0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok = 1;
|
||||
} elseif ($user['align'] > '1.6' && $user['align'] < '2') {
|
||||
$ok = 1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('" . $tar['id'] . "','Проверка Паладинов','" . $magictime . "','20');")) {
|
||||
$messtel = "Помечено, что персонаж чист перед законом";
|
||||
$mess = "" . $user['login'] . " сделал пометку что " . $_POST['target'] . " чист перед законом";
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
|
||||
/*Тут была привязка к телеграфу*/
|
||||
|
||||
echo "<font color=red><b>Успешно поставлена проверка персонажу \"$target\"</b></font>";
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете поставить проверку!<b></font>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
|
@ -1,38 +1,43 @@
|
||||
<?php
|
||||
if($_SESSION['uid'] == null) { header("Location: index.php"); }
|
||||
if ($_SESSION['uid'] == null) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
$int = 100;
|
||||
|
||||
if($user['battle'] == 0) {
|
||||
echo "Это боевая магия...";
|
||||
if ($user['battle'] == 0) {
|
||||
echo "Это боевая магия...";
|
||||
} else {
|
||||
if(rand(1, 100) < $int) {
|
||||
if($user['invis'] == 1) { $user['login'] = 'невидимка'; }
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT COUNT(`id`) FROM `bots` WHERE `name` LIKE '".$user['login']." (клон%';"));
|
||||
mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) values ('".$user['login']." (клон ".($nb[0]+1).")', '".$user['id']."', '".$user['battle']."', '".$user['hp']."')");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query ('SELECT * FROM `battle` WHERE `id` = '.$user['battle'].' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = array(0, 0, time());
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if ($user['invis'] == 1) {
|
||||
$user['login'] = 'невидимка';
|
||||
}
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT COUNT(`id`) FROM `bots` WHERE `name` LIKE '" . $user['login'] . " (клон%';"));
|
||||
mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) values ('" . $user['login'] . " (клон " . ($nb[0] + 1) . ")', '" . $user['id'] . "', '" . $user['battle'] . "', '" . $user['hp'] . "')");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
if(in_array($user['id'], $t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
$lo = Nick::id($user['id'])->short();
|
||||
$los = Nick::id($bot)->short();
|
||||
addlog($user['battle'], '<span class=date>'.date("H:i").'</span> '.$lo.' породил своего клона '.$los.'.<BR>');
|
||||
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$bot.'\') WHERE `id` = "'.$user['battle'].'" LIMIT 1');
|
||||
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = ".$user['battle']." LIMIT 1");
|
||||
echo "Клон создан";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
$bet = 1;
|
||||
}
|
||||
$bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = ' . $user['battle'] . ' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach ($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = [0, 0, time()];
|
||||
}
|
||||
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
if (in_array($user['id'], $t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
$lo = Nick::id($user['id'])->short();
|
||||
$los = Nick::id($bot)->short();
|
||||
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . $lo . ' породил своего клона ' . $los . '.<BR>');
|
||||
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '` = CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = "' . $user['battle'] . '" LIMIT 1');
|
||||
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1");
|
||||
echo "Клон создан";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,4 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
//if (rand(1,2)==1) {
|
||||
|
||||
$coma[] = "А вот раньше просто кляпом рот затыкали.";
|
||||
$coma[] = "А еще раз можешь? ;)";
|
||||
$coma[] = "А раньше все не так было ";
|
||||
@ -44,49 +41,47 @@ $coma[] = "Я конечно не садист, но мне все это нра
|
||||
$coma[] = "Помолчи, за умного сойдешь. ";
|
||||
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$target= mysql_real_escape_string($_POST['target']);
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$target}' LIMIT 1;"));
|
||||
if ($tar['id']) {
|
||||
{
|
||||
$ok=0;
|
||||
if ($user['align'] == '2.99' && $tar['align'] == 0) {
|
||||
$ok=1;
|
||||
}
|
||||
else echo("Персонаж ".$target." уже имеет склонность!");
|
||||
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("UPDATE `users` set `align`=3 where `id` ='{$tar['id']}' LIMIT 1;")) {
|
||||
$ldtarget=$target;
|
||||
if ($user['sex'] == 1) {$action="присвоил";}
|
||||
else {$action="присвоила";}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel="Ангел";
|
||||
}
|
||||
elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel="Паладин";
|
||||
}
|
||||
$mess="$angel "{$user['login']}" $action Темную склонность "$target"";
|
||||
$messch="$angel "{$user['login']}" $action Темную склонность "$target"";
|
||||
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
echo "<font color=red><b>Успешно изменена склонность персонажа \"$target\"</b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете менять склонность этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
$target = mysql_real_escape_string($_POST['target']);
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$target}' LIMIT 1;"));
|
||||
if ($tar['id']) {
|
||||
{
|
||||
$ok = 0;
|
||||
if ($user['align'] == '2.99' && $tar['align'] == 0) {
|
||||
$ok = 1;
|
||||
} else echo("Персонаж " . $target . " уже имеет склонность!");
|
||||
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("UPDATE `users` set `align`=3 where `id` ='{$tar['id']}' LIMIT 1;")) {
|
||||
$ldtarget = $target;
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "присвоил";
|
||||
} else {
|
||||
$action = "присвоила";
|
||||
}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel = "Ангел";
|
||||
} elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel = "Паладин";
|
||||
}
|
||||
$mess = "$angel "{$user['login']}" $action Темную склонность "$target"";
|
||||
$messch = "$angel "{$user['login']}" $action Темную склонность "$target"";
|
||||
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
echo "<font color=red><b>Успешно изменена склонность персонажа \"$target\"</b></font>";
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете менять склонность этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
|
@ -1,55 +1,48 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
//if (rand(1,2)==1) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align`,`block` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target=$_POST['target'];
|
||||
if ($tar['id']) {
|
||||
if ($tar['block'] == 1) {
|
||||
$ok=0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] == '1.99' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] == '1.99' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok=1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("UPDATE `users` SET `palcom` = '',`block`='0' WHERE `id` = {$tar['id']} LIMIT 1;")) {
|
||||
if ($user['sex'] == 1) {$action="снял";}
|
||||
else {$action="сняла";}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel="Ангел";
|
||||
}
|
||||
elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel="Паладин";
|
||||
}
|
||||
$mess="$angel "{$user['login']}" $action заклятие смерти с "$target"..";
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
addch("<img src=i/magic/death_off.gif> $mess");
|
||||
echo "<font color=red><b>Успешно снято заклятие смерти с персонажа \"$target\"</b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете снять заклятие смерти с этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>На персонаже \"$target\" нет заклятия смерти </b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align`,`block` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target = $_POST['target'];
|
||||
if ($tar['id']) {
|
||||
if ($tar['block'] == 1) {
|
||||
$ok = 0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] == '1.99' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] == '1.99' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok = 1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("UPDATE `users` SET `palcom` = '',`block`='0' WHERE `id` = {$tar['id']} LIMIT 1;")) {
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "снял";
|
||||
} else {
|
||||
$action = "сняла";
|
||||
}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel = "Ангел";
|
||||
} elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel = "Паладин";
|
||||
}
|
||||
$mess = "$angel "{$user['login']}" $action заклятие смерти с "$target"..";
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
addch("<img src=i/magic/death_off.gif> $mess");
|
||||
echo "<font color=red><b>Успешно снято заклятие смерти с персонажа \"$target\"</b></font>";
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете снять заклятие смерти с этого персонажа!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>На персонаже \"$target\" нет заклятия смерти </b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
//if (rand(1,2)==1) {
|
||||
//if (rand(1,2)==1) {
|
||||
|
||||
$coma[] = "А вот раньше просто кляпом рот затыкали.";
|
||||
$coma[] = "А еще раз можешь? ;)";
|
||||
@ -44,49 +44,49 @@ $coma[] = "Я конечно не садист, но мне все это нра
|
||||
$coma[] = "Помолчи, за умного сойдешь. ";
|
||||
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$target = mysql_real_escape_string($_POST['target']);
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$target}' LIMIT 1;"));
|
||||
if ($tar['id']) { {
|
||||
|
||||
if($tar['align'] == 0 && $user['align'] == 2.99) {
|
||||
$ok=1;
|
||||
} else {
|
||||
$ok=0;
|
||||
}
|
||||
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("UPDATE `users` SET `align` = 6 WHERE `id` ='{$tar['id']}' LIMIT 1")) {
|
||||
$ldtarget=$target;
|
||||
if ($user['sex'] == 1) {$action="присвоил";}
|
||||
else {$action="присвоила";}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel="Ангел";
|
||||
}
|
||||
elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel="Паладин";
|
||||
}
|
||||
$mess="$angel "{$user['login']}" $action Светлую склонность "$target"";
|
||||
$messch="$angel "{$user['login']}" $action Светлую склонность "$target"";
|
||||
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
echo "<font color=red><b>Успешно изменена склонность персонажа \"$target\"</b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете менять склонность этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
$target = mysql_real_escape_string($_POST['target']);
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$target}' LIMIT 1;"));
|
||||
if ($tar['id']) {
|
||||
{
|
||||
|
||||
if ($tar['align'] == 0 && $user['align'] == 2.99) {
|
||||
$ok = 1;
|
||||
} else {
|
||||
$ok = 0;
|
||||
}
|
||||
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("UPDATE `users` SET `align` = 6 WHERE `id` ='{$tar['id']}' LIMIT 1")) {
|
||||
$ldtarget = $target;
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "присвоил";
|
||||
} else {
|
||||
$action = "присвоила";
|
||||
}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel = "Ангел";
|
||||
} elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel = "Паладин";
|
||||
}
|
||||
$mess = "$angel "{$user['login']}" $action Светлую склонность "$target"";
|
||||
$messch = "$angel "{$user['login']}" $action Светлую склонность "$target"";
|
||||
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
echo "<font color=red><b>Успешно изменена склонность персонажа \"$target\"</b></font>";
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете менять склонность этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
//if (rand(1,2)==1) {
|
||||
//if (rand(1,2)==1) {
|
||||
|
||||
$coma[] = "А вот раньше просто кляпом рот затыкали.";
|
||||
$coma[] = "А еще раз можешь? ;)";
|
||||
@ -44,49 +44,47 @@ $coma[] = "Я конечно не садист, но мне все это нра
|
||||
$coma[] = "Помолчи, за умного сойдешь. ";
|
||||
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$target= mysql_real_escape_string($_POST['target']);
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$target}' LIMIT 1;"));
|
||||
if ($tar['id']) {
|
||||
{
|
||||
$ok=0;
|
||||
if ($user['align'] == '2.99' && $tar['align'] == 0) {
|
||||
$ok=1;
|
||||
}
|
||||
else echo("Персонаж ".$target." уже имеет склонность!");
|
||||
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("UPDATE `users` set `align`=2 where `id` ='{$tar['id']}' LIMIT 1")) {
|
||||
$ldtarget=$target;
|
||||
if ($user['sex'] == 1) {$action="присвоил";}
|
||||
else {$action="присвоила";}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel="Ангел";
|
||||
}
|
||||
elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel="Паладин";
|
||||
}
|
||||
$mess="$angel "{$user['login']}" $action Нейтральную склонность "$target"";
|
||||
$messch="$angel "{$user['login']}" $action Нейтральную склонность "$target"";
|
||||
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
echo "<font color=red><b>Успешно изменена склонность персонажа \"$target\"</b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете менять склонность этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
$target = mysql_real_escape_string($_POST['target']);
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$target}' LIMIT 1;"));
|
||||
if ($tar['id']) {
|
||||
{
|
||||
$ok = 0;
|
||||
if ($user['align'] == '2.99' && $tar['align'] == 0) {
|
||||
$ok = 1;
|
||||
} else echo("Персонаж " . $target . " уже имеет склонность!");
|
||||
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("UPDATE `users` set `align`=2 where `id` ='{$tar['id']}' LIMIT 1")) {
|
||||
$ldtarget = $target;
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "присвоил";
|
||||
} else {
|
||||
$action = "присвоила";
|
||||
}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel = "Ангел";
|
||||
} elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel = "Паладин";
|
||||
}
|
||||
$mess = "$angel "{$user['login']}" $action Нейтральную склонность "$target"";
|
||||
$messch = "$angel "{$user['login']}" $action Нейтральную склонность "$target"";
|
||||
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
echo "<font color=red><b>Успешно изменена склонность персонажа \"$target\"</b></font>";
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете менять склонность этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
|
@ -1,38 +1,37 @@
|
||||
<?php
|
||||
// магия "шаг назад"
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} elseif (rand(1,100)!=1) {
|
||||
undressall($user['id']);
|
||||
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} elseif (rand(1, 100) != 1) {
|
||||
undressall($user['id']);
|
||||
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if($user['sila']>3){
|
||||
mysql_query("UPDATE `users` SET `stats`=`stats`+1,`sila` = `sila`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
||||
}
|
||||
if($user['inta']>3){
|
||||
mysql_query("UPDATE `users` SET `stats`=`stats`+1,`inta` = `inta`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
||||
}
|
||||
if($user['lovk']>3){
|
||||
mysql_query("UPDATE `users` SET `stats`=`stats`+1,`lovk` = `lovk`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
||||
}
|
||||
if($user['vinos']>3){
|
||||
if($user['hp']<= ($user['maxhp']-6)) {
|
||||
mysql_query("UPDATE `users` SET `stats`=`stats`+1, `maxhp`=`maxhp`-'6',`vinos` = `vinos`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
||||
}
|
||||
else {
|
||||
mysql_query("UPDATE `users` SET `stats`=`stats`+1, `maxhp`=`maxhp`-'6', `hp`=`hp`-'6',`vinos` = `vinos`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
||||
}
|
||||
}
|
||||
if($user['intel'] >0) {
|
||||
mysql_query("UPDATE `users` SET `stats`=`stats`+1,`intel` = `intel`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
||||
}
|
||||
if($user['mudra'] >0) {
|
||||
mysql_query("UPDATE `users` SET `stats`=`stats`+1,`mudra` = `mudra`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
||||
}
|
||||
echo "<font color=red><b>Удачно использована магия \"Шаг назад\"<b></font>";
|
||||
$bet=1;
|
||||
if ($user['sila'] > 3) {
|
||||
mysql_query("UPDATE `users` SET `stats`=`stats`+1,`sila` = `sila`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
||||
}
|
||||
if ($user['inta'] > 3) {
|
||||
mysql_query("UPDATE `users` SET `stats`=`stats`+1,`inta` = `inta`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
||||
}
|
||||
if ($user['lovk'] > 3) {
|
||||
mysql_query("UPDATE `users` SET `stats`=`stats`+1,`lovk` = `lovk`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
||||
}
|
||||
if ($user['vinos'] > 3) {
|
||||
if ($user['hp'] <= ($user['maxhp'] - 6)) {
|
||||
mysql_query("UPDATE `users` SET `stats`=`stats`+1, `maxhp`=`maxhp`-'6',`vinos` = `vinos`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
||||
} else {
|
||||
mysql_query("UPDATE `users` SET `stats`=`stats`+1, `maxhp`=`maxhp`-'6', `hp`=`hp`-'6',`vinos` = `vinos`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
||||
}
|
||||
}
|
||||
if ($user['intel'] > 0) {
|
||||
mysql_query("UPDATE `users` SET `stats`=`stats`+1,`intel` = `intel`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
||||
}
|
||||
if ($user['mudra'] > 0) {
|
||||
mysql_query("UPDATE `users` SET `stats`=`stats`+1,`mudra` = `mudra`-1 WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;");
|
||||
}
|
||||
echo "<font color=red><b>Удачно использована магия \"Шаг назад\"<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
|
@ -1,54 +1,49 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
//if (rand(1,2)==1) {
|
||||
|
||||
$coma[] = "Бойтесь, нарушители!";
|
||||
$coma[] = "Наша служба и опасна, и трудна!";
|
||||
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$target=$_POST['target'];
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
if ($tar['id']) {
|
||||
{
|
||||
$ok=0;
|
||||
if ($tar['align'] == '0') {
|
||||
$ok=1;
|
||||
}
|
||||
else echo("Персонаж ".$target." уже имеет склонность!");
|
||||
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("UPDATE users set align='1.1' where id='{$tar['id']}';")) {
|
||||
$ldtarget=$target;
|
||||
if ($user['sex'] == 1) {$action="принял";}
|
||||
else {$action="приняла";}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel="Ангел";
|
||||
}
|
||||
elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel="Паладин";
|
||||
}
|
||||
$mess="$angel "{$user['login']}" $action "$target" в стройные ряды Паладинов";
|
||||
$messch="$angel "{$user['login']}" $action "$target" в стройные ряды Паладинов";
|
||||
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
echo "<font color=red><b>Успешно принят рекрут \"$target\"</b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете менять склонность этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
$target = $_POST['target'];
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
if ($tar['id']) {
|
||||
{
|
||||
$ok = 0;
|
||||
if ($tar['align'] == '0') {
|
||||
$ok = 1;
|
||||
} else echo("Персонаж " . $target . " уже имеет склонность!");
|
||||
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("UPDATE users set align='1.1' where id='{$tar['id']}';")) {
|
||||
$ldtarget = $target;
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "принял";
|
||||
} else {
|
||||
$action = "приняла";
|
||||
}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel = "Ангел";
|
||||
} elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel = "Паладин";
|
||||
}
|
||||
$mess = "$angel "{$user['login']}" $action "$target" в стройные ряды Паладинов";
|
||||
$messch = "$angel "{$user['login']}" $action "$target" в стройные ряды Паладинов";
|
||||
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
echo "<font color=red><b>Успешно принят рекрут \"$target\"</b></font>";
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете менять склонность этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
|
@ -1,52 +1,53 @@
|
||||
<?php
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ($user['battle'] == 0) {
|
||||
echo "Это боевая магия...";
|
||||
echo "Это боевая магия...";
|
||||
} else {
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '16' ;"));
|
||||
if ($user['intel'] >= 8) {
|
||||
$int=$magic['chanse'] + ($user['intel'] - 8)*3;
|
||||
if ($int>98){$int=99;}
|
||||
}
|
||||
else {$int=0;}
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '16' ;"));
|
||||
if ($user['intel'] >= 8) {
|
||||
$int = $magic['chanse'] + ($user['intel'] - 8) * 3;
|
||||
if ($int > 98) {
|
||||
$int = 99;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
|
||||
if (rand(1,100) < $int) {
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '".$user['login']." (Элементаль Воздуха - союзник%';"));
|
||||
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`,`owner`) values ('".$user['login']." (Элементаль Воздуха - союзник ".($nb[0]+1).")','1243','".$user['battle']."','2000','".$user['id']."');");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query ('SELECT * FROM `battle` WHERE `id` = '.$user['battle'].' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = array(0,0,time());
|
||||
}
|
||||
$t1 = explode(";",$bd['t1']);
|
||||
// проставляем кто-где
|
||||
if (in_array ($user['id'],$t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
|
||||
addlog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' вызвал '.Nick::id($bot)->short().'<BR>');
|
||||
|
||||
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'`=CONCAT(`t'.$ttt.'`,\';'.$bot.'\') WHERE `id` = '.$user['battle'].' ;');
|
||||
|
||||
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = ".$user['battle']." LIMIT 1;");
|
||||
|
||||
$bet=1;
|
||||
echo "Элементаль вызван";
|
||||
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
$bet=1;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '" . $user['login'] . " (Элементаль Воздуха - союзник%';"));
|
||||
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`,`owner`) values ('" . $user['login'] . " (Элементаль Воздуха - союзник " . ($nb[0] + 1) . ")','1243','" . $user['battle'] . "','2000','" . $user['id'] . "');");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = ' . $user['battle'] . ' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach ($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = [0, 0, time()];
|
||||
}
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
// проставляем кто-где
|
||||
if (in_array($user['id'], $t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
|
||||
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
|
||||
|
||||
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '`=CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = ' . $user['battle'] . ' ;');
|
||||
|
||||
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1;");
|
||||
|
||||
$bet = 1;
|
||||
echo "Элементаль вызван";
|
||||
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,52 +1,53 @@
|
||||
<?php
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ($user['battle'] == 0) {
|
||||
echo "Это боевая магия...";
|
||||
echo "Это боевая магия...";
|
||||
} else {
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '16' ;"));
|
||||
if ($user['intel'] >= 8) {
|
||||
$int=$magic['chanse'] + ($user['intel'] - 8)*3;
|
||||
if ($int>98){$int=99;}
|
||||
}
|
||||
else {$int=0;}
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '16' ;"));
|
||||
if ($user['intel'] >= 8) {
|
||||
$int = $magic['chanse'] + ($user['intel'] - 8) * 3;
|
||||
if ($int > 98) {
|
||||
$int = 99;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
|
||||
if (rand(1,100) < $int) {
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '".$user['login']." (Элементаль Земли - союзник%';"));
|
||||
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`,`owner`) values ('".$user['login']." (Элементаль Земли - союзник ".($nb[0]+1).")','1244','".$user['battle']."','2500','".$user['id']."');");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query ('SELECT * FROM `battle` WHERE `id` = '.$user['battle'].' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = array(0,0,time());
|
||||
}
|
||||
$t1 = explode(";",$bd['t1']);
|
||||
// проставляем кто-где
|
||||
if (in_array ($user['id'],$t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
|
||||
addlog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' вызвал '.Nick::id($bot)->short().'<BR>');
|
||||
|
||||
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'`=CONCAT(`t'.$ttt.'`,\';'.$bot.'\') WHERE `id` = '.$user['battle'].' ;');
|
||||
|
||||
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = ".$user['battle']." LIMIT 1;");
|
||||
|
||||
$bet=1;
|
||||
echo "Элементаль вызван";
|
||||
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
$bet=1;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '" . $user['login'] . " (Элементаль Земли - союзник%';"));
|
||||
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`,`owner`) values ('" . $user['login'] . " (Элементаль Земли - союзник " . ($nb[0] + 1) . ")','1244','" . $user['battle'] . "','2500','" . $user['id'] . "');");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = ' . $user['battle'] . ' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach ($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = [0, 0, time()];
|
||||
}
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
// проставляем кто-где
|
||||
if (in_array($user['id'], $t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
|
||||
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
|
||||
|
||||
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '`=CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = ' . $user['battle'] . ' ;');
|
||||
|
||||
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1;");
|
||||
|
||||
$bet = 1;
|
||||
echo "Элементаль вызван";
|
||||
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,52 +1,53 @@
|
||||
<?php
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ($user['battle'] == 0) {
|
||||
echo "Это боевая магия...";
|
||||
echo "Это боевая магия...";
|
||||
} else {
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '16' ;"));
|
||||
if ($user['intel'] >= 8) {
|
||||
$int=$magic['chanse'] + ($user['intel'] - 8)*3;
|
||||
if ($int>98){$int=99;}
|
||||
}
|
||||
else {$int=0;}
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '16' ;"));
|
||||
if ($user['intel'] >= 8) {
|
||||
$int = $magic['chanse'] + ($user['intel'] - 8) * 3;
|
||||
if ($int > 98) {
|
||||
$int = 99;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
|
||||
if (rand(1,100) < $int) {
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '".$user['login']." (Элементаль Огня - союзник%';"));
|
||||
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`,`owner`) values ('".$user['login']." (Элементаль Огня - союзник ".($nb[0]+1).")','1241','".$user['battle']."','1000','".$user['id']."');");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query ('SELECT * FROM `battle` WHERE `id` = '.$user['battle'].' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = array(0,0,time());
|
||||
}
|
||||
$t1 = explode(";",$bd['t1']);
|
||||
// проставляем кто-где
|
||||
if (in_array ($user['id'],$t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
|
||||
addlog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' вызвал '.Nick::id($bot)->short().'<BR>');
|
||||
|
||||
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'`=CONCAT(`t'.$ttt.'`,\';'.$bot.'\') WHERE `id` = '.$user['battle'].' ;');
|
||||
|
||||
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = ".$user['battle']." LIMIT 1;");
|
||||
|
||||
$bet=1;
|
||||
echo "Элементаль вызван";
|
||||
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
$bet=1;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '" . $user['login'] . " (Элементаль Огня - союзник%';"));
|
||||
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`,`owner`) values ('" . $user['login'] . " (Элементаль Огня - союзник " . ($nb[0] + 1) . ")','1241','" . $user['battle'] . "','1000','" . $user['id'] . "');");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = ' . $user['battle'] . ' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach ($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = [0, 0, time()];
|
||||
}
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
// проставляем кто-где
|
||||
if (in_array($user['id'], $t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
|
||||
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
|
||||
|
||||
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '`=CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = ' . $user['battle'] . ' ;');
|
||||
|
||||
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1;");
|
||||
|
||||
$bet = 1;
|
||||
echo "Элементаль вызван";
|
||||
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,52 +1,53 @@
|
||||
<?php
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ($user['battle'] == 0) {
|
||||
echo "Это боевая магия...";
|
||||
echo "Это боевая магия...";
|
||||
} else {
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '16' ;"));
|
||||
if ($user['intel'] >= 8) {
|
||||
$int=$magic['chanse'] + ($user['intel'] - 8)*3;
|
||||
if ($int>98){$int=99;}
|
||||
}
|
||||
else {$int=0;}
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '16' ;"));
|
||||
if ($user['intel'] >= 8) {
|
||||
$int = $magic['chanse'] + ($user['intel'] - 8) * 3;
|
||||
if ($int > 98) {
|
||||
$int = 99;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
|
||||
if (rand(1,100) < $int) {
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '".$user['login']." (Элементаль Воды - союзник%';"));
|
||||
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`,`owner`) values ('".$user['login']." (Элементаль Воды - союзник ".($nb[0]+1).")','1242','".$user['battle']."','1500','".$user['id']."');");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query ('SELECT * FROM `battle` WHERE `id` = '.$user['battle'].' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = array(0,0,time());
|
||||
}
|
||||
$t1 = explode(";",$bd['t1']);
|
||||
// проставляем кто-где
|
||||
if (in_array ($user['id'],$t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
|
||||
addlog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' вызвал '.Nick::id($bot)->short().'<BR>');
|
||||
|
||||
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'`=CONCAT(`t'.$ttt.'`,\';'.$bot.'\') WHERE `id` = '.$user['battle'].' ;');
|
||||
|
||||
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = ".$user['battle']." LIMIT 1;");
|
||||
|
||||
$bet=1;
|
||||
echo "Элементаль вызван";
|
||||
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
$bet=1;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '" . $user['login'] . " (Элементаль Воды - союзник%';"));
|
||||
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`,`owner`) values ('" . $user['login'] . " (Элементаль Воды - союзник " . ($nb[0] + 1) . ")','1242','" . $user['battle'] . "','1500','" . $user['id'] . "');");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = ' . $user['battle'] . ' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach ($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = [0, 0, time()];
|
||||
}
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
// проставляем кто-где
|
||||
if (in_array($user['id'], $t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
|
||||
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
|
||||
|
||||
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '`=CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = ' . $user['battle'] . ' ;');
|
||||
|
||||
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1;");
|
||||
|
||||
$bet = 1;
|
||||
echo "Элементаль вызван";
|
||||
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,57 +1,58 @@
|
||||
<?php
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ($user['battle'] == 0) {
|
||||
echo "Это боевая магия...";
|
||||
echo "Это боевая магия...";
|
||||
} else {
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '16' ;"));
|
||||
if ($user['intel'] >= 8) {
|
||||
$int=$magic['chanse'] + ($user['intel'] - 8)*3;
|
||||
if ($int>98){$int=99;}
|
||||
}
|
||||
else {$int=0;}
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '16' ;"));
|
||||
if ($user['intel'] >= 8) {
|
||||
$int = $magic['chanse'] + ($user['intel'] - 8) * 3;
|
||||
if ($int > 98) {
|
||||
$int = 99;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
|
||||
if (rand(1,100) < $int) {
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '".$user['login']." (Элементаль Огня - враг%';"));
|
||||
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('".$user['login']." (Элементаль Огня - враг ".($nb[0]+1).")','1241','".$user['battle']."','1000');");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query ('SELECT * FROM `battle` WHERE `id` = '.$user['battle'].' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
|
||||
$t1 = explode(";",$bd['t1']);
|
||||
if(in_array ($user['id'],$t1)) $bot_marker=$t2[0];
|
||||
else $bot_marker=$t1[0];
|
||||
|
||||
$battle[$bot] = $battle[$bot_marker];
|
||||
foreach($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = array(0,0,time());
|
||||
}
|
||||
|
||||
// проставляем кто-где
|
||||
if (in_array ($bot_marker,$t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
|
||||
addlog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' вызвал '.Nick::id($bot)->short().'<BR>');
|
||||
|
||||
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'`=CONCAT(`t'.$ttt.'`,\';'.$bot.'\') WHERE `id` = '.$user['battle'].' ;');
|
||||
|
||||
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = ".$user['battle']." LIMIT 1;");
|
||||
|
||||
$bet=1;
|
||||
echo "Элементаль вызван";
|
||||
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
$bet=1;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '" . $user['login'] . " (Элементаль Огня - враг%';"));
|
||||
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('" . $user['login'] . " (Элементаль Огня - враг " . ($nb[0] + 1) . ")','1241','" . $user['battle'] . "','1000');");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = ' . $user['battle'] . ' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
if (in_array($user['id'], $t1)) $bot_marker = $t2[0];
|
||||
else $bot_marker = $t1[0];
|
||||
|
||||
$battle[$bot] = $battle[$bot_marker];
|
||||
foreach ($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = [0, 0, time()];
|
||||
}
|
||||
|
||||
// проставляем кто-где
|
||||
if (in_array($bot_marker, $t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
|
||||
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
|
||||
|
||||
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '`=CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = ' . $user['battle'] . ' ;');
|
||||
|
||||
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1;");
|
||||
|
||||
$bet = 1;
|
||||
echo "Элементаль вызван";
|
||||
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,57 +1,58 @@
|
||||
<?php
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ($user['battle'] == 0) {
|
||||
echo "Это боевая магия...";
|
||||
echo "Это боевая магия...";
|
||||
} else {
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '16' ;"));
|
||||
if ($user['intel'] >= 8) {
|
||||
$int=$magic['chanse'] + ($user['intel'] - 8)*3;
|
||||
if ($int>98){$int=99;}
|
||||
}
|
||||
else {$int=0;}
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '16' ;"));
|
||||
if ($user['intel'] >= 8) {
|
||||
$int = $magic['chanse'] + ($user['intel'] - 8) * 3;
|
||||
if ($int > 98) {
|
||||
$int = 99;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
|
||||
if (rand(1,100) < $int) {
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '".$user['login']." (Элементаль Воды - враг%';"));
|
||||
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('".$user['login']." (Элементаль Воды - враг ".($nb[0]+1).")','1242','".$user['battle']."','1500');");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query ('SELECT * FROM `battle` WHERE `id` = '.$user['battle'].' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
|
||||
$t1 = explode(";",$bd['t1']);
|
||||
if(in_array ($user['id'],$t1)) $bot_marker=$t2[0];
|
||||
else $bot_marker=$t1[0];
|
||||
|
||||
$battle[$bot] = $battle[$bot_marker];
|
||||
foreach($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = array(0,0,time());
|
||||
}
|
||||
|
||||
// проставляем кто-где
|
||||
if (in_array ($bot_marker,$t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
|
||||
addlog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' вызвал '.Nick::id($bot)->short().'<BR>');
|
||||
|
||||
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'`=CONCAT(`t'.$ttt.'`,\';'.$bot.'\') WHERE `id` = '.$user['battle'].' ;');
|
||||
|
||||
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = ".$user['battle']." LIMIT 1;");
|
||||
|
||||
$bet=1;
|
||||
echo "Элементаль вызван";
|
||||
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
$bet=1;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '" . $user['login'] . " (Элементаль Воды - враг%';"));
|
||||
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('" . $user['login'] . " (Элементаль Воды - враг " . ($nb[0] + 1) . ")','1242','" . $user['battle'] . "','1500');");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = ' . $user['battle'] . ' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
if (in_array($user['id'], $t1)) $bot_marker = $t2[0];
|
||||
else $bot_marker = $t1[0];
|
||||
|
||||
$battle[$bot] = $battle[$bot_marker];
|
||||
foreach ($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = [0, 0, time()];
|
||||
}
|
||||
|
||||
// проставляем кто-где
|
||||
if (in_array($bot_marker, $t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' породил своего клона '.nick::id($bot)->short().'<BR>\') WHERE `id` = '.$user['battle'].';');
|
||||
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' вызвал ' . Nick::id($bot)->short() . '<BR>');
|
||||
|
||||
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '`=CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = ' . $user['battle'] . ' ;');
|
||||
|
||||
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1;");
|
||||
|
||||
$bet = 1;
|
||||
echo "Элементаль вызван";
|
||||
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
262
magic/haos.php
262
magic/haos.php
@ -1,7 +1,4 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
//if (rand(1,2)==1) {
|
||||
|
||||
$coma[] = "А жену мою отправь?!";
|
||||
$coma[] = "Да, у него все равно в голове хаос был. ";
|
||||
$coma[] = "Закон жесток, но справедлив!";
|
||||
@ -23,126 +20,149 @@ $coma[] = "Мда…. Надеюсь это не смертельно. ";
|
||||
$coma[] = "Хвала Меру Города!";
|
||||
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$magictime=time()+($_POST['timer']*60*1440);
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target=$_POST['target'];
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '4' LIMIT 1;"));
|
||||
|
||||
if ($effect['time']) {
|
||||
$time_still=$effect['time'] - time();
|
||||
$time_new=$magictime - time();
|
||||
if ($time_still < $time_new) {
|
||||
$ok=0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {$ok=1;}
|
||||
elseif (($user['align'] > '1.6' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] > '1.6' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok=1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("UPDATE `effects` SET `time`='$magictime' WHERE `id` = '{$tar['id']}' LIMIT 1;")) {
|
||||
$ldtarget=$target;
|
||||
$ldblock=1;
|
||||
|
||||
switch($_POST['timer']) {
|
||||
case "2": $magictime="два дня."; break;
|
||||
case "3": $magictime="три дня."; break;
|
||||
case "7": $magictime="неделя."; break;
|
||||
case "14": $magictime="две недели."; break;
|
||||
case "30": $magictime="месяц."; break;
|
||||
case "60": $magictime="два месяца."; break;
|
||||
case "365": $magictime="бессрочно."; break;
|
||||
}
|
||||
if ($user['sex'] == 1) {$action="отправил";}
|
||||
else {$action="отправила";}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel="Ангел";
|
||||
}
|
||||
elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel="Паладин";
|
||||
}
|
||||
$mess="Продление хаоса. $angel "{$user['login']}" $action в хаос "$target" сроком $magictime";
|
||||
$messch="Продление хаоса. $angel "{$user['login']}" $action в хаос "$target" сроком $magictime.";
|
||||
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
addch("<img src=i/magic/haos.gif> $messch");
|
||||
addchp($coma[rand(0,count($coma)-1)],"Комментатор");
|
||||
echo "<font color=red><b>Успешно наложено заклятие хаоса на персонажа \"$target\"</b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете наложить заклятие хаоса на этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете сократить срок наказания!</b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$ok=0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] > '1.6' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] > '1.6' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok=1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('".$tar['id']."','Заклятие хаоса','$magictime',4);")) {
|
||||
mysql_query("UPDATE `users` SET `align`='4', klan='', status='' WHERE `id` = {$tar['id']} LIMIT 1;");
|
||||
mysql_query("DELETE FROM `effects` where `type`='20' AND 'owner'= '{$tar['id']}' LIMIT 1;");
|
||||
$ldtarget=$target;
|
||||
$ldblock=1;
|
||||
|
||||
switch($_POST['timer']) {
|
||||
case "2": $magictime="два дня."; break;
|
||||
case "3": $magictime="три дня."; break;
|
||||
case "7": $magictime="неделя."; break;
|
||||
case "14": $magictime="две недели."; break;
|
||||
case "30": $magictime="месяц."; break;
|
||||
case "60": $magictime="два месяца."; break;
|
||||
case "365": $magictime="бессрочно."; break;
|
||||
}
|
||||
if ($user['sex'] == 1) {$action="отправил";}
|
||||
else {$action="отправила";}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel="Ангел";
|
||||
}
|
||||
elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel="Паладин";
|
||||
}
|
||||
$mess="$angel "{$user['login']}" $action в хаос "$target" сроком $magictime";
|
||||
$messch="$angel "{$user['login']}" $action в хаос "$target" сроком $magictime.";
|
||||
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
addch("<img src=i/magic/haos.gif> $messch");
|
||||
addchp($coma[rand(0,count($coma)-1)],"Комментатор");
|
||||
echo "<font color=red><b>Успешно наложено заклятие хаоса на персонажа \"$target\"</b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете наложить заклятие хаоса на этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
$magictime = time() + ($_POST['timer'] * 60 * 1440);
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target = $_POST['target'];
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '4' LIMIT 1;"));
|
||||
|
||||
if ($effect['time']) {
|
||||
$time_still = $effect['time'] - time();
|
||||
$time_new = $magictime - time();
|
||||
if ($time_still < $time_new) {
|
||||
$ok = 0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] > '1.6' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] > '1.6' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok = 1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("UPDATE `effects` SET `time`='$magictime' WHERE `id` = '{$tar['id']}' LIMIT 1;")) {
|
||||
$ldtarget = $target;
|
||||
$ldblock = 1;
|
||||
|
||||
switch ($_POST['timer']) {
|
||||
case "2":
|
||||
$magictime = "два дня.";
|
||||
break;
|
||||
case "3":
|
||||
$magictime = "три дня.";
|
||||
break;
|
||||
case "7":
|
||||
$magictime = "неделя.";
|
||||
break;
|
||||
case "14":
|
||||
$magictime = "две недели.";
|
||||
break;
|
||||
case "30":
|
||||
$magictime = "месяц.";
|
||||
break;
|
||||
case "60":
|
||||
$magictime = "два месяца.";
|
||||
break;
|
||||
case "365":
|
||||
$magictime = "бессрочно.";
|
||||
break;
|
||||
}
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "отправил";
|
||||
} else {
|
||||
$action = "отправила";
|
||||
}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel = "Ангел";
|
||||
} elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel = "Паладин";
|
||||
}
|
||||
$mess = "Продление хаоса. $angel "{$user['login']}" $action в хаос "$target" сроком $magictime";
|
||||
$messch = "Продление хаоса. $angel "{$user['login']}" $action в хаос "$target" сроком $magictime.";
|
||||
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
addch("<img src=i/magic/haos.gif> $messch");
|
||||
addchp($coma[rand(0, count($coma) - 1)], "Комментатор");
|
||||
echo "<font color=red><b>Успешно наложено заклятие хаоса на персонажа \"$target\"</b></font>";
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете наложить заклятие хаоса на этого персонажа!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете сократить срок наказания!</b></font>";
|
||||
}
|
||||
} else {
|
||||
$ok = 0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] > '1.6' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] > '1.6' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok = 1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('" . $tar['id'] . "','Заклятие хаоса','$magictime',4);")) {
|
||||
mysql_query("UPDATE `users` SET `align`='4', klan='', status='' WHERE `id` = {$tar['id']} LIMIT 1;");
|
||||
mysql_query("DELETE FROM `effects` where `type`='20' AND 'owner'= '{$tar['id']}' LIMIT 1;");
|
||||
$ldtarget = $target;
|
||||
$ldblock = 1;
|
||||
|
||||
switch ($_POST['timer']) {
|
||||
case "2":
|
||||
$magictime = "два дня.";
|
||||
break;
|
||||
case "3":
|
||||
$magictime = "три дня.";
|
||||
break;
|
||||
case "7":
|
||||
$magictime = "неделя.";
|
||||
break;
|
||||
case "14":
|
||||
$magictime = "две недели.";
|
||||
break;
|
||||
case "30":
|
||||
$magictime = "месяц.";
|
||||
break;
|
||||
case "60":
|
||||
$magictime = "два месяца.";
|
||||
break;
|
||||
case "365":
|
||||
$magictime = "бессрочно.";
|
||||
break;
|
||||
}
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "отправил";
|
||||
} else {
|
||||
$action = "отправила";
|
||||
}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel = "Ангел";
|
||||
} elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel = "Паладин";
|
||||
}
|
||||
$mess = "$angel "{$user['login']}" $action в хаос "$target" сроком $magictime";
|
||||
$messch = "$angel "{$user['login']}" $action в хаос "$target" сроком $magictime.";
|
||||
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
addch("<img src=i/magic/haos.gif> $messch");
|
||||
addchp($coma[rand(0, count($coma) - 1)], "Комментатор");
|
||||
echo "<font color=red><b>Успешно наложено заклятие хаоса на персонажа \"$target\"</b></font>";
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете наложить заклятие хаоса на этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
|
@ -1,51 +1,45 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
//if (rand(1,2)==1) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target=$_POST['target'];
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '4' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
$ok=0;
|
||||
if (($user['align'] > '2' && $user['align'] < '3') || ($user['align'] == '1.99')|| ($user['align'] == '1.98')) {
|
||||
$ok=1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("DELETE FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '4' LIMIT 1 ;")) {
|
||||
mysql_query("UPDATE `users` SET `palcom` = '',`align`='0' WHERE `id` = {$tar['id']} LIMIT 1;");
|
||||
if ($user['sex'] == 1) {$action="выпустил";}
|
||||
else {$action="выпустила";}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel="Ангел";
|
||||
}
|
||||
elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel="Паладин";
|
||||
}
|
||||
$mess="$angel "{$user['login']}" $action из хаоса "$target"..";
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
addch("<img src=i/magic/haos_off.gif> $mess");
|
||||
echo "<font color=red><b>Успешно снято заклятие хаоса с персонажа \"$target\"</b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target = $_POST['target'];
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '4' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
$ok = 0;
|
||||
if (($user['align'] > '2' && $user['align'] < '3') || ($user['align'] == '1.99') || ($user['align'] == '1.98')) {
|
||||
$ok = 1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("DELETE FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '4' LIMIT 1 ;")) {
|
||||
mysql_query("UPDATE `users` SET `palcom` = '',`align`='0' WHERE `id` = {$tar['id']} LIMIT 1;");
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "выпустил";
|
||||
} else {
|
||||
$action = "выпустила";
|
||||
}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel = "Ангел";
|
||||
} elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel = "Паладин";
|
||||
}
|
||||
$mess = "$angel "{$user['login']}" $action из хаоса "$target"..";
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
addch("<img src=i/magic/haos_off.gif> $mess");
|
||||
echo "<font color=red><b>Успешно снято заклятие хаоса с персонажа \"$target\"</b></font>";
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете снять заклятие хаоса с этого персонажа!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>На персонаже \"$target\" нет заклятия хаоса </b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете снять заклятие хаоса с этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>На персонаже \"$target\" нет заклятия хаоса </b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
|
@ -1,34 +1,34 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '3' ;"));
|
||||
if ($user['intel'] >= 2) {
|
||||
$int=$magic['chanse'] + ($user['intel'] - 2)*3;
|
||||
if ($int>98){$int=99;}
|
||||
}
|
||||
else {$int=0;}
|
||||
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '3' ;"));
|
||||
if ($user['intel'] >= 2) {
|
||||
$int = $magic['chanse'] + ($user['intel'] - 2) * 3;
|
||||
if ($int > 98) {
|
||||
$int = 99;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = '{$target}' AND `needident` = 1 LIMIT 1;"));
|
||||
if (mysql_query("UPDATE `inventory` SET `needident` = 0 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$target}\" удачно идентифицирован <b></font>";
|
||||
$bet=1;
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = '{$target}' AND `needident` = 1 LIMIT 1;"));
|
||||
if (mysql_query("UPDATE `inventory` SET `needident` = 0 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$target}\" удачно идентифицирован <b></font>";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -5,75 +5,61 @@ if (empty($_SESSION['uid'])) {
|
||||
}
|
||||
|
||||
//запрещенная для встройки магия
|
||||
$forbidden=array("1","2","3","7","6","8","18","19","20","21","22","43","46","47","48","55","56","58","74","75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90",
|
||||
"91", "92", "93", "94", "95", "96", "97", "98", "99", "100", "101", "102", "103", "104", "105", "106",
|
||||
"107", "108", "109", "110", "111", "112", "113", "114", "115", "116", "117", "118", "119", "120", "121",
|
||||
"122", "123", "124", "125", "126", "127", "128", "129", "130", "131", "132", "133", "134", "135", "136", "137", "138","139",);
|
||||
$forbidden = ["1", "2", "3", "7", "6", "8", "18", "19", "20", "21", "22", "43", "46", "47", "48", "55", "56", "58", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90",
|
||||
"91", "92", "93", "94", "95", "96", "97", "98", "99", "100", "101", "102", "103", "104", "105", "106",
|
||||
"107", "108", "109", "110", "111", "112", "113", "114", "115", "116", "117", "118", "119", "120", "121",
|
||||
"122", "123", "124", "125", "126", "127", "128", "129", "130", "131", "132", "133", "134", "135", "136", "137", "138", "139",];
|
||||
// magic
|
||||
// встраивание магии
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 17) {
|
||||
$int=80 + $user['intel'] - 17;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) <= $int OR !$_SESSION['scroll']) {
|
||||
if(!$_SESSION['scroll']) {
|
||||
$_SESSION['scroll'] = $_POST['target'];
|
||||
?><body onload="okno('Название предмета, в который встраивается свиток', 'main.php?edit=1&use=<?=$_GET['use']?>','target')"><?
|
||||
} else {
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = '".$_SESSION['scroll']."' AND `owner` = '{$user['id']}' AND `dressed`=0 LIMIT 1;"));
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `owner` = '{$user['id']}' AND `name` LIKE '{$_POST['target']}' AND `includemagic` = 0 AND `dressed`=0 LIMIT 1;"));
|
||||
//echo "SELECT * FROM `inventory` WHERE `owner` = '{$user['id']}' AND `name` LIKE '{$_REQUEST['target']}' AND `includemagic` = 0 LIMIT 1;";
|
||||
$_SESSION['scroll'] = null;
|
||||
if(!$svitok){
|
||||
echo "<font color=red><b>У вас нет такого свитка!<b></font>";
|
||||
}elseif(!$dress OR $dress['type'] >= 12){
|
||||
echo "<font color=red><b>У вас нет такого предмета!<b></font>";
|
||||
}else {
|
||||
$incmagic = mysql_fetch_array(mysql_query("SELECT * FROM `magic` WHERE `id` = '{$svitok['magic']}' LIMIT 1;"));
|
||||
if((!$incmagic['img'])||in_array($svitok['magic'],$forbidden)) {
|
||||
echo "<font color=red><b>Этот свиток нельзя встраивать в предметы!<b></font>";
|
||||
} else {
|
||||
// встраиваем
|
||||
destructitem($svitok['id']);
|
||||
echo "<font color=red><b>Свиток \"".$svitok['name']."\" удачно встроен в \"".$dress['name']."\"<b></font>";
|
||||
mysql_query("UPDATE `inventory` SET
|
||||
".($dress['nintel']<$svitok['nintel']?"`nintel`='".$svitok['nintel']."',":"")."
|
||||
".($dress['nlevel']<$svitok['nlevel']?"`nlevel`='".$svitok['nlevel']."',":"")."
|
||||
".($dress['nmudra']<$svitok['nmudra']?"`nmudra`='".$svitok['nmudra']."',":"")."
|
||||
".($dress['ngray']<$svitok['ngray']?"`ngray`='".$svitok['ngray']."',":"")."
|
||||
".($dress['ndark']<$svitok['ndark']?"`ndark`='".$svitok['ndark']."',":"")."
|
||||
".($dress['nlight']<$svitok['nlight']?"`nlevel`='".$svitok['nlight']."',":"")."
|
||||
`massa`=`massa`+1,`cost`=`cost`+'".$svitok['cost']."', `includemagic` = '".$svitok['magic']."', `includemagicdex` = '".$svitok['maxdur']."', `includemagicmax` = '".$svitok['maxdur']."', `includemagicname` = '".$svitok['name']."', `includemagicuses` = '100+".$user['intel']."', `includemagiccost` = '".($svitok['cost']/2)."' WHERE `id` = '{$dress['id']}' LIMIT 1;");
|
||||
$bet=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` LIKE '%Топор%' AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
//$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
/*if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `cost` = `cost`+6, `ntopor` = `ntopor`+1, `nsila` = `nsila`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +1.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}*/
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Cвиток рассыпался в ваших руках...<b></font>";
|
||||
$bet=1;
|
||||
$_SESSION['scroll'] = null;
|
||||
}
|
||||
}
|
||||
?>
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 17) {
|
||||
$int = 80 + $user['intel'] - 17;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) <= $int or !$_SESSION['scroll']) {
|
||||
if (!$_SESSION['scroll']) {
|
||||
$_SESSION['scroll'] = $_POST['target'];
|
||||
?>
|
||||
<body
|
||||
onload="okno('Название предмета, в который встраивается свиток', 'main.php?edit=1&use=<?= $_GET['use'] ?>','target')"><?
|
||||
} else {
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = '" . $_SESSION['scroll'] . "' AND `owner` = '{$user['id']}' AND `dressed`=0 LIMIT 1;"));
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `owner` = '{$user['id']}' AND `name` LIKE '{$_POST['target']}' AND `includemagic` = 0 AND `dressed`=0 LIMIT 1;"));
|
||||
//echo "SELECT * FROM `inventory` WHERE `owner` = '{$user['id']}' AND `name` LIKE '{$_REQUEST['target']}' AND `includemagic` = 0 LIMIT 1;";
|
||||
$_SESSION['scroll'] = null;
|
||||
if (!$svitok) {
|
||||
echo "<font color=red><b>У вас нет такого свитка!<b></font>";
|
||||
} elseif (!$dress or $dress['type'] >= 12) {
|
||||
echo "<font color=red><b>У вас нет такого предмета!<b></font>";
|
||||
} else {
|
||||
$incmagic = mysql_fetch_array(mysql_query("SELECT * FROM `magic` WHERE `id` = '{$svitok['magic']}' LIMIT 1;"));
|
||||
if ((!$incmagic['img']) || in_array($svitok['magic'], $forbidden)) {
|
||||
echo "<font color=red><b>Этот свиток нельзя встраивать в предметы!<b></font>";
|
||||
} else {
|
||||
// встраиваем
|
||||
destructitem($svitok['id']);
|
||||
echo "<font color=red><b>Свиток \"" . $svitok['name'] . "\" удачно встроен в \"" . $dress['name'] . "\"<b></font>";
|
||||
mysql_query("UPDATE `inventory` SET
|
||||
" . ($dress['nintel'] < $svitok['nintel'] ? "`nintel`='" . $svitok['nintel'] . "'," : "") . "
|
||||
" . ($dress['nlevel'] < $svitok['nlevel'] ? "`nlevel`='" . $svitok['nlevel'] . "'," : "") . "
|
||||
" . ($dress['nmudra'] < $svitok['nmudra'] ? "`nmudra`='" . $svitok['nmudra'] . "'," : "") . "
|
||||
" . ($dress['ngray'] < $svitok['ngray'] ? "`ngray`='" . $svitok['ngray'] . "'," : "") . "
|
||||
" . ($dress['ndark'] < $svitok['ndark'] ? "`ndark`='" . $svitok['ndark'] . "'," : "") . "
|
||||
" . ($dress['nlight'] < $svitok['nlight'] ? "`nlevel`='" . $svitok['nlight'] . "'," : "") . "
|
||||
`massa`=`massa`+1,`cost`=`cost`+'" . $svitok['cost'] . "', `includemagic` = '" . $svitok['magic'] . "', `includemagicdex` = '" . $svitok['maxdur'] . "', `includemagicmax` = '" . $svitok['maxdur'] . "', `includemagicname` = '" . $svitok['name'] . "', `includemagicuses` = '100+" . $user['intel'] . "', `includemagiccost` = '" . ($svitok['cost'] / 2) . "' WHERE `id` = '{$dress['id']}' LIMIT 1;");
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Cвиток рассыпался в ваших руках...<b></font>";
|
||||
$bet = 1;
|
||||
$_SESSION['scroll'] = null;
|
||||
}
|
||||
}
|
@ -1,53 +1,50 @@
|
||||
<?php
|
||||
|
||||
if(empty($_SESSION['uid'])) { header("Location: index.php"); }
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`, `align` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['ldnick'])."' LIMIT 1"));
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
}
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`, `align` FROM `users` WHERE `login` = '" . mysql_real_escape_string($_POST['ldnick']) . "' LIMIT 1"));
|
||||
$target = $_POST['ldnick'];
|
||||
|
||||
if($tar['id']) {
|
||||
$ok = 0;
|
||||
$arr = array('1.1', '1.7', '1.75', '1.91', '1.98', '1.99', '2.99');
|
||||
if(in_array($user['align'], $arr)) {
|
||||
$ok = 1;
|
||||
}
|
||||
|
||||
if($ok == 1) {
|
||||
if($_POST['red']) {
|
||||
if(!$_POST['ldtext']) {
|
||||
$pal = '';
|
||||
} else {
|
||||
$date_today = date("m.d.y H:i");
|
||||
$pal = $date_today." ".$_POST['ldtext'];
|
||||
if ($tar['id']) {
|
||||
$ok = 0;
|
||||
$arr = ['1.1', '1.7', '1.75', '1.91', '1.98', '1.99', '2.99'];
|
||||
if (in_array($user['align'], $arr)) {
|
||||
$ok = 1;
|
||||
}
|
||||
|
||||
if(mysql_query("UPDATE `users` SET `palcom` = '$pal' WHERE `id` = {$tar['id']} LIMIT 1;")) {
|
||||
$mess="Сообщение от ".$user['login'].": ".$_POST['ldtext'];
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
$mess="Изменена причина отправки в хаос/блокировки "{$_POST['ldnick']}": $mess";
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
echo "<font color=red><b>Успешно изменена причина отправки в хаос/блокировки персонажа \"$target\"</b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$mess="Сообщение от ".$user['login'].": ".$_POST['ldtext'];
|
||||
if (mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');")) {
|
||||
$mess="Добавлена запись в дело "{$_POST['ldnick']}": $mess";
|
||||
mysql_query("INSERT INTO `paldelo`(`author`,`text`,`date`) VALUES ('".$_SESSION['uid']."','$mess','".time()."');");
|
||||
echo "<font color=red><b>Успешно добавлена запись в дело игрока \"$target\"</b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете добавить запись в дело этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if ($_POST['red']) {
|
||||
if (!$_POST['ldtext']) {
|
||||
$pal = '';
|
||||
} else {
|
||||
$date_today = date("m.d.y H:i");
|
||||
$pal = $date_today . " " . $_POST['ldtext'];
|
||||
}
|
||||
|
||||
if (mysql_query("UPDATE `users` SET `palcom` = '$pal' WHERE `id` = {$tar['id']} LIMIT 1;")) {
|
||||
$mess = "Сообщение от " . $user['login'] . ": " . $_POST['ldtext'];
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
$mess = "Изменена причина отправки в хаос/блокировки "{$_POST['ldnick']}": $mess";
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
echo "<font color=red><b>Успешно изменена причина отправки в хаос/блокировки персонажа \"$target\"</b></font>";
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
$mess = "Сообщение от " . $user['login'] . ": " . $_POST['ldtext'];
|
||||
if (mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');")) {
|
||||
$mess = "Добавлена запись в дело "{$_POST['ldnick']}": $mess";
|
||||
mysql_query("INSERT INTO `paldelo`(`author`,`text`,`date`) VALUES ('" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
echo "<font color=red><b>Успешно добавлена запись в дело игрока \"$target\"</b></font>";
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете добавить запись в дело этого персонажа!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
<?php
|
||||
if (empty($_SESSION['uid'])) header("Location: index.php");
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$u1 = filter_input(INPUT_POST, 'target');
|
||||
$u2 = filter_input(INPUT_POST, 'target1');
|
||||
|
129
magic/obezl.php
129
magic/obezl.php
@ -1,69 +1,74 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
//if (rand(1,2)==1) {
|
||||
|
||||
$coma[] = "Я и не вспомню как его зовут... ";
|
||||
|
||||
|
||||
if ($_SESSION['uid'] == null) {
|
||||
if ($_SESSION['uid'] == null) {
|
||||
header("Location: index.php");
|
||||
|
||||
$magictime=time()+($_POST['timer']*60*1440);
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target=$_POST['target'];
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '5' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
echo "<font color=red><b>На персонаже \"$target\" уже есть заклятие обезличивания </b></font>";
|
||||
}
|
||||
else {
|
||||
$ok=0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] > '1.6' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] > '1.6' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok=1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('".$tar['id']."','Заклятие обезличивания','$magictime',5);")) {
|
||||
$ldtarget=$target;
|
||||
switch($_POST['timer']) {
|
||||
case "2": $magictime="два дня."; break;
|
||||
case "3": $magictime="три дня."; break;
|
||||
case "14": $magictime="две недели."; break;
|
||||
case "30": $magictime="месяц."; break;
|
||||
case "60": $magictime="два месяца."; break;
|
||||
case "365": $magictime="бессрочно."; break;
|
||||
}
|
||||
if ($user['sex'] == 1) {$action="наложил";}
|
||||
else {$action="наложила";}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel="Ангел";
|
||||
}
|
||||
elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel="Паладин";
|
||||
}
|
||||
$mess="$angel "{$user['login']}" $action заклятие обезличивания на "$target" сроком $magictime";
|
||||
$messch="$angel "{$user['login']}" $action заклятие обезличивания на "$target" сроком $magictime.";
|
||||
$magictime = time() + ($_POST['timer'] * 60 * 1440);
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target = $_POST['target'];
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '5' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
echo "<font color=red><b>На персонаже \"$target\" уже есть заклятие обезличивания </b></font>";
|
||||
} else {
|
||||
$ok = 0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] > '1.6' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] > '1.6' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok = 1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('" . $tar['id'] . "','Заклятие обезличивания','$magictime',5);")) {
|
||||
$ldtarget = $target;
|
||||
switch ($_POST['timer']) {
|
||||
case "2":
|
||||
$magictime = "два дня.";
|
||||
break;
|
||||
case "3":
|
||||
$magictime = "три дня.";
|
||||
break;
|
||||
case "14":
|
||||
$magictime = "две недели.";
|
||||
break;
|
||||
case "30":
|
||||
$magictime = "месяц.";
|
||||
break;
|
||||
case "60":
|
||||
$magictime = "два месяца.";
|
||||
break;
|
||||
case "365":
|
||||
$magictime = "бессрочно.";
|
||||
break;
|
||||
}
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "наложил";
|
||||
} else {
|
||||
$action = "наложила";
|
||||
}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel = "Ангел";
|
||||
} elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel = "Паладин";
|
||||
}
|
||||
$mess = "$angel "{$user['login']}" $action заклятие обезличивания на "$target" сроком $magictime";
|
||||
$messch = "$angel "{$user['login']}" $action заклятие обезличивания на "$target" сроком $magictime.";
|
||||
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
addch("<img src=i/magic/obezl.gif> $messch");
|
||||
addchp($coma[rand(0,count($coma)-1)],"Комментатор");
|
||||
echo "<font color=red><b>Успешно наложено заклятие обезличивания на персонажа \"$target\"</b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете наложить заклятие обезличивания на этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
addch("<img src=i/magic/obezl.gif> $messch");
|
||||
addchp($coma[rand(0, count($coma) - 1)], "Комментатор");
|
||||
echo "<font color=red><b>Успешно наложено заклятие обезличивания на персонажа \"$target\"</b></font>";
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете наложить заклятие обезличивания на этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
|
@ -1,56 +1,48 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
//if (rand(1,2)==1) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target=$_POST['target'];
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '5' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
$ok=0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] > '1.6' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] > '1.6' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok=1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("DELETE FROM`effects` WHERE `owner` = '{$tar['id']}' and `type` = '5' LIMIT 1 ;")) {
|
||||
if ($user['sex'] == 1) {$action="снял";}
|
||||
else {$action="сняла";}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel="Ангел";
|
||||
}
|
||||
elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel="Паладин";
|
||||
}
|
||||
$mess="$angel "{$user['login']}" $action заклятие обезличивания с "$target".";
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
addch("<img src=i/magic/obezl_off.gif> $mess");
|
||||
echo "<font color=red><b>Успешно снято заклятие обезличивания с персонажа \"$target\"</b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете снять заклятие обезличивания с этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>На персонаже \"$target\" нет заклятия обезличивания </b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target = $_POST['target'];
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '5' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
$ok = 0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] > '1.6' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] > '1.6' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok = 1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("DELETE FROM`effects` WHERE `owner` = '{$tar['id']}' and `type` = '5' LIMIT 1 ;")) {
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "снял";
|
||||
} else {
|
||||
$action = "сняла";
|
||||
}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel = "Ангел";
|
||||
} elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel = "Паладин";
|
||||
}
|
||||
$mess = "$angel "{$user['login']}" $action заклятие обезличивания с "$target".";
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
addch("<img src=i/magic/obezl_off.gif> $mess");
|
||||
echo "<font color=red><b>Успешно снято заклятие обезличивания с персонажа \"$target\"</b></font>";
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете снять заклятие обезличивания с этого персонажа!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>На персонаже \"$target\" нет заклятия обезличивания </b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
|
@ -1,24 +1,34 @@
|
||||
<?php
|
||||
if (empty($_SESSION['uid'])) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$_SESSION['uid']}' and `type` = '51' LIMIT 1;"));
|
||||
|
||||
if ($effect['time']) {echo "Персонаж уже пьян"; }
|
||||
else {
|
||||
$zz = mt_rand(1,3); $s=0;$l=0;$i=0;
|
||||
switch($zz){
|
||||
case 1: $s=$user['level'] ; break;
|
||||
case 2: $l=$user['level'] ; break;
|
||||
case 3: $i=$user['level'] ; break;
|
||||
}
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$_SESSION['uid']}' and `type` = '51' LIMIT 1;"));
|
||||
|
||||
mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`,`sila`,`lovk`,`inta`,`vinos`) values ('".$_SESSION['uid']."','Опьянение',".(time()+3600).",51,'".$s."','".$l."','".$i."','0');");
|
||||
mysql_query("UPDATE `users` SET `sila`=`sila`+'".$s."', `lovk`=`lovk`+'".$l."', `inta`=`inta`+'".$i."' WHERE `id` = '".$_SESSION['uid']."' LIMIT 1;");
|
||||
if ($effect['time']) {
|
||||
echo "Персонаж уже пьян";
|
||||
} else {
|
||||
$zz = mt_rand(1, 3);
|
||||
$s = 0;
|
||||
$l = 0;
|
||||
$i = 0;
|
||||
switch ($zz) {
|
||||
case 1:
|
||||
$s = $user['level'];
|
||||
break;
|
||||
case 2:
|
||||
$l = $user['level'];
|
||||
break;
|
||||
case 3:
|
||||
$i = $user['level'];
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
echo "<font color=red><b>С Вами что то произошло...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`,`sila`,`lovk`,`inta`,`vinos`) values ('" . $_SESSION['uid'] . "','Опьянение'," . (time() + 3600) . ",51,'" . $s . "','" . $l . "','" . $i . "','0');");
|
||||
mysql_query("UPDATE `users` SET `sila`=`sila`+'" . $s . "', `lovk`=`lovk`+'" . $l . "', `inta`=`inta`+'" . $i . "' WHERE `id` = '" . $_SESSION['uid'] . "' LIMIT 1;");
|
||||
|
||||
|
||||
echo "<font color=red><b>С Вами что то произошло...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
|
@ -1,26 +1,25 @@
|
||||
<?php
|
||||
// магия "шаг назад"
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} elseif (rand(1,100)!=1) {
|
||||
//undressall($user['id']);
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} elseif (rand(1, 100) != 1) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
global $rooms;
|
||||
$rs = mysql_query("SELECT * FROM `users` WHERE `in_tower` = 1 ORDER by `room` DESC;");
|
||||
while($r = mysql_fetch_array($rs)) {
|
||||
if($rt != $r['room']) {
|
||||
$rt = $r['room'];
|
||||
$rr .= "\n".$rooms[$r['room']].": ";
|
||||
}
|
||||
$rr .= $r['login'].", ";
|
||||
}
|
||||
echo "<font color=red><b>Отчет о сканировании у вас в рюкзаке<b></font>";
|
||||
|
||||
mysql_query("INSERT INTO `inventory` (`bs`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`letter`,`maxdur`,`isrep`)VALUES('1','{$_SESSION['uid']}','Отчет о сканировании','200',1,0,'paper100.gif','{$rr}',1,0) ;");
|
||||
|
||||
$bet=1;
|
||||
global $rooms;
|
||||
$rs = mysql_query("SELECT * FROM `users` WHERE `in_tower` = 1 ORDER by `room` DESC;");
|
||||
while ($r = mysql_fetch_array($rs)) {
|
||||
if ($rt != $r['room']) {
|
||||
$rt = $r['room'];
|
||||
$rr .= "\n" . $rooms[$r['room']] . ": ";
|
||||
}
|
||||
$rr .= $r['login'] . ", ";
|
||||
}
|
||||
echo "<font color=red><b>Отчет о сканировании у вас в рюкзаке<b></font>";
|
||||
|
||||
mysql_query("INSERT INTO `inventory` (`bs`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`letter`,`maxdur`,`isrep`)VALUES('1','{$_SESSION['uid']}','Отчет о сканировании','200',1,0,'paper100.gif','{$rr}',1,0) ;");
|
||||
|
||||
$bet = 1;
|
||||
}
|
||||
|
@ -1,39 +1,40 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=51 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 51 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `cost` = `cost`+6, `ndubina` = `ndubina`+1, `nlovk` = `nlovk`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +1.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `cost` = `cost`+6, `ndubina` = `ndubina`+1, `nlovk` = `nlovk`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +1.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,36 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "РќРµ РІ Р±РѕСЋ...";
|
||||
} else {
|
||||
if ($user['intel'] >= 1) {
|
||||
$int=91 + $user['intel'] - 1;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "РќРµ РІ Р±РѕСЋ...";
|
||||
} else {
|
||||
if ($user['intel'] >= 1) {
|
||||
$int = 91 + $user['intel'] - 1;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +11' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+11'), `minu` = `minu`+11, `maxu`=`maxu`+11, `cost` = `cost`+72, `ndubina` = `ndubina`+11, `nlovk` = `nlovk`+11 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +11.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +11' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+11'), `minu` = `minu`+11, `maxu`=`maxu`+11, `cost` = `cost`+72, `ndubina` = `ndubina`+11, `nlovk` = `nlovk`+11 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +11.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,40 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=61 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 61 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `cost` = `cost`+12, `minu` = `minu`+2, `maxu`=`maxu`+2, `ndubina` = `ndubina`+2, `nlovk` = `nlovk`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +2.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `cost` = `cost`+12, `minu` = `minu`+2, `maxu`=`maxu`+2, `ndubina` = `ndubina`+2, `nlovk` = `nlovk`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +2.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,40 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=71 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 71 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `cost` = `cost`+18, `ndubina` = `ndubina`+3, `nlovk` = `nlovk`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +3.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `cost` = `cost`+18, `ndubina` = `ndubina`+3, `nlovk` = `nlovk`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +3.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,36 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=81 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 81 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `ndubina` = `ndubina`+4, `nlovk` = `nlovk`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +4.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `ndubina` = `ndubina`+4, `nlovk` = `nlovk`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +4.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,37 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=91 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 91 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `cost` = `cost`+30, `ndubina` = `ndubina`+5, `nlovk` = `nlovk`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +5.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%дубинка%' OR `name` LIKE '%дубина%' OR `name` LIKE '%булава%' OR `name` LIKE '%Клевец%' OR `name` LIKE '%молот%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на дубины +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `cost` = `cost`+30, `ndubina` = `ndubina`+5, `nlovk` = `nlovk`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +5.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,38 +1,36 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
echo "Не в бою...";
|
||||
} else
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=51 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 51 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `nmech` = `nmech`+1, `cost` = `cost`+6, `nvinos` = `nvinos`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +1.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `nmech` = `nmech`+1, `cost` = `cost`+6, `nvinos` = `nvinos`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +1.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
|
@ -1,39 +1,37 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "РќРµ РІ Р±РѕСЋ...";
|
||||
echo "РќРµ РІ Р±РѕСЋ...";
|
||||
} else
|
||||
if ($user['intel'] >= 1) {
|
||||
$int=91 + $user['intel'] - 1;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
if ($user['intel'] >= 1) {
|
||||
$int = 91 + $user['intel'] - 1;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +11' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+11'), `minu` = `minu`+11, `maxu`=`maxu`+11, `nmech` = `nmech`+11, `cost` = `cost`+72, `nvinos` = `nvinos`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +11.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +11' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+11'), `minu` = `minu`+11, `maxu`=`maxu`+11, `nmech` = `nmech`+11, `cost` = `cost`+72, `nvinos` = `nvinos`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +11.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
|
@ -1,38 +1,39 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
echo "Не в бою...";
|
||||
} else
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=61 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 61 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `minu` = `minu`+2, `maxu`=`maxu`+2, `nmech` = `nmech`+2, `cost` = `cost`+12, `nvinos` = `nvinos`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +2.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `minu` = `minu`+2, `maxu`=`maxu`+2, `nmech` = `nmech`+2, `cost` = `cost`+12, `nvinos` = `nvinos`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +2.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
|
@ -1,37 +1,38 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
echo "Не в бою...";
|
||||
} else
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=71 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 71 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `cost` = `cost`+18,`name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `nmech` = `nmech`+3, `nvinos` = `nvinos`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +3.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `cost` = `cost`+18,`name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `nmech` = `nmech`+3, `nvinos` = `nvinos`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +3.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
|
@ -1,38 +1,36 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
echo "Не в бою...";
|
||||
} else
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=81 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 81 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `nmech` = `nmech`+4, `nvinos` = `nvinos`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +4.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `nmech` = `nmech`+4, `nvinos` = `nvinos`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +4.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
|
@ -1,39 +1,37 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
echo "Не в бою...";
|
||||
} else
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=91 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 91 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `nmech` = `nmech`+5, `cost` = `cost`+30, `nvinos` = `nvinos`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +5.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `nmech` = `nmech`+5, `cost` = `cost`+30, `nvinos` = `nvinos`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +5.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
|
@ -1,39 +1,40 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=51 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 51 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `cost` = `cost`+6, `nnoj` = `nnoj`+1, `ninta` = `ninta`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +1.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `cost` = `cost`+6, `nnoj` = `nnoj`+1, `ninta` = `ninta`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +1.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,37 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "РќРµ РІ Р±РѕСЋ...";
|
||||
} else {
|
||||
if ($user['intel'] >= 1) {
|
||||
$int=91 + $user['intel'] - 1;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "РќРµ РІ Р±РѕСЋ...";
|
||||
} else {
|
||||
if ($user['intel'] >= 1) {
|
||||
$int = 91 + $user['intel'] - 1;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +11' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+11'), `minu` = `minu`+11, `maxu`=`maxu`+11, `cost` = `cost`+72, `nnoj` = `nnoj`+1, `ninta` = `ninta`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +11.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +11' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+11'), `minu` = `minu`+11, `maxu`=`maxu`+11, `cost` = `cost`+72, `nnoj` = `nnoj`+1, `ninta` = `ninta`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +11.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,37 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=61 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 61 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `cost` = `cost`+12, `minu` = `minu`+2, `maxu`=`maxu`+2, `nnoj` = `nnoj`+2, `ninta` = `ninta`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +2.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `cost` = `cost`+12, `minu` = `minu`+2, `maxu`=`maxu`+2, `nnoj` = `nnoj`+2, `ninta` = `ninta`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +2.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,37 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=71 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 71 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `cost` = `cost`+18, `nnoj` = `nnoj`+3, `ninta` = `ninta`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +3.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `cost` = `cost`+18, `nnoj` = `nnoj`+3, `ninta` = `ninta`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +3.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,40 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=81 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 81 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `nnoj` = `nnoj`+4, `ninta` = `ninta`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +4.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `nnoj` = `nnoj`+4, `ninta` = `ninta`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +4.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,37 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=91 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 91 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `cost` = `cost`+30, `nnoj` = `nnoj`+5, `ninta` = `ninta`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +5.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%кастет%' OR `name` LIKE '%нож%' OR `name` LIKE '%кинжал%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на ножи +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `cost` = `cost`+30, `nnoj` = `nnoj`+5, `ninta` = `ninta`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +5.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,37 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=51 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 51 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `(`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `cost` = `cost`+6, `ntopor` = `ntopor`+1, `nsila` = `nsila`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +1.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `(`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +1' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+1'), `minu` = `minu`+1, `maxu`=`maxu`+1, `cost` = `cost`+6, `ntopor` = `ntopor`+1, `nsila` = `nsila`+1 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +1.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,40 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "РќРµ РІ Р±РѕСЋ...";
|
||||
} else {
|
||||
if ($user['intel'] >= 1) {
|
||||
$int=91 + $user['intel'] - 1;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "РќРµ РІ Р±РѕСЋ...";
|
||||
} else {
|
||||
if ($user['intel'] >= 1) {
|
||||
$int = 91 + $user['intel'] - 1;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +11' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+11'), `minu` = `minu`+11, `maxu`=`maxu`+11, `cost` = `cost`+72, `ntopor` = `ntopor`+1, `nsila` = `nsila`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +11.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +11' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+11'), `minu` = `minu`+11, `maxu`=`maxu`+11, `cost` = `cost`+72, `ntopor` = `ntopor`+1, `nsila` = `nsila`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +11.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,37 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=61 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 61 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `(`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `cost` = `cost`+12, `minu` = `minu`+2, `maxu`=`maxu`+2, `ntopor` = `ntopor`+2, `nsila` = `nsila`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +2.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `(`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +2' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+2'), `cost` = `cost`+12, `minu` = `minu`+2, `maxu`=`maxu`+2, `ntopor` = `ntopor`+2, `nsila` = `nsila`+2 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +2.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,37 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=71 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 71 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `(`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `cost` = `cost`+18, `ntopor` = `ntopor`+3, `nsila` = `nsila`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +3.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `(`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +3' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `cost` = `cost`+18, `ntopor` = `ntopor`+3, `nsila` = `nsila`+3 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +3.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,37 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=81 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1,100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 81 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `ntopor` = `ntopor`+4, `nsila` = `nsila`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +4.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +4' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+4'), `minu` = `minu`+4, `maxu`=`maxu`+4, `cost` = `cost`+24, `ntopor` = `ntopor`+4, `nsila` = `nsila`+4 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +4.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,40 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if ($user['battle'] > 0) {
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int=91 + $user['intel'] - 4;
|
||||
if ($int>100){$int=100;}
|
||||
}
|
||||
else {$int=0;}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
echo "Не в бою...";
|
||||
} else {
|
||||
if ($user['intel'] >= 4) {
|
||||
$int = 91 + $user['intel'] - 4;
|
||||
if ($int > 100) {
|
||||
$int = 100;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
if (rand(1, 100) < $int) {
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `cost` = `cost`+30, `ntopor` = `ntopor`+5, `nsila` = `nsila`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +5.<b></font> ";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else
|
||||
{
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE (`name` LIKE '%Топор%' OR `name` LIKE '%Ледокол%' OR `name` LIKE '%Секира%') AND `owner` = '{$user['id']}' AND `name` = '{$_POST['target']}' AND `sharped` = 0 LIMIT 1;"));
|
||||
$svitok = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `name` = 'Заточка на топоры +5' AND `owner` = '{$user['id']}' LIMIT 1;"));
|
||||
|
||||
|
||||
if ($dress && $svitok) {
|
||||
if (mysql_query("UPDATE `inventory` SET `sharped` = 1, `name` = CONCAT(`name`,'+5'), `minu` = `minu`+5, `maxu`=`maxu`+5, `cost` = `cost`+30, `ntopor` = `ntopor`+5, `nsila` = `nsila`+5 WHERE `id` = {$dress['id']} LIMIT 1;")) {
|
||||
echo "<font color=red><b>Предмет \"{$_POST['target']}\" удачно заточен +5.<b></font> ";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неправильное имя предмета или неправильный свиток<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Неудачно...<b></font>";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
142
magic/sleep.php
142
magic/sleep.php
@ -1,7 +1,4 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
//if (rand(1,2)==1) {
|
||||
|
||||
$coma[] = "А вот раньше просто кляпом рот затыкали.";
|
||||
$coma[] = "А еще раз можешь? ;)";
|
||||
$coma[] = "А раньше все не так было ";
|
||||
@ -43,74 +40,81 @@ $coma[] = "Я вас долго слушал, теперь у вас есть в
|
||||
$coma[] = "Я конечно не садист, но мне все это нравится ";
|
||||
$coma[] = "Помолчи, за умного сойдешь. ";
|
||||
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$magictime = time() + ($_POST['timer'] * 60);
|
||||
$target = $_POST['target'];
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '2' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
echo "<font color=red><b>На персонаже \"$target\" уже есть заклятие молчания </b></font>";
|
||||
} else {
|
||||
$ok = 0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] > '1' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] > '1' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] > '7' && $user['align'] < '8') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok = 1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('" . $tar['id'] . "','Заклятие молчания','$magictime',2);")) {
|
||||
$ldtarget = $target;
|
||||
switch ($_POST['timer']) {
|
||||
case "15":
|
||||
$magictime = "15 мин.";
|
||||
break;
|
||||
case "30":
|
||||
$magictime = "30 мин.";
|
||||
break;
|
||||
case "60":
|
||||
$magictime = "1 час.";
|
||||
break;
|
||||
case "180":
|
||||
$magictime = "3 часа.";
|
||||
break;
|
||||
case "360":
|
||||
$magictime = "6 часов.";
|
||||
break;
|
||||
case "720":
|
||||
$magictime = "12 часов.";
|
||||
break;
|
||||
case "1440":
|
||||
$magictime = "1 сутки.";
|
||||
break;
|
||||
}
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "наложил";
|
||||
} else {
|
||||
$action = "наложила";
|
||||
}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel = "Ангел";
|
||||
} elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel = "Паладин";
|
||||
}
|
||||
$mess = "$angel "{$user['login']}" $action заклятие молчания на "$target" сроком $magictime";
|
||||
$messch = "$angel "{$user['login']}" $action заклятие молчания на "$target" сроком $magictime";
|
||||
|
||||
$magictime=time()+($_POST['timer']*60);
|
||||
$target=$_POST['target'];
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '2' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
echo "<font color=red><b>На персонаже \"$target\" уже есть заклятие молчания </b></font>";
|
||||
}
|
||||
else {
|
||||
$ok=0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] > '1' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] > '1' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] > '7' && $user['align'] < '8') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok=1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('".$tar['id']."','Заклятие молчания','$magictime',2);")) {
|
||||
$ldtarget=$target;
|
||||
switch($_POST['timer']) {
|
||||
case "15": $magictime="15 мин."; break;
|
||||
case "30": $magictime="30 мин."; break;
|
||||
case "60": $magictime="1 час."; break;
|
||||
case "180": $magictime="3 часа."; break;
|
||||
case "360": $magictime="6 часов."; break;
|
||||
case "720": $magictime="12 часов."; break;
|
||||
case "1440": $magictime="1 сутки."; break;
|
||||
}
|
||||
if ($user['sex'] == 1) {$action="наложил";}
|
||||
else {$action="наложила";}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel="Ангел";
|
||||
}
|
||||
elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel="Паладин";
|
||||
}
|
||||
$mess="$angel "{$user['login']}" $action заклятие молчания на "$target" сроком $magictime";
|
||||
$messch="$angel "{$user['login']}" $action заклятие молчания на "$target" сроком $magictime";
|
||||
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
addch("<img src=i/magic/sleep.gif> $messch");
|
||||
addchp($coma[rand(0,count($coma)-1)],"Комментатор");
|
||||
echo "<font color=red><b>Успешно наложено заклятие молчания на персонажа \"$target\"</b></font>";
|
||||
$outok=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете наложить заклятие молчания на этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
addch("<img src=i/magic/sleep.gif> $messch");
|
||||
addchp($coma[rand(0, count($coma) - 1)], "Комментатор");
|
||||
echo "<font color=red><b>Успешно наложено заклятие молчания на персонажа \"$target\"</b></font>";
|
||||
$outok = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете наложить заклятие молчания на этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
|
@ -1,57 +1,52 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
//if (rand(1,2)==1) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (($user->room > 2000) && ($user->room < 2100)) {echo "Не в Проходе...";}
|
||||
else {
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target=$_POST['target'];
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '2' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
$ok=0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] > '1' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] > '1' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok=1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("DELETE FROM`effects` WHERE `owner` = '{$tar['id']}' and `type` = '2' LIMIT 1 ;")) {
|
||||
if ($user['sex'] == 1) {$action="снял";}
|
||||
else {$action="сняла";}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel="Ангел";
|
||||
}
|
||||
elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel="Паладин";
|
||||
}
|
||||
$mess="$angel "{$user['login']}" $action заклятие молчания с "$target".";
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
addch("<img src=i/magic/sleep_off.gif> $mess");
|
||||
echo "<font color=red><b>Успешно снято заклятие молчания с персонажа \"$target\"</b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете снять заклятие молчания с этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>На персонаже \"$target\" нет заклятия молчания </b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}}
|
||||
if (($user->room > 2000) && ($user->room < 2100)) {
|
||||
echo "Не в Проходе...";
|
||||
} else {
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target = $_POST['target'];
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '2' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
$ok = 0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] > '1' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] > '1' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok = 1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("DELETE FROM`effects` WHERE `owner` = '{$tar['id']}' and `type` = '2' LIMIT 1 ;")) {
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "снял";
|
||||
} else {
|
||||
$action = "сняла";
|
||||
}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel = "Ангел";
|
||||
} elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel = "Паладин";
|
||||
}
|
||||
$mess = "$angel "{$user['login']}" $action заклятие молчания с "$target".";
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
addch("<img src=i/magic/sleep_off.gif> $mess");
|
||||
echo "<font color=red><b>Успешно снято заклятие молчания с персонажа \"$target\"</b></font>";
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете снять заклятие молчания с этого персонажа!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>На персонаже \"$target\" нет заклятия молчания </b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
}
|
||||
|
@ -1,56 +1,49 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
//if (rand(1,2)==1) {
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target=$_POST['target'];
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '3' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
$ok=0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] > '1.2' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] > '1.2' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok=1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("DELETE FROM`effects` WHERE `owner` = '{$tar['id']}' and `type` = '3' LIMIT 1 ;")) {
|
||||
if ($user['sex'] == 1) {$action="снял";}
|
||||
else {$action="сняла";}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel="Ангел";
|
||||
}
|
||||
elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel="Паладин";
|
||||
}
|
||||
$mess="$angel "{$user['login']}" $action заклятие форумного молчания с "$target".";
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
addch("<img src=i/magic/sleepf_off.gif> $mess");
|
||||
echo "<font color=red><b>Успешно снято заклятие форумного молчания с персонажа \"$target\"</b></font>";
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Вы не можете снять заклятие форумного молчания с этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>На персонаже \"$target\" нет заклятия форумного молчания </b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target = $_POST['target'];
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '3' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
$ok = 0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] > '1.2' && $user['align'] < '2') && ($tar['align'] > '1' && $tar['align'] < '2') && ($user['align'] > $tar['align'])) {
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] > '1.2' && $user['align'] < '2') && !($tar['align'] > '2' && $tar['align'] < '3') && !($tar['align'] > '1' && $tar['align'] < '2')) {
|
||||
$ok = 1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("DELETE FROM`effects` WHERE `owner` = '{$tar['id']}' and `type` = '3' LIMIT 1 ;")) {
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "снял";
|
||||
} else {
|
||||
$action = "сняла";
|
||||
}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel = "Ангел";
|
||||
} elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel = "Паладин";
|
||||
}
|
||||
$mess = "$angel "{$user['login']}" $action заклятие форумного молчания с "$target".";
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
addch("<img src=i/magic/sleepf_off.gif> $mess");
|
||||
echo "<font color=red><b>Успешно снято заклятие форумного молчания с персонажа \"$target\"</b></font>";
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете снять заклятие форумного молчания с этого персонажа!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>На персонаже \"$target\" нет заклятия форумного молчания </b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
|
@ -1,47 +1,47 @@
|
||||
<?php
|
||||
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
if ($user['invis'] == 1) {
|
||||
$user['login'] = '<b><i>невидимка</i></b>';
|
||||
}
|
||||
if (($user->room > 2000) && ($user->room < 2100)) {
|
||||
echo "Не в Проходе...";
|
||||
} else {
|
||||
$magictime = (time() + 10 * 60);
|
||||
$target = $_POST['target'];
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align`,`room` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '10' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
echo "<font color=red><b>На персонаже \"$target\" уже есть путы </b></font>";
|
||||
} else {
|
||||
|
||||
if($user['invis'] == 1) { $user['login'] = '<b><i>невидимка</i></b>'; }
|
||||
if (($user->room > 2000) && ($user->room < 2100)) {echo "Не в Проходе...";}
|
||||
else {
|
||||
$magictime = (time()+10*60);
|
||||
$target=$_POST['target'];
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align`,`room` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '10' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
echo "<font color=red><b>На персонаже \"$target\" уже есть путы </b></font>";
|
||||
}
|
||||
else {
|
||||
|
||||
if ($tar['room']==$user->room) {
|
||||
if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('".$tar['id']."','Путы','$magictime',10);")) {
|
||||
$ldtarget=$target;
|
||||
|
||||
if ($user['sex'] == 1) {$action="наложил";}
|
||||
else {$action="наложила";}
|
||||
|
||||
$messch="Персонаж "{$user['login']}" $action путы на "$target"";
|
||||
|
||||
addch("<img src=i/magic/chains.gif> $messch");
|
||||
echo "<font color=red><b>Вы наложили путы на персонажа \"$target\"</b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж в другой комнате<b></font>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}}
|
||||
if ($tar['room'] == $user->room) {
|
||||
if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('" . $tar['id'] . "','Путы','$magictime',10);")) {
|
||||
$ldtarget = $target;
|
||||
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "наложил";
|
||||
} else {
|
||||
$action = "наложила";
|
||||
}
|
||||
|
||||
$messch = "Персонаж "{$user['login']}" $action путы на "$target"";
|
||||
|
||||
addch("<img src=i/magic/chains.gif> $messch");
|
||||
echo "<font color=red><b>Вы наложили путы на персонажа \"$target\"</b></font>";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж в другой комнате<b></font>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,47 +1,48 @@
|
||||
<?php
|
||||
|
||||
|
||||
if (empty($_SESSION['uid'])) {
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if($user['invis'] == 1) { $user['login'] = '<b><i>невидимка</i></b>'; }
|
||||
if (($user->room > 2000) && ($user->room < 2100)) {echo "Не в Проходе...";}
|
||||
else {
|
||||
$magictime = (time()+10*60*10);
|
||||
$target=$_POST['target'];
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align`,`room` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '10' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
echo "<font color=red><b>На персонаже \"$target\" уже есть путы </b></font>";
|
||||
}
|
||||
else {
|
||||
|
||||
if ($tar['room']==$user->room) {
|
||||
if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('".$tar['id']."','Паралич','$magictime',10);")) {
|
||||
$ldtarget=$target;
|
||||
|
||||
if ($user['sex'] == 1) {$action="паролизовал";}
|
||||
else {$action="паролизовала";}
|
||||
|
||||
$messch="Персонаж "{$user['login']}" $action "$target"";
|
||||
|
||||
addch("<img src=i/magic/chains.gif> $messch");
|
||||
echo "<font color=red><b>Вы парализовали персонажа \"$target\"</b></font>";
|
||||
$bet=1;
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж в другой комнате<b></font>";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}}
|
||||
if ($user['invis'] == 1) {
|
||||
$user['login'] = '<b><i>невидимка</i></b>';
|
||||
}
|
||||
if (($user->room > 2000) && ($user->room < 2100)) {
|
||||
echo "Не в Проходе...";
|
||||
} else {
|
||||
$magictime = (time() + 10 * 60 * 10);
|
||||
$target = $_POST['target'];
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align`,`room` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
if ($tar['id']) {
|
||||
$effect = mysql_fetch_array(mysql_query("SELECT `time` FROM `effects` WHERE `owner` = '{$tar['id']}' and `type` = '10' LIMIT 1;"));
|
||||
if ($effect['time']) {
|
||||
echo "<font color=red><b>На персонаже \"$target\" уже есть путы </b></font>";
|
||||
} else {
|
||||
|
||||
if ($tar['room'] == $user->room) {
|
||||
if (mysql_query("INSERT INTO `effects` (`owner`,`name`,`time`,`type`) values ('" . $tar['id'] . "','Паралич','$magictime',10);")) {
|
||||
$ldtarget = $target;
|
||||
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "паролизовал";
|
||||
} else {
|
||||
$action = "паролизовала";
|
||||
}
|
||||
|
||||
$messch = "Персонаж "{$user['login']}" $action "$target"";
|
||||
|
||||
addch("<img src=i/magic/chains.gif> $messch");
|
||||
echo "<font color=red><b>Вы парализовали персонажа \"$target\"</b></font>";
|
||||
$bet = 1;
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж в другой комнате<b></font>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,79 +1,76 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ($user['battle'] == 0) {
|
||||
echo "ќто боеваЯ магиЯ...";
|
||||
echo "ќто боеваЯ магиЯ...";
|
||||
} else {
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '17' ;"));
|
||||
|
||||
if ($user['intel'] >= 3) {
|
||||
$int=$magic['chanse'] + ($user['intel'] - 3)*3;
|
||||
if ($int>98){$int=99;}
|
||||
}
|
||||
else {$int=0;}
|
||||
$magic = mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '17' ;"));
|
||||
|
||||
if (rand(1,100) < $int) {
|
||||
//$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '".$user['login']." (клон%';"));
|
||||
//mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('".$user['login']." (клон ".($nb[0]+1).")','".$user['id']."','".$user['battle']."','".$user['hp']."');");
|
||||
//$bot = mysql_insert_id();
|
||||
$bot = mysql_fetch_array(mysql_query("SELECT * FROM `bots` WHERE `name` = '".$_POST['target']."';"));
|
||||
if($bot && strpos($_POST['target'],"(клон" )) {
|
||||
$bot = $bot[0];
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query ('SELECT * FROM `battle` WHERE `id` = '.$user['battle'].' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach($battle as $k => $v) {
|
||||
unset($battle[$k][$bot]);
|
||||
}
|
||||
|
||||
foreach($battle[$user['id']] as $k => $v) {
|
||||
$battle[$k][$bot] = array(0,0,time());
|
||||
}
|
||||
$t1 = explode(";",$bd['t1']);
|
||||
$t2 = explode(";",$bd['t2']);
|
||||
foreach($t1 as $k=>$v) {
|
||||
if($v==$bot) {
|
||||
unset($t1[$k]);
|
||||
}
|
||||
}
|
||||
foreach($t2 as $k=>$v) {
|
||||
if($v==$bot) {
|
||||
unset($t2[$k]);
|
||||
}
|
||||
}
|
||||
// проставлЯем кто-где
|
||||
if (in_array ($user['id'],$t1)) {
|
||||
$ttt = 1;
|
||||
$t1[] = $bot;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
$t2[] = $bot;
|
||||
}
|
||||
|
||||
$t1 = implode(";",$t1);
|
||||
$t2 = implode(";",$t2);
|
||||
|
||||
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick::id($user['id'])->short().' переманил клона '.nick::id($bot)->short().' на свою сторону<BR>\') WHERE `id` = '.$user['battle'].';');
|
||||
addlog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' переманил клона '.Nick::id($bot)->short().' на свою сторону<BR>');
|
||||
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t1` = \''.$t1.'\', `t2` = \''.$t2.'\' WHERE `id` = '.$user['battle'].' ;');
|
||||
|
||||
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = ".$user['battle']." LIMIT 1;");
|
||||
mysql_query("UPDATE bots set 'owner'='".$user['id']."' WHERE `name` = '".$_POST['target']."';");
|
||||
|
||||
$bet=1;
|
||||
echo "‚ы переманили клона";
|
||||
} else {
|
||||
echo "Ќет такого клона";
|
||||
}
|
||||
} else {
|
||||
echo "свиток рассыпалсЯ в ваших руках...";
|
||||
$bet=1;
|
||||
}
|
||||
if ($user['intel'] >= 3) {
|
||||
$int = $magic['chanse'] + ($user['intel'] - 3) * 3;
|
||||
if ($int > 98) {
|
||||
$int = 99;
|
||||
}
|
||||
} else {
|
||||
$int = 0;
|
||||
}
|
||||
|
||||
if (rand(1, 100) < $int) {
|
||||
$bot = mysql_fetch_array(mysql_query("SELECT * FROM `bots` WHERE `name` = '" . $_POST['target'] . "';"));
|
||||
if ($bot && strpos($_POST['target'], "(клон")) {
|
||||
$bot = $bot[0];
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = ' . $user['battle'] . ' LIMIT 1;'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach ($battle as $k => $v) {
|
||||
unset($battle[$k][$bot]);
|
||||
}
|
||||
|
||||
foreach ($battle[$user['id']] as $k => $v) {
|
||||
$battle[$k][$bot] = [0, 0, time()];
|
||||
}
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
$t2 = explode(";", $bd['t2']);
|
||||
foreach ($t1 as $k => $v) {
|
||||
if ($v == $bot) {
|
||||
unset($t1[$k]);
|
||||
}
|
||||
}
|
||||
foreach ($t2 as $k => $v) {
|
||||
if ($v == $bot) {
|
||||
unset($t2[$k]);
|
||||
}
|
||||
}
|
||||
// проставлЯем кто-где
|
||||
if (in_array($user['id'], $t1)) {
|
||||
$ttt = 1;
|
||||
$t1[] = $bot;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
$t2[] = $bot;
|
||||
}
|
||||
|
||||
$t1 = implode(";", $t1);
|
||||
$t2 = implode(";", $t2);
|
||||
|
||||
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' переманил клона ' . Nick::id($bot)->short() . ' на свою сторону<BR>');
|
||||
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t1` = \'' . $t1 . '\', `t2` = \'' . $t2 . '\' WHERE `id` = ' . $user['battle'] . ' ;');
|
||||
|
||||
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1;");
|
||||
mysql_query("UPDATE bots set 'owner'='" . $user['id'] . "' WHERE `name` = '" . $_POST['target'] . "';");
|
||||
|
||||
$bet = 1;
|
||||
echo "‚ы переманили клона";
|
||||
} else {
|
||||
echo "Ќет такого клона";
|
||||
}
|
||||
} else {
|
||||
echo "свиток рассыпалсЯ в ваших руках...";
|
||||
$bet = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
<?php
|
||||
if (empty($_SESSION['uid'])) header("Location: index.php");
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$u1 = filter_input(INPUT_POST, 'target');
|
||||
$u2 = filter_input(INPUT_POST, 'target1');
|
||||
@ -8,7 +11,7 @@ $u1Row = db::c()->query('SELECT `id`,`married`,`login` FROM `users` WHERE `login
|
||||
$u2Row = db::c()->query('SELECT `id`,`married`,`login` FROM `users` WHERE `login` = "?s"', $u2)->fetch_assoc();
|
||||
|
||||
if ($u1Row['id'] and $u2Row['id']) {
|
||||
if (($u1Row['married'] != $u2Row['login']) OR ($u2Row['married'] != $u1Row['login'])) {
|
||||
if (($u1Row['married'] != $u2Row['login']) or ($u2Row['married'] != $u1Row['login'])) {
|
||||
$status = "Персонажи {$u1Row['login']} и {$u2Row['login']} не состоят в браке друг с другом!";
|
||||
} else {
|
||||
if ($user['align'] > '1.6' && $user['align'] < '2') {
|
||||
|
@ -1,38 +1,43 @@
|
||||
<?php
|
||||
if($_SESSION['uid'] == null) { header("Location: index.php"); }
|
||||
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `klan`, `clone` FROM `abils_klan` WHERE `klan` = "'.$user['klan'].'" LIMIT 1'));
|
||||
|
||||
if($user['battle'] == 0) {
|
||||
echo "Это боевая магия...";
|
||||
} else {
|
||||
if($vip['clone'] >= 1) {
|
||||
if($user['invis'] == 1) { $user['login'] = 'невидимка'; }
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT COUNT(`id`) FROM `bots` WHERE `name` LIKE '".$user['login']." (клон%' AND `battle` = $user[battle]"));
|
||||
mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`, `owner`) values ('".$user['login']." (клон ".($nb[0]+1).")', '".$user['id']."', '".$user['battle']."', '".$user['hp']."', '".$user['id']."')");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query ('SELECT * FROM `battle` WHERE `id` = '.$user['battle'].' LIMIT 1'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = array(0, 0, time());
|
||||
}
|
||||
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
if(in_array($user['id'], $t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
$lo = Nick::id($user['id'])->short();
|
||||
$los = Nick::id($bot)->short();
|
||||
addlog($user['battle'], '<span class=date>'.date("H:i").'</span> '.$lo.' породил своего клона '.$los.'.<BR>');
|
||||
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$bot.'\') WHERE `id` = "'.$user['battle'].'" LIMIT 1');
|
||||
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = ".$user['battle']." LIMIT 1");
|
||||
echo "Клон создан";
|
||||
$vip['clone'] -= 1;
|
||||
mysql_query('UPDATE `abils_klan` SET `clone` = "'.$vip['clone'].'" WHERE `klan` = "'.$vip['klan'].'" LIMIT 1');
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
}
|
||||
if ($_SESSION['uid'] == null) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `klan`, `clone` FROM `abils_klan` WHERE `klan` = "' . $user['klan'] . '" LIMIT 1'));
|
||||
|
||||
if ($user['battle'] == 0) {
|
||||
echo "Это боевая магия...";
|
||||
} else {
|
||||
if ($vip['clone'] >= 1) {
|
||||
if ($user['invis'] == 1) {
|
||||
$user['login'] = 'невидимка';
|
||||
}
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT COUNT(`id`) FROM `bots` WHERE `name` LIKE '" . $user['login'] . " (клон%' AND `battle` = $user[battle]"));
|
||||
mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`, `owner`) values ('" . $user['login'] . " (клон " . ($nb[0] + 1) . ")', '" . $user['id'] . "', '" . $user['battle'] . "', '" . $user['hp'] . "', '" . $user['id'] . "')");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = ' . $user['battle'] . ' LIMIT 1'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach ($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = [0, 0, time()];
|
||||
}
|
||||
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
if (in_array($user['id'], $t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
$lo = Nick::id($user['id'])->short();
|
||||
$los = Nick::id($bot)->short();
|
||||
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . $lo . ' породил своего клона ' . $los . '.<BR>');
|
||||
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '` = CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = "' . $user['battle'] . '" LIMIT 1');
|
||||
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1");
|
||||
echo "Клон создан";
|
||||
$vip['clone'] -= 1;
|
||||
mysql_query('UPDATE `abils_klan` SET `clone` = "' . $vip['clone'] . '" WHERE `klan` = "' . $vip['klan'] . '" LIMIT 1');
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
}
|
||||
}
|
||||
|
@ -1,67 +1,70 @@
|
||||
<?php
|
||||
if($_SESSION['uid'] == null) { header("Location: index.php"); }
|
||||
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `klan`, `unclone` FROM `abils_klan` WHERE `klan` = "'.$user['klan'].'" LIMIT 1'));
|
||||
|
||||
if($user['battle'] == 0) {
|
||||
echo "Это боевая магия...";
|
||||
} else {
|
||||
if($vip['unclone'] >= 1) {
|
||||
$bot = mysql_fetch_array(mysql_query("SELECT * FROM `bots` WHERE `name` = '".mysql_real_escape_string($_POST['target'])."' AND `battle` = '".$user['battle']."' LIMIT 1"));
|
||||
|
||||
if($bot) {
|
||||
$prototype = mysql_fetch_array(mysql_query('SELECT `id`, `intel` FROM `users` WHERE `id` = "'.$bot['prototype'].'" LIMIT 1'));
|
||||
}
|
||||
if($prototype['intel'] > $user['intel']) {
|
||||
echo 'Ваш противник имеет более высокий интелект ...';
|
||||
} elseif($bot && strpos($_POST['target'], "клон")) {
|
||||
$bot = $bot[0];
|
||||
$bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach($battle as $k => $v) {
|
||||
unset($battle[$k][$bot]);
|
||||
}
|
||||
|
||||
foreach($battle[$user['id']] as $k => $v) {
|
||||
$battle[$k][$bot] = array(0, 0, time());
|
||||
}
|
||||
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
$t2 = explode(";", $bd['t2']);
|
||||
|
||||
foreach($t1 as $k => $v) {
|
||||
if($v == $bot) {
|
||||
unset($t1[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach($t2 as $k => $v) {
|
||||
if($v == $bot) {
|
||||
unset($t2[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
if(in_array($user['id'], $t1)) {
|
||||
$ttt = 1;
|
||||
$t1[] = $bot;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
$t2[] = $bot;
|
||||
}
|
||||
|
||||
$t1 = implode(";", $t1);
|
||||
$t2 = implode(";", $t2);
|
||||
|
||||
addlog($user['battle'],'<span class=date>'.date("H:i").'</span> '.Nick::id($user['id'])->short().' переманил клона '.Nick::id($bot)->short().' на свою сторону<BR>');
|
||||
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t1` = \''.$t1.'\', `t2` = \''.$t2.'\' WHERE `id` = '.$user['battle'].' LIMIT 1');
|
||||
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = ".$user['battle']." LIMIT 1");
|
||||
echo "Вы переманили клона";
|
||||
$vip['unclone'] -= 1;
|
||||
mysql_query('UPDATE `abils_klan` SET `unclone` = "'.$vip['unclone'].'" WHERE `klan` = "'.$vip['klan'].'" LIMIT 1');
|
||||
} else {
|
||||
echo "Нет такого клона";
|
||||
}
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
}
|
||||
if ($_SESSION['uid'] == null) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `klan`, `unclone` FROM `abils_klan` WHERE `klan` = "' . $user['klan'] . '" LIMIT 1'));
|
||||
|
||||
if ($user['battle'] == 0) {
|
||||
echo "Это боевая магия...";
|
||||
} else {
|
||||
if ($vip['unclone'] >= 1) {
|
||||
$bot = mysql_fetch_array(mysql_query("SELECT * FROM `bots` WHERE `name` = '" . mysql_real_escape_string($_POST['target']) . "' AND `battle` = '" . $user['battle'] . "' LIMIT 1"));
|
||||
|
||||
if ($bot) {
|
||||
$prototype = mysql_fetch_array(mysql_query('SELECT `id`, `intel` FROM `users` WHERE `id` = "' . $bot['prototype'] . '" LIMIT 1'));
|
||||
}
|
||||
if ($prototype['intel'] > $user['intel']) {
|
||||
echo 'Ваш противник имеет более высокий интелект ...';
|
||||
} elseif ($bot && strpos($_POST['target'], "клон")) {
|
||||
$bot = $bot[0];
|
||||
$bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "' . $user['battle'] . '" LIMIT 1'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach ($battle as $k => $v) {
|
||||
unset($battle[$k][$bot]);
|
||||
}
|
||||
|
||||
foreach ($battle[$user['id']] as $k => $v) {
|
||||
$battle[$k][$bot] = [0, 0, time()];
|
||||
}
|
||||
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
$t2 = explode(";", $bd['t2']);
|
||||
|
||||
foreach ($t1 as $k => $v) {
|
||||
if ($v == $bot) {
|
||||
unset($t1[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($t2 as $k => $v) {
|
||||
if ($v == $bot) {
|
||||
unset($t2[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array($user['id'], $t1)) {
|
||||
$ttt = 1;
|
||||
$t1[] = $bot;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
$t2[] = $bot;
|
||||
}
|
||||
|
||||
$t1 = implode(";", $t1);
|
||||
$t2 = implode(";", $t2);
|
||||
|
||||
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . Nick::id($user['id'])->short() . ' переманил клона ' . Nick::id($bot)->short() . ' на свою сторону<BR>');
|
||||
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t1` = \'' . $t1 . '\', `t2` = \'' . $t2 . '\' WHERE `id` = ' . $user['battle'] . ' LIMIT 1');
|
||||
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1");
|
||||
echo "Вы переманили клона";
|
||||
$vip['unclone'] -= 1;
|
||||
mysql_query('UPDATE `abils_klan` SET `unclone` = "' . $vip['unclone'] . '" WHERE `klan` = "' . $vip['klan'] . '" LIMIT 1');
|
||||
} else {
|
||||
echo "Нет такого клона";
|
||||
}
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
}
|
||||
}
|
||||
|
@ -1,38 +1,51 @@
|
||||
<?php
|
||||
if($_SESSION['uid'] == null) { header("Location: index.php"); }
|
||||
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `clone` FROM `abils_user` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
|
||||
|
||||
if($user['battle'] == 0) {
|
||||
echo "Это боевая магия...";
|
||||
} else {
|
||||
if($vip['clone'] >= 1) {
|
||||
if($user['invis'] == 1) { $user['login'] = 'невидимка'; }
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT COUNT(`id`) FROM `bots` WHERE `battle` = $user[battle] AND `name` LIKE '".$user['login']." (клон%'"));
|
||||
mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`, `owner`) VALUES ('".$user['login']." (клон ".($nb[0]+1).")', '".$user['id']."', '".$user['battle']."', '".$user['hp']."', '".$user['id']."')");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query('SELECT `id`, `t1`, `t2`, `teams` FROM `battle` WHERE `id` = "'.$user['battle'].'" LIMIT 1'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = array(0, 0, time());
|
||||
}
|
||||
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
if(in_array($user['id'], $t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
if($user['invis'] == 1) { $lo = '<i><b>невидимка</b></i>'; } else { $lo = Nick::id($user['id'])->short(); }
|
||||
if($user['invis'] == 1) { $los = '<i><b>невидимка</b></i>'; } else { $los = Nick::id($bot)->short(); }
|
||||
addlog($user['battle'], '<span class=date>'.date("H:i").'</span> '.$lo.' породил своего клона '.$los.'.<BR><hr>');
|
||||
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$bot.'\') WHERE `id` = "'.$user['battle'].'" LIMIT 1');
|
||||
mysql_query("UPDATE `battle` SET `to1` = '".time()."', `to2` = '".time()."' WHERE `id` = ".$user['battle']." LIMIT 1");
|
||||
echo "Клон создан";
|
||||
$vip['clone'] -= 1;
|
||||
mysql_query('UPDATE `abils_user` SET `clone` = "'.$vip['clone'].'" WHERE `id` = "'.$vip['id'].'" LIMIT 1');
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
}
|
||||
if ($_SESSION['uid'] == null) {
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `clone` FROM `abils_user` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
|
||||
|
||||
if ($user['battle'] == 0) {
|
||||
echo "Это боевая магия...";
|
||||
} else {
|
||||
if ($vip['clone'] >= 1) {
|
||||
if ($user['invis'] == 1) {
|
||||
$user['login'] = 'невидимка';
|
||||
}
|
||||
$nb = mysql_fetch_array(mysql_query("SELECT COUNT(`id`) FROM `bots` WHERE `battle` = $user[battle] AND `name` LIKE '" . $user['login'] . " (клон%'"));
|
||||
mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`, `owner`) VALUES ('" . $user['login'] . " (клон " . ($nb[0] + 1) . ")', '" . $user['id'] . "', '" . $user['battle'] . "', '" . $user['hp'] . "', '" . $user['id'] . "')");
|
||||
$bot = mysql_insert_id();
|
||||
|
||||
$bd = mysql_fetch_array(mysql_query('SELECT `id`, `t1`, `t2`, `teams` FROM `battle` WHERE `id` = "' . $user['battle'] . '" LIMIT 1'));
|
||||
$battle = unserialize($bd['teams']);
|
||||
$battle[$bot] = $battle[$user['id']];
|
||||
foreach ($battle[$bot] as $k => $v) {
|
||||
$battle[$k][$bot] = [0, 0, time()];
|
||||
}
|
||||
|
||||
$t1 = explode(";", $bd['t1']);
|
||||
if (in_array($user['id'], $t1)) {
|
||||
$ttt = 1;
|
||||
} else {
|
||||
$ttt = 2;
|
||||
}
|
||||
if ($user['invis'] == 1) {
|
||||
$lo = '<i><b>невидимка</b></i>';
|
||||
} else {
|
||||
$lo = Nick::id($user['id'])->short();
|
||||
}
|
||||
if ($user['invis'] == 1) {
|
||||
$los = '<i><b>невидимка</b></i>';
|
||||
} else {
|
||||
$los = Nick::id($bot)->short();
|
||||
}
|
||||
addlog($user['battle'], '<span class=date>' . date("H:i") . '</span> ' . $lo . ' породил своего клона ' . $los . '.<BR><hr>');
|
||||
mysql_query('UPDATE `battle` SET `teams` = \'' . serialize($battle) . '\', `t' . $ttt . '` = CONCAT(`t' . $ttt . '`,\';' . $bot . '\') WHERE `id` = "' . $user['battle'] . '" LIMIT 1');
|
||||
mysql_query("UPDATE `battle` SET `to1` = '" . time() . "', `to2` = '" . time() . "' WHERE `id` = " . $user['battle'] . " LIMIT 1");
|
||||
echo "Клон создан";
|
||||
$vip['clone'] -= 1;
|
||||
mysql_query('UPDATE `abils_user` SET `clone` = "' . $vip['clone'] . '" WHERE `id` = "' . $vip['id'] . '" LIMIT 1');
|
||||
} else {
|
||||
echo "Свиток рассыпался в ваших руках...";
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user