Compare commits

...

9 Commits

41 changed files with 5867 additions and 9142 deletions

View File

@ -9,11 +9,12 @@ require_once 'mysql_override.php';
require_once 'class/Insallah/Config.php';
spl_autoload_register(function (string $className) {
$rootdir = getcwd() . '/_incl_data';
# 1 with namespaces
# 2 without
$fileName = [
__DIR__ . '/class/' . str_replace('\\', DIRECTORY_SEPARATOR, $className . '.php'),
__DIR__ . '/class/' . $className . '.php'
$rootdir . '/class/' . str_replace('\\', DIRECTORY_SEPARATOR, $className . '.php'),
$rootdir . '/class/' . $className . '.php'
];
foreach ($fileName as $file) {
if (file_exists($file)) {
@ -24,10 +25,11 @@ spl_autoload_register(function (string $className) {
});
spl_autoload_register(function (string $classname) {
$rootdir = getcwd() . '/_incl_data';
$classMap = [
'NewCombats' => __DIR__ . '/class/',
'Insallah' => __DIR__ . '/class/Insallah/',
'DarksLight2' => __DIR__ . '/class/DarksLight2/',
'NewCombats' => $rootdir . '/class/',
'Insallah' => $rootdir . '/class/Insallah/',
'DarksLight2' => $rootdir . '/class/DarksLight2/',
];
$parts = explode('\\', $classname);
$namespace = array_shift($parts);

View File

@ -0,0 +1,71 @@
<?php
namespace Core;
class ArraySorter
{
/**
* Groups an array by a given key.
*
* Groups an array into arrays by a given key, or set of keys, shared between all array members.
*
* Based on {@author Jake Zatecky}'s {@link https://github.com/jakezatecky/array_group_by array_group_by()} function.
* This variant allows $key to be closures.
*
* @param array $array The array to have grouping performed on.
* @param mixed $key,... The key to group or split by. Can be a _string_,
* an _integer_, a _float_, or a _callable_.
*
* If the key is a callback, it must return
* a valid key from the array.
*
* If the key is _NULL_, the iterated element is skipped.
*
* ```
* string|int callback ( mixed $item )
* ```
*
* @return array|null Returns a multidimensional array or `null` if `$key` is invalid.
*/
public static function groupBy(array $array, $key): ?array
{
if (!is_string($key) && !is_int($key) && !is_float($key) && !is_callable($key)) {
return null;
}
$func = (!is_string($key) && is_callable($key) ? $key : null);
$key2 = $key;
// Load the new array, splitting by the target key
$grouped = [];
foreach ($array as $value) {
$key = null;
if (is_callable($func)) {
$key = call_user_func($func, $value);
} elseif (is_object($value) && property_exists($value, $key2)) {
$key = $value->{$key2};
} elseif (isset($value[$key2])) {
$key = $value[$key2];
}
if ($key === null) {
continue;
}
$grouped[$key][] = $value;
}
// Recursively build a nested grouping if more parameters are supplied
// Each grouped array value is grouped according to the next sequential key
if (func_num_args() > 2) {
$args = func_get_args();
foreach ($grouped as $key => $value) {
$params = array_merge([$value], array_slice($args, 2, func_num_args()));
$grouped[$key] = call_user_func_array('array_group_by', $params);
}
}
return $grouped;
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace Core;
class ComparsionHelper
{
public static function minimax($value, $minimum, $maximum)
{
if ($value < $minimum) {
$value = $minimum;
}
if ($value > $maximum) {
$value = $maximum;
}
return $value;
}
}

View File

@ -5,17 +5,7 @@ namespace Core;
class Config
{
private static self $instance;
private function __construct()
{
// error_reporting(E_ALL ^ E_NOTICE);
// ini_set('display_errors', 'Off');
// ini_set('date.timezone', 'Europe/Moscow');
// header('Cache-Control: no-cache, no-store, must-revalidate');
// header('Pragma: no-cache');
// header('Expires: 0');
}
private function __construct() {}
public static function get(?string $key = null)
{
@ -36,8 +26,8 @@ class Config
$c['thiscity'] = 'capitalcity';
$c['capitalcity'] = $c['host'];
$c['abandonedplain'] = $c['host'];
$c['https'] = 'https://' . $c['host'] . DIRECTORY_SEPARATOR;
$c['exit'] = '<script>top.location.href="' . $c['https'] . '";</script>';
$c['https'] = '//' . $c['host'] . DIRECTORY_SEPARATOR;
$c['exit'] = '<script>top.location.href="//' . $c['host'] . '/";</script>';
$c['support'] = 'support@' . $c['host'];

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,61 @@
<?php
namespace FightRequest;
class FRHelper
{
/** Ń÷čňŕĺň đŕçđĺřĺííűĺ óđîâíč čăđîęîâ â ăđóďďîâűő çŕ˙âęŕő.
* @param int $type ňčď ôčëüňđŕ.
* @param int $userLevel óđîâĺíü čăđîęŕ ďîäŕţůĺăî çŕ˙âęó.
* @return object
*/
public static function getTeammatesLevel(int $type, int $userLevel): object
{
$min = 0;
$max = 21;
switch ($type) {
default:
break;
case 1: // ňîëüęî ěîĺăî č íčćĺ
$max = $userLevel;
break;
case 2: // ňîëüęî íčćĺ ěîĺăî
$max = $userLevel - 1;
break;
case 3: // ňîëüęî ěîĺăî
$min = $userLevel;
$max = $userLevel;
break;
case 4: // íĺ âűřĺ ěĺí˙ íŕ 1 óđîâĺíü
$min = $userLevel;
$max = $userLevel + 1;
break;
case 5: // íĺ íčćĺ ěĺí˙ íŕ 1 óđîâĺíü
$min = $userLevel - 1;
$max = $userLevel;
break;
case 6: // ěîé óđîâĺíü +- 1
$min = $userLevel - 1;
$max = $userLevel + 1;
break;
}
return (object)[
'min'=> $min,
'max'=> $max,
];
}
/** Ń÷čňŕĺň đŕçđĺřĺííűĺ óđîâíč čăđîęîâ â őŕîňč÷ĺńęčő çŕ˙âęŕő.
* @param int $type ňčď ôčëüňđŕ.
* @param int $userLevel óđîâĺíü čăđîęŕ ďîäŕţůĺăî çŕ˙âęó.
* @return object
*/
public static function getChaoticTeammatesLevel(int $type, int $userLevel): object
{
if (!in_array($type, [3, 6])) {
$type = 0;
}
return self::getTeammatesLevel($type, $userLevel);
}
}

View File

@ -1,12 +1,14 @@
<?php
namespace Insallah;
namespace Tournament;
use Core\Db;
class Tournament
{
const IS_ENABLED = true;
const IS_ENABLED = false;
private const SEND_CHAT_MESSAGE = 3;
private const START_TOURNAMENT = 5;
public const START_TOURNAMENT = 5;
private const PRIZE1 = 25;
private const PRIZE2 = 10;
private const PRIZE3 = 5;
@ -72,12 +74,11 @@ class Tournament
*/
public function startAllBattles(): void
{
$db = new Db();
$db::sql(
Db::sql(
'delete from tournaments where start_time + date_add(start_time,interval 30 minute) < unix_timestamp()'
);
TournamentModel::removeFighter(TournamentModel::getLooser());
$tournamentLevels = $db::getColumn('select tid from tournaments where start_time = -1');
$tournamentLevels = Db::getColumn('select tid from tournaments where start_time = -1');
foreach ($tournamentLevels as $level) {
$aliveFighters = TournamentModel::getFreeFighters($level);
if (count($aliveFighters) > 1) {

View File

@ -1,6 +1,10 @@
<?php
namespace Insallah;
namespace Tournament;
use Chat;
use ChatMessage;
use Core\Db;
class TournamentModel
{
@ -15,8 +19,7 @@ class TournamentModel
*/
public static function getUserLevel(int $uid): int
{
$db = new Db();
$level = $db::getValue('select level from users where id = ? and level between 8 and 12 and battle = 0', [$uid]);
$level = Db::getValue('select level from users where id = ? and level between 8 and 12 and battle = 0', [$uid]);
return $level ?: 0;
}
@ -28,11 +31,10 @@ class TournamentModel
*/
public static function isEkrOverpriced(int $uid, ?int $level = null): bool
{
$db = new Db();
if (is_null($level)) {
$level = $db::getValue('select level from users where id = ?', [$uid]);
$level = Db::getValue('select level from users where id = ?', [$uid]);
}
$wearedItemsEkrPrice = $db::getValue('select sum(2price) from items_users where inOdet > 0 and uid = ?', [$uid]);
$wearedItemsEkrPrice = Db::getValue('select sum(2price) from items_users where inOdet > 0 and uid = ?', [$uid]);
return $wearedItemsEkrPrice > Tournament::ekrOverpriceFormula($level);
}
@ -43,9 +45,8 @@ class TournamentModel
*/
public static function isEnoughExperience(int $uid): bool
{
$db = new Db();
return $db::getValue('select exp from stats where id = ?', [$uid]) >= Tournament::MIN_EXP;
}
return Db::getValue('select exp from stats where id = ?', [$uid]) >= Tournament::MIN_EXP;
}
/**
* @param int $uid
@ -54,8 +55,7 @@ class TournamentModel
*/
public static function isRestrictedToJoin(int $uid): bool
{
$db = new Db();
return $db::getValue('select count(*) from eff_users where uid = ? and id_eff = 486 and `delete` = 0', [$uid]);
return Db::getValue('select count(*) from eff_users where uid = ? and id_eff = 486 and `delete` = 0', [$uid]);
}
/**
@ -65,8 +65,7 @@ class TournamentModel
*/
public static function isStarted(int $tid): bool
{
$db = new Db();
return $db::getValue('select count(*) from tournaments where start_time = -1 and tid = ?', [$tid]);
return Db::getValue('select count(*) from tournaments where start_time = -1 and tid = ?', [$tid]);
}
/**
@ -78,8 +77,7 @@ class TournamentModel
*/
public static function getWaitingMembersQuantity(int $tid): int
{
$db = new Db();
return $db::getValue('select count(*) from tournaments_users where tid = ?', [$tid]);
return Db::getValue('select count(*) from tournaments_users where tid = ?', [$tid]);
}
/**
@ -91,8 +89,7 @@ class TournamentModel
*/
public static function createTournament(int $tid): void
{
$db = new Db();
$db::sql('insert into tournaments (tid) values (?)', [$tid]);
Db::sql('insert into tournaments (tid) values (?)', [$tid]);
}
/**
@ -107,8 +104,7 @@ class TournamentModel
{
/** Кастомные комнаты 25008 - 25012. */
$roomId = 25000 + $tid;
$db = new Db();
$db::sql('insert into tournaments_users (tid, uid) values (?, ?)', [$tid, $uid]);
Db::sql('insert into tournaments_users (tid, uid) values (?, ?)', [$tid, $uid]);
self::teleport($uid, $roomId);
}
@ -121,8 +117,7 @@ class TournamentModel
*/
public static function startTournament(int $tid): void
{
$db = new Db();
$db::sql('update tournaments set start_time = -1 where tid = ?', [$tid]);
Db::sql('update tournaments set start_time = -1 where tid = ?', [$tid]);
}
/**
@ -134,9 +129,8 @@ class TournamentModel
*/
public static function destroyTournament(int $tid): void
{
$db = new Db();
//Убедиться что в базе настроен foreign_keys и последует автоочистка tournaments_users !!!
$db::sql('delete from tournaments where tid = ?', [$tid]);
Db::sql('delete from tournaments where tid = ?', [$tid]);
}
/**
@ -148,9 +142,8 @@ class TournamentModel
*/
public static function getFightersTeams(array $fightersList): array
{
$db = new Db();
$query = sprintf("select id from users where battle = 0 and id in (%s)", implode(', ', $fightersList));
return array_chunk($db::getColumn($query), 2);
return array_chunk(Db::getColumn($query), 2);
}
/**
@ -162,8 +155,9 @@ class TournamentModel
*/
public static function getFreeFighters(int $tid): array
{
$db = new Db();
return $db::getColumn('select uid from tournaments_users where tid = ? and death_time = 0 order by uid', [$tid]);
return Db::getColumn(
'select uid from tournaments_users where tid = ? and death_time = 0 order by uid', [$tid]
);
}
/**
@ -175,12 +169,13 @@ class TournamentModel
*/
public static function getWinners(int $tid): array
{
$db = new Db();
$winners = $db::getColumn('select uid from tournaments_users where tid = ? order by death_time desc limit 3', [$tid]);
$winners = Db::getColumn(
'select uid from tournaments_users where tid = ? order by death_time desc limit 3', [$tid]
);
return [
1 => $winners[0],
2 => $winners[1],
3 => $winners[2]
3 => $winners[2],
];
}
@ -210,8 +205,8 @@ class TournamentModel
inner join battle_users bu on b.team_win != bu.team and b.id = bu.battle
inner join tournaments_users tu on bu.uid = tu.uid
where typeBattle = 25000 and death_time = 0 order by b.time_start desc limit 1';
$db = new Db;
$row = $db::getRow($query);
$row = Db::getRow($query);
return $row['uid'] ?? 0;
}
@ -228,8 +223,9 @@ class TournamentModel
return;
}
//$winner_timer_add = $winner? 500 : 0; # Последный ДОЛЖЕН быть последним.
$db = new Db();
$db::sql('update tournaments_users set death_time = unix_timestamp() + 500 where death_time = 0 and uid = ?', [$uid]);
Db::sql(
'update tournaments_users set death_time = unix_timestamp() + 500 where death_time = 0 and uid = ?', [$uid]
);
self::teleport($uid, 9);
//fixme: Классы не подключаются друг к другу. Нужно менять архитектуру игры. :(
Db::sql("update users_achiv set trn = trn + 1 where id = ?", [$uid]);
@ -245,8 +241,7 @@ class TournamentModel
*/
public static function getTournamentIdByUserId(int $uid)
{
$db = new Db();
return $db::getValue('select tid from tournaments_users where uid = ?', [$uid]);
return Db::getValue('select tid from tournaments_users where uid = ?', [$uid]);
}
/**
@ -262,18 +257,19 @@ class TournamentModel
*/
public static function startBattle(int $uid1, int $uid2): void
{
$db = new Db();
$check = Db::getValue('select count(*) from users where id in (?, ?) and battle = 0', [$uid1, $uid2]);
if ($check !== 2) {
return;
}
$db::exec('insert into battle (city, time_start, timeout, type, invis, noinc, travmChance, typeBattle)
values (\'capitalcity\', unix_timestamp(), 60, 0, 1, 1, 0, 25000)');
$bid = $db::lastInsertId(); // ВАЖНО!
$db::sql('update stats set team = 1, hpNow = hpAll, mpNow = mpAll where id = ?', [$uid1]);
$db::sql('update stats set team = 2, hpNow = hpAll, mpNow = mpAll where id = ?', [$uid2]);
$db::sql('update users set battle = ? where id in (?, ?)', [$bid, $uid1, $uid2]);
Db::exec(
'insert into battle (city, time_start, timeout, type, invis, noinc, travmChance, typeBattle)
values (\'capitalcity\', unix_timestamp(), 60, 0, 1, 1, 0, 25000)'
);
$bid = Db::lastInsertId(); // ВАЖНО!
Db::sql('update stats set team = 1, hpNow = hpAll, mpNow = mpAll where id = ?', [$uid1]);
Db::sql('update stats set team = 2, hpNow = hpAll, mpNow = mpAll where id = ?', [$uid2]);
Db::sql('update users set battle = ? where id in (?, ?)', [$bid, $uid1, $uid2]);
}
/**
@ -285,8 +281,7 @@ class TournamentModel
*/
public static function uidToLogin(int $uid)
{
$db = new Db();
return $db::getValue('select login from users where id = ?', [$uid]);
return Db::getValue('select login from users where id = ?', [$uid]);
}
/**
@ -299,8 +294,7 @@ class TournamentModel
*/
private static function teleport(int $uid, int $roomId): void
{
$db = new Db();
$db::sql('update users set room = ? where id = ?', [$roomId, $uid]);
Db::sql('update users set room = ? where id = ?', [$roomId, $uid]);
}
/**
@ -315,12 +309,12 @@ class TournamentModel
if (empty($message)) {
return;
}
$cmsg = new \ChatMessage();
$cmsg = new ChatMessage();
$cmsg->setDa(1);
$cmsg->setType(6);
$cmsg->setText($message);
$cmsg->setColor('forestgreen');
(new \Chat())->sendMsg($cmsg);
(new Chat())->sendMsg($cmsg);
}
/**
@ -337,10 +331,9 @@ class TournamentModel
values (4754, :uid, :data, 1, unix_timestamp(), unix_timestamp())';
$args = [
'uid' => $uid,
'data' => 'nosale=1|musor=1|sudba=' . self::uidToLogin($uid) . '|lvl=8|tr_s1=0|tr_s2=0|tr_s3=0|tr_s4=0'
'data' => 'nosale=1|musor=1|sudba=' . self::uidToLogin($uid) . '|lvl=8|tr_s1=0|tr_s2=0|tr_s3=0|tr_s4=0',
];
$db = new Db();
$stmt = $db::prepare($query);
$stmt = Db::prepare($query);
for ($i = 0; $i < $quantity; $i++) {
$stmt->execute($args);
}
@ -354,9 +347,8 @@ class TournamentModel
*/
public static function giveDelay(int $uid, int $unixtime): void
{
$db = new Db();
$query = 'insert into eff_users (id_eff, uid, name, timeUse) VALUES (?,?,?,?)';
$args = [486, $uid, 'Призёр городского турнира!', $unixtime];
$db::sql($query, $args);
Db::sql($query, $args);
}
}

View File

@ -1,559 +0,0 @@
<?php
use Core\Db;
class Tournir
{
private User $u;
private array $info;
private array $user;
private array $name = [0 => 'Выжить любой ценой', 1 => 'Каждый сам за себя', 2 => 'Захват ключа',];
public function __construct()
{
$this->u = User::start();
$this->start();
$this->locationSee();
}
private function start()
{
$this->info = Db::getRow('select * from turnirs where id = ?', [$this->u->info['inTurnirnew']]);
$this->user = Db::getRow(
'select * from users_turnirs where turnir = ? and bot = ?',
[$this->u->info['inTurnirnew'], $this->u->info['id']]
);
}
private function startTurnir()
{
$row = Db::getValue('select count(*) from users where win = 0 and lose = 0 and nich = 0');
if (!$row || $this->info['status'] == 3) {
if ($this->info['status'] == 3) {
$this->finishTurnir();
}
} else {
Db::sql('update turnirs set status = 3 where id = ?', [$this->info['id']]);
//Создание поединка
Db::sql(
'insert into battle (city, time_start, timeout, type, turnir) values (?,unix_timestamp(),60,1,?)',
[$this->u->info['city'], $this->info['id']]
);
$uri = Db::lastInsertId();
//Закидываем персонажей в поединок
Db::sql('update users set battle = ? where inUser = 0 and inTurnirnew = ?', [$uri, $this->info['id']]);
//Обозначаем завершение турнира при выходе
die('Перейтиде в раздел "поединки"...');
}
}
private function finishTurnir()
{
$chat = new Chat();
$cmsg = new ChatMessage();
$cmsg->setType(6);
$this->info = mysql_fetch_array(
mysql_query('SELECT * FROM `turnirs` WHERE `id` = ' . $this->u->info['inTurnirnew'])
);
if ($this->info['status'] != 3) {
return;
}
$win = '';
$lose = '';
$sp = mysql_query(
'SELECT * FROM `users_turnirs` WHERE `turnir` = "' . $this->info['id'] . '" ORDER BY `points` DESC'
);
while ($pl = mysql_fetch_array($sp)) {
mysql_query('DELETE FROM `users_turnirs` WHERE `turnir` = "' . $this->info['id'] . '"');
$inf = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $pl['uid'] . '" LIMIT 1'));
$bot = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $pl['bot'] . '" LIMIT 1'));
if (isset($inf['id'], $bot['id'])) {
//выдаем призы и т.д
mysql_query('DELETE FROM `users` WHERE `id` = "' . $bot['id'] . '" LIMIT 1');
mysql_query('DELETE FROM `stats` WHERE `id` = "' . $bot['id'] . '" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $bot['id'] . '" LIMIT 1000');
mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $bot['id'] . '" LIMIT 1000');
}
if ($pl['team'] == $this->info['winner'] && $this->info['winner'] != 0) {
$inf['add_expp'] = [0, 1, 5, 10, 15, 25, 35, 70, 100, 150, 200, 300, 500, 700, 1000];
//получаем опыт (с 0 по 12 лвл)
$inf['add_expn'] = [10, 30, 55, 62, 92, 180, 350, 1350, 4500, 7000, 21000, 30000, 35000];
$inf['add_expn'] = $inf['add_expn'][$inf['level']];
mysql_query(
'UPDATE `users` SET `win` = `win` + 1,`win_t` = `win_t` + 1 WHERE `id` = "' . $inf['id'] . '" LIMIT 1'
);
mysql_query(
'UPDATE `stats` SET `exp` = `exp` + ' . $inf['add_expn'] . ' WHERE `id` = "' . $inf['id'] . '" LIMIT 1'
);
$win .= '<b>' . $inf['login'] . '</b>, ';
$cmsg->setRoom($inf['room']);
$cmsg->setTo($inf['login']);
$cmsg->setText("Турнир завершен. Вы являетесь победителем турнира, получено опыта: <b>{$inf['add_expn']}</b>.");
$chat->sendMsg($cmsg);
} elseif ($pl['team'] != $this->info['winner'] && $this->info['winner'] != 0) {
mysql_query(
'UPDATE `users` SET `lose` = `lose` + 1,`lose_t` = `lose_t` + 1 WHERE `id` = "' . $inf['id'] . '" LIMIT 1'
);
$lose .= '<b>' . $inf['login'] . '</b>, ';
} else {
mysql_query('UPDATE `users` SET `nich` = `nich` + 1 WHERE `id` = "' . $inf['id'] . '" LIMIT 1');
}
mysql_query('DELETE FROM `users_turnirs` WHERE `uid` = "' . $inf['id'] . '" LIMIT 1');
}
mysql_query(
'UPDATE `users` SET `inUser` = 0,`inTurnirnew` = 0 WHERE `inTurnirnew` = "' . $this->info['id'] . '" LIMIT ' . $this->info['users_in']
);
mysql_query(
'UPDATE `turnirs` SET `chat` = 4 , `winner` = -1,`users_in` = 0,`status` = 0,`winner` = -1,`step` = 0,`time` = "' . (time(
) + $this->info['time2']) . '",`count` = `count` + 1 WHERE `id` = ' . $this->info['id'] . ' LIMIT 1'
);
if ($win != '') {
$win = rtrim($win, ', ');
$lose = rtrim($lose, ', ');
$win = 'Победители турнира: ' . $win . '. Проигравшая сторона: ' . $lose . '. Следующий турнир начнется через ' . $this->u->timeOut(
$this->info['time2']
) . ' (' . date('d.m.Y H:i', (time() + $this->info['time2'])) . ').';
} else {
$win = 'Победители турнира отсутствует. Следующий турнир начнется через ' . $this->u->timeOut(
$this->info['time2']
) . ' (' . date('d.m.Y H:i', (time() + $this->info['time2'])) . ').';
}
$cmsg->setText('<b>Турнир завершен.</b> ' . $win);
$chat->sendMsg($cmsg);
}
private function locationSee()
{
$r = '';
$tm1 = '';
$tm2 = '';
$noitm = [869 => 1, 1246 => 1, 155 => 1, 1245 => 1, 678 => 1];
//получение комплекта
if ($this->info['step'] != 3 && $this->info['step'] != 0 && isset($_GET['gocomplect']) && $this->user['points'] < 2) {
$aso = explode(',', $this->user['items']);
$ast = explode('-', $_GET['gocomplect']);
$asg = [];
$asj = [];
$asgp = [];
$i = 0;
while ($i < count($aso)) {
if ($aso[$i] > 0) {
$asg[$aso[$i]] = true;
}
$i++;
}
$i = 0;
$j = 0;
$noitm = 0;
$addi = 1;
while ($i < count($ast)) {
if ($ast[$i] > 0) {
if (!$asg[$ast[$i]]) {
$noitm++;
}
$itm = mysql_fetch_array(
mysql_query(
'SELECT `id`,`inSlot`,`price1` FROM `items_main` WHERE `id` = "' . mysql_real_escape_string(
$ast[$i]
) . '" LIMIT 1'
)
);
if (isset($itm['id'])) {
$itm2 = mysql_fetch_array(
mysql_query(
'SELECT `iid`,`price_1` FROM `items_shop` WHERE `item_id` = "' . mysql_real_escape_string(
$ast[$i]
) . '" AND `kolvo` > 0 LIMIT 1'
)
);
if ($itm2['price_1'] > $itm['price1']) {
$itm['price1'] = $itm2['price_1'];
}
if ($itm['inSlot'] == 3 || $itm['inSlot'] == 10) {
$asg[$itm['inSlot']][count($asg[$itm['inSlot']])] = $itm['id'];
$asgp[$itm['inSlot']][count($asgp[$itm['inSlot']])] = $itm['price1'];
} else {
$asg[$itm['inSlot']] = $itm['id'];
$asp[$itm['inSlot']] = $itm['price1'];
}
$j++;
}
}
$i++;
}
if ($noitm > 0) {
echo 'Использование багов карается законом!';
$addi = 0;
} elseif (count($asg[3]) > 2) {
echo 'Вы выбрали слишком много предметов, выберите только два оружия и один щит';
$addi = 0;
} elseif (count($asg[10]) > 3) {
echo 'Вы выбрали слишком много предметов, выберите только три кольца';
$addi = 0;
} elseif ($j > 16) {
echo 'Вы выбрали слишком много предметов';
$addi = 0;
} elseif ($j < 1) {
echo 'Выберите хотя бы один предмет';
$addi = 0;
}
if ($addi == 1) {
$i = 0;
while ($i <= 17) {
if ($i == 10) {
if ($asg[$i][0] > 0) {
$this->u->addItem($asg[$i][0], $this->u->info['id']);
$this->user['points'] += 1 + round($asgp[$i][0]);
}
if ($asg[$i][1] > 0) {
$this->u->addItem($asg[$i][1], $this->u->info['id']);
$this->user['points'] += 1 + round($asgp[$i][1]);
}
if ($asg[$i][2] > 0) {
$this->u->addItem($asg[$i][2], $this->u->info['id']);
$this->user['points'] += 1 + round($asgp[$i][2]);
}
} elseif ($i == 3) {
if ($asg[$i][0] > 0) {
$this->u->addItem($asg[$i][0], $this->u->info['id']);
$this->user['points'] += 1 + round($asgp[$i][0]);
}
if ($asg[$i][1] > 0) {
$this->u->addItem($asg[$i][1], $this->u->info['id']);
$this->user['points'] += 1 + round($asgp[$i][1]);
}
} elseif ($asg[$i] > 0) {
$this->u->addItem($asg[$i], $this->u->info['id']);
$this->user['points'] += 1 + round($asgp[$i]);
}
$i++;
}
mysql_query(
'UPDATE `users_turnirs` SET `points` = "' . $this->user['points'] . '",`items` = "0" WHERE `bot` = "' . $this->u->info['id'] . '" LIMIT 1'
);
mysql_query(
'UPDATE `stats` SET `ability` = "100",`skills` = "10" WHERE `id` = "' . $this->u->info['id'] . '" LIMIT 1'
);
mysql_query('UPDATE `users` SET `level` = "12" WHERE `id` = "' . $this->u->info['id'] . '" LIMIT 1');
mysql_query('UPDATE `turnirs` SET `step` = "0" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
$this->info['step'] = 0;
$this->info['items'] = '0';
}
}
if ($this->info['step'] == 3) {
$this->finishTurnir();
} elseif ($this->info['step'] == 0) {
//распределяем команды
$po = [0, 0];
$sp = mysql_query(
'SELECT * FROM `users_turnirs` WHERE `turnir` = "' . $this->info['id'] . '" AND `points` > 3 ORDER BY `points` DESC LIMIT ' . $this->info['users_in']
);
$tmr = rand(1, 2);
if ($tmr == 1) {
$tmr = [2, 1];
} else {
$tmr = [1, 2];
}
while ($pl = mysql_fetch_array($sp)) {
$inf = mysql_fetch_array(
mysql_query('SELECT * FROM `users` WHERE `id` = "' . $pl['uid'] . '" LIMIT 1')
);
$bot = mysql_fetch_array(
mysql_query('SELECT * FROM `users` WHERE `id` = "' . $pl['bot'] . '" LIMIT 1')
);
if (isset($inf['id'], $bot['id'])) {
if ($po[1] == $po[2]) {
$tm = rand(1, 2);
} elseif ($po[1] > $po[2]) {
$tm = 2;
} else {
$tm = 1;
}
//$tm = $tmr[$tm];
$bot['team'] = $tm;
$po[$bot['team']] += $pl['points'];
mysql_query(
'UPDATE `stats` SET `team` = "' . $bot['team'] . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'
);
mysql_query(
'UPDATE `users_turnirs` SET `team` = "' . $bot['team'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
);
}
}
mysql_query('UPDATE `turnirs` SET `step` = "1" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
}
$sp = mysql_query(
'SELECT * FROM `users_turnirs` WHERE `turnir` = "' . $this->info['id'] . '" LIMIT ' . $this->info['users_in']
);
$po = [0, 0];
while ($pl = mysql_fetch_array($sp)) {
$inf = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $pl['uid'] . '" LIMIT 1'));
$bot = mysql_fetch_array(
mysql_query(
'SELECT `u`.*,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `u`.`id` = `st`.`id` WHERE `u`.`id` = "' . $pl['bot'] . '" LIMIT 1'
)
);
if (isset($inf['id'], $bot['id'])) {
$po[$bot['team']] += $pl['points'];
//${'tm'.$bot['team']} .= '<b>'.$bot['login'].'</b> ['.$bot['level'].']<br>';
${'tm' . $bot['team']} .= $this->u->microLogin($bot, 2) . '<br>';
}
}
$r .= '<style>/* цвета команд */
.CSSteam0 { font-weight: bold; cursor:pointer; }
.CSSteam1 { font-weight: bold; color: #6666CC; cursor:pointer; }
.CSSteam2 { font-weight: bold; color: #B06A00; cursor:pointer; }
.CSSteam3 { font-weight: bold; color: #269088; cursor:pointer; }
.CSSteam4 { font-weight: bold; color: #A0AF20; cursor:pointer; }
.CSSteam5 { font-weight: bold; color: #0F79D3; cursor:pointer; }
.CSSteam6 { font-weight: bold; color: #D85E23; cursor:pointer; }
.CSSteam7 { font-weight: bold; color: #5C832F; cursor:pointer; }
.CSSteam8 { font-weight: bold; color: #842B61; cursor:pointer; }
.CSSteam9 { font-weight: bold; color: navy; cursor:pointer; }
.CSSvs { font-weight: bold; }</style>';
$r .= '<h3>&laquo;' . $this->name[$this->info['type']] . '&raquo;</h3><br>Начало турнира через ' . $this->u->timeOut(
$this->info['time'] - time()
) . '! ';
if (isset($_GET['hpregenNowTurnir']) && ($this->u->stats['hpNow'] < $this->u->stats['hpAll'] || $this->u->stats['mpNow'] < $this->u->stats['mpAll'])) {
mysql_query(
'UPDATE `stats` SET `hpNow` = "' . $this->u->stats['hpAll'] . '",`mpNow` = "' . $this->u->stats['mpAll'] . '" WHERE `id` = "' . $this->u->info['id'] . '" LIMIT 1'
);
}
if ($this->user['points'] < 3) {
//Еще не получили обмундирование
if ($this->user['points'] < 2) {
$r .= '<INPUT class=\'btn_grey\' onClick="selectItmSave()" TYPE=button name=tmp value="Получить обмундирование">';
} else {
$r .= ' <INPUT class=\'btn_grey\' onClick="location=\'main.php\';" TYPE=button name=tmp value="Я готов';
if ($this->u->info['sex'] == 1) {
$r .= 'а';
}
$r .= '!">';
}
} else {
$r .= '<small><b>Вы участвуете в турнире!</b></small>';
$r .= ' &nbsp; <INPUT class=\'btn_grey\' onClick="location.href=\'main.php?hpregenNowTurnir=1\'" TYPE=button name=tmp value="Восстановить HP и MP">';
}
$r .= '<div style="float:right"><INPUT onClick="location=\'main.php\';" TYPE=button name=tmp value="Обновить"></div>';
if ($this->user['points'] < 3 && $this->user['items'] != '0') {
$r .= '<div align="left" style="height:1px; width:100%; margin:10px 0 10px 0; border-top:1px solid #999999;"></div>';
if ($this->user['items'] == '') {
//Выдаем предметы для выбора
$ai = '';
$sp = mysql_query(
'SELECT `a`.*,`b`.* FROM `items_shop` AS `a` LEFT JOIN `items_main` AS `b` ON (`a`.`item_id` = `b`.`id`) WHERE `a`.`sid` = 1 AND
(`a`.`r` != 5 AND `a`.`r` != 9 AND `a`.`r` <= 18 AND `a`.`kolvo` > 0 AND `cantBuy` = 0 AND `a`.`level` < 9 AND `b`.`level` < 9) AND
`b`.`class` != 6'
);
while ($pl = mysql_fetch_array($sp)) {
if (!isset($noitm[$pl['item_id']])) {
$aso[$pl['inslot']][count($aso[$pl['inslot']])] = $pl;
}
}
$j = 1;
$com = [];
while ($j <= 5) {
$i = 0;
while ($i <= 17) {
if ($i == 3) {
//
$com[$i] = $aso[$i][rand(0, count($aso[$i]) - 1)];
} elseif ($i == 14) {
//правая рука
$com[$i] = $aso[$i][rand(0, count($aso[$i]) - 1)];
} else {
//обмундирование
$com[$i] = $aso[$i][rand(0, count($aso[$i]) - 1)];
if ($i == 10) {
$ai .= $com[$i]['id'] . ',';
$com[$i] = $aso[$i][rand(0, count($aso[$i]) - 1)];
$ai .= $com[$i]['id'] . ',';
}
}
if ($com[$i]['id'] > 0 && $i != 10) {
$ai .= $com[$i]['id'] . ',';
}
$i++;
}
$j++;
}
unset($com);
$ai .= '0';
$this->user['items'] = $ai;
mysql_query(
'UPDATE `users_turnirs` SET `items` = "' . $ai . '" WHERE `id` = "' . $this->user['id'] . '" LIMIT 1'
);
}
//Выводим предметы чтобы надеть их
$ai = explode(',', $this->user['items']);
$i = 0;
$ia = [];
while ($i < count($ai)) {
if ($ai[$i] > 0) {
$pli = mysql_fetch_array(
mysql_query(
'SELECT `id`,`inSlot`,`name`,`type`,`img`,`level` FROM `items_main` WHERE `id` = "' . $ai[$i] . '" LIMIT 1'
)
);
$ia[$pli['inSlot']][count($ia[$pli['inSlot']])] = $pli;
unset($pli);
}
$i++;
}
unset($ai);
$r .= '<b>Выберите предметы для турнира:</b><br>';
?>
<style>
.its0 {
margin: 2px;
cursor: pointer;
filter: DXImageTransform.Microsoft.BasicImage(grayscale=1);
-ms-filter: DXImageTransform.Microsoft.BasicImage(grayscale=1);
-webkit-filter: grayscale(100%);
}
.its1 {
background-color: #ee9898;
margin: 1px;
border: 1px solid #b16060;
}
</style>
<script>
var set = [];
set[3] = [0, 0, 0];
set[10] = [0, 0, 0, 0];
function selectItmAdd(x, y, id, s) {
if (s != 10 && s != 3) {
if (set[s] != undefined && set[s] != 0) {
$('#it_' + set[s][1] + '_' + set[s][2]).attr('class', 'its0');
set[s] = 0;
}
set[s] = [id, x, y];
$('#it_' + x + '_' + y).attr('class', 'its1');
} else if (s == 10) {
if (set[s][0] > 2) {
$('#it_' + set[s][1][1] + '_' + set[s][1][2]).attr('class', 'its0');
$('#it_' + set[s][2][1] + '_' + set[s][2][2]).attr('class', 'its0');
$('#it_' + set[s][3][1] + '_' + set[s][3][2]).attr('class', 'its0');
set[s] = [0, 0, 0, 0];
}
if (set[s][1] == 0) {
set[s][1] = [id, x, y];
} else if (set[s][2] == 0) {
set[s][2] = [id, x, y];
} else if (set[s][3] == 0) {
set[s][3] = [id, x, y];
}
set[s][0]++;
$('#it_' + x + '_' + y).attr('class', 'its1');
} else if (s == 3) {
if (set[s][0] > 1) {
$('#it_' + set[s][1][1] + '_' + set[s][1][2]).attr('class', 'its0');
$('#it_' + set[s][2][1] + '_' + set[s][2][2]).attr('class', 'its0');
set[s] = [0, 0, 0];
}
if (set[s][1] == 0) {
set[s][1] = [id, x, y];
} else if (set[s][2] == 0) {
set[s][2] = [id, x, y];
}
set[s][0]++;
$('#it_' + x + '_' + y).attr('class', 'its1');
}
}
function selectItmSave() {
var i = 0;
var r = '';
while (i <= 17) {
if (set[i] != undefined) {
if (i == 10) {
if (set[i][1][0] != undefined) {
r += set[i][1][0] + '-';
}
if (set[i][2][0] != undefined) {
r += set[i][2][0] + '-';
}
if (set[i][3][0] != undefined) {
r += set[i][3][0] + '-';
}
} else if (i == 3) {
if (set[i][1][0] != undefined) {
r += set[i][1][0] + '-';
}
if (set[i][2][0] != undefined) {
r += set[i][2][0] + '-';
}
} else {
if (set[i][0] != undefined) {
r += set[i][0] + '-';
}
}
}
i++;
}
location = "main.php?gocomplect=" + r;
}
</script>
<?php
$i = 0;
while ($i <= 17) {
if (count($ia[$i]) > 0) {
$j = 0;
while ($j < count($ia[$i])) {
$r .= '<img id="it_' . $i . '_' . $j . '" onclick="selectItmAdd(' . $i . ',' . $j . ',' . $ia[$i][$j]['id'] . ',' . $ia[$i][$j]['inSlot'] . ');" class="its0" title="' . $ia[$i][$j]['name'] . '" src="//img.new-combats.tech/i/items/' . $ia[$i][$j]['img'] . '">';
$j++;
}
$r .= '<br>';
}
$i++;
}
}
$r .= '<div align="left" style="height:1px; width:100%; margin:10px 0 10px 0; border-top:1px solid #999999;"></div>';
$r .= '<table style="border:1px solid #99cccc" width="700" bgcolor="#bbdddd" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td width="350" align="center" bgcolor="#99cccc"><b class="CSSteam1">Команда 1</b></td>
<td align="center" bgcolor="#99cccc"><b class="CSSteam2">Команда 2</b></td>
</tr>
<tr>
<td align="center" style="border-right:1px solid #99cccc">' . rtrim($tm1, ', ') . '</td>
<td align="center">' . rtrim($tm2, ', ') . '</td>
</tr>
</table>';
if (($this->info['time'] - time() < 0) && $this->info['step'] == 1) {
//начинаем турнир
$this->startTurnir();
}
echo $r;
}
}

View File

@ -1610,32 +1610,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
public function addItem($id, $uid, $md = null, $dn = null, $mxiznos = null, $nosudba = null, $plavka = null)
{
$rt = -1;
$i = mysql_fetch_array(
mysql_query(
'SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp` FROM `items_main` AS `im` WHERE `im`.`id` = "' . mysql_real_escape_string(
$id
) . '" LIMIT 1'
)
);
$i = Db::getRow('select * from items_main where id = ?', [$id]);
if (isset($i['id'])) {
$d = mysql_fetch_array(
mysql_query(
'SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "' . $i['id'] . '" LIMIT 1'
)
);
$d = Db::getRow('select id, items_id, data from items_main_data where items_id = ?', [$i['id']]);
//новая дата
$data = $d['data'];
if ($i['ts'] > 0) {
if ($nosudba == null) {
$ui = mysql_fetch_array(
mysql_query(
'SELECT `id`,`login` FROM `users` WHERE `id` = "' . mysql_real_escape_string(
$uid
) . '" LIMIT 1'
)
);
$data .= '|sudba=' . $ui['login'];
}
if ($i['ts'] > 0 && $nosudba == null) {
$ui = Db::getValue('select login from users where id = ?', [$uid]);
$data .= '|sudba=' . $ui;
}
if ($md != null) {
$data .= $md;
@ -1643,7 +1625,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$data = $this->impStats($data);
}
//предмет с настройками из подземелья
if ($dn != null && $dn['dn_delete'] > 0) {
$i['dn_delete'] = 1;
@ -1656,25 +1637,21 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
} else {
$room = $this->info['city'];
}
$ins = mysql_query(
'INSERT INTO `items_users` (`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`,`dn_delete`) VALUES (
"' . $i['overTypei'] . '",
"' . $i['id'] . '",
"' . $uid . '",
"' . $data . '",
"' . $i['iznosMAXi'] . '",
"' . $i['geni'] . '",
"' . $i['magic_inci'] . '",
"' . $room . '",
"' . time() . '",
"' . time() . '",
"' . $i['dn_delete'] . '")'
);
if ($ins) {
$rt = mysql_insert_id();
mysql_query(
'UPDATE `items_users` SET `dn_delete` = "1" WHERE `id` = "' . $rt . '" AND `data` LIKE "%dn_delete=%" LIMIT 1'
);
$args = [
$i['overTypei'],
$i['id'],
$uid,
$data,
$i['iznosMAXi'],
$i['geni'],
$i['magic_inci'],
$room,
$i['dn_delete'] ?? 0,
];
Db::sql('insert into items_users (overType, item_id, uid, data, iznosMAX, geniration, magic_inc, maidin, lastUPD, time_create, dn_delete) values (?,?,?,?,?,?,?,?,unix_timestamp(),unix_timestamp(),?)', $args);
$rt = Db::lastInsertId() ?? 0;
if ($rt !== 0) {
Db::sql('update items_users set dn_delete = 1 where id = ? and data like ?', [$rt, '%dn_delete=%']);
if ($uid == $this->info['id']) {
$this->stack($rt);
}
@ -1684,12 +1661,15 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
}
//Записываем в личное дело что предмет получен
$this->addDelo(
1, $uid,
'&quot;<font color=#C65F00>AddItems.' . $this->info['city'] . '</font>&quot;: Получен предмет &quot;<strong>' . $i['name'] . '</strong>&quot; (x1) [#' . $i['iid'] . ']. ' . $ads . '',
time(), $this->info['city'], 'AddItems.' . $this->info['city'] . '', 0, 0
1,
$uid,
'&quot;AddItems.' . $this->info['city'] . '&quot;: Получен предмет &quot;<strong>' . $i['name'] . '</strong>&quot; (x1) [#' . $i['iid'] . ']. ' . $ads . '',
time(),
$this->info['city'],
'AddItems.' . $this->info['city'] . '',
0,
0
);
} else {
$rt = 0;
}
}
return $rt;
@ -1725,7 +1705,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
return $bus['login_BIG'];
}
public function microLogin(int $id, int $t, int $nnz = 1): string
public function microLogin(int $id, int $t = 1, int $nnz = 1): string
{
if ($t !== 1) {
$inf['id'] = $id;
@ -2619,7 +2599,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
public function addNewbot($id, $botDate, $clon, $logins_bot = null, $luser = null, $round = null)
{
if ($clon != null) {
$r = false;
$r = 0;
if (!is_array($clon)) {
$clon = $this->getUserInfoById((int)$clon);
}
@ -4096,7 +4076,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
public function addDelo($type, $uid, $txt, $tm, $ct, $frm, $mo, $mi, $vvv = false)
{
return Db::sql(
'insert into users_delo (uid, dop, time, city, text, login, `delete`, ip, moneyOut, type) values (?,?,?,?,?,?,?,?,?,?)',
'insert into users_delo (uid, dop, time, city, text, login, `delete`, ip, moneyOut, type, no_right) values (?,?,?,?,?,?,?,?,?,?,?)',
[
$uid,
$vvv,
@ -4108,6 +4088,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
$_SERVER['HTTP_X_REAL_IP'],
$mo,
$type,
'',
]
);
}
@ -11906,4 +11887,22 @@ LIMIT 1'
Db::sql('update users set online = unix_timestamp() where id = ?', [$uid]);
}
public function isModerator(): bool
{
return $this->isAdmin() || $this->info['align'] > 3 && $this->info['align'] < 4;
}
public function isAdmin(): bool
{
return $this->info['admin'] > 0;
}
/** Игрок имеет меньше 30% хп.
* @return bool
*/
public function isWeakened(): bool
{
return $this->stats['hpNow'] < ceil($this->stats['hpMax'] / 100 * 30);
}
}

View File

@ -0,0 +1,25 @@
<?php
use Core\Db;
class UserEffects
{
/** Äàòü èãðîêó ýôôåêò.
* @param int $uid id èãðîêà
* @param int $id id ýôôåêòà
* @return void
*/
public static function addById(int $uid, int $id)
{
$eff = Db::getRow('select mname, mdata, oneType, id2 from eff_main where id2 = ?', [$id]);
if (!$eff['id2']) {
return;
}
Db::sql(
'insert into eff_users (overType, id_eff, uid, name, timeUse, data) values (?,?,?,?,unix_timestamp(),?)',
[$eff['oneType'], $eff['id2'], $uid, $eff['mname'], $eff['mdata']]
);
}
}

View File

@ -31,4 +31,31 @@ union all select data from eff_users where uid = ? and `delete` = 0';
}
return $params;
}
/** Данные для отрисовки логина и полосок жизни\маны.
* @param User $u
* @return object
*/
public static function getLoginHpManaBars(User $u): object
{
$hpNow = floor($u->stats['hpNow']);
$hpAll = $u->stats['hpAll'];
$mpNow = floor($u->stats['mpNow']);
$mpAll = $u->stats['mpAll'];
//floor(120 / 100 * ($hpNow / $hpAll * 100)); // ??????
$ph = ($hpAll > 0 && $hpNow > 0) ? floor(120 / $hpNow / $hpAll) : 0;
$pm = ($mpAll > 0 && $mpNow > 0) ? floor(120 / $mpNow / $mpAll) : 0;
return (object)[
'uid' => $u->info['id'],
'login' => $u->microLogin($u->info['id']),
'hpbarwidth' => $ph,
'mpbarwidth' => $pm,
'hpbartext' => ' ' . $hpNow . '/' . $hpAll,
'mpbartext' => ' ' . $mpNow . '/' . $mpAll,
'divstyle' => $pm === 0 ? ' margin-top:13px;' : '',
'hasmana' => $mpAll > 0,
];
}
}

View File

@ -20,7 +20,6 @@ function getIds($query): string
Db::sql('update users set clan_zv = 0 where clan_zv > 0');
// Очистка чата, остается 30 минут.
Db::sql('delete from chat where time < unix_timestamp() - 1800');
Db::sql('delete from chat_system where time < unix_timestamp() - 1800');
// Очистка заявок в поединки
Db::sql('delete from zayvki where start > 0 or cancel > 0 or time < unix_timestamp() - 43200');
// Очистка заявок в пещеры

View File

@ -44,18 +44,11 @@ if( isset($_GET['actions']) ) {
// forign_keys! Никто не знает про foreign_keys!
function delete_user_all( $uid , $login ) {
mysql_query('DELETE FROM `aaa_birthday` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `aaa_bonus` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `aaa_dialog_vars` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `aaa_znahar` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `add_smiles` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `an_data` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `a_com_act` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `a_noob` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `a_system` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `a_vaucher` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `a_vaucher_active` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `bandit` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `bank` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `bank_alh` WHERE `uid` = "'.$uid.'"');
@ -65,12 +58,10 @@ function delete_user_all( $uid , $login ) {
mysql_query('DELETE FROM `battle_last` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `battle_stat` WHERE `uid1` = "'.$uid.'" OR `uid2` = "'.$uid.'"');
mysql_query('DELETE FROM `battle_users` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `bid` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `bs_actions` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `bs_zv` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `building` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `buy_ekr` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `chat_ignore` WHERE `uid` = "'.$uid.'" OR `login` = "'.$login.'"');
mysql_query('DELETE FROM `complects_priem` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `dialog_act` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `dump` WHERE `uid` = "'.$uid.'"');

View File

@ -1,20 +0,0 @@
<?php
if(isset($_GET['test'])) {
echo 'Тест 5<br>'.$_GET['test'].'<br>'.$_POST['test_post'].'';
die();
}
echo 'Тест 1<br>';
?>
<script src="/js/jquery.js" type="text/javascript"></script>
<script>
function test() {
$('#test_side').html( 'Тест 3' );
$.post('/ajax.php?test=Тест 6&',{'test_post':'Тест7'},function(data){ $('#test_block').html( data ); });
}
</script>
Тест 2<br>
<div id="test_side"></div>
<div id="test_block"></div>
<br><br>
<a href="javascript:test();">Протестировать запрос</a>

View File

@ -1,95 +1,102 @@
<?php
define('GAME',true);
//Вызывается из ekr.php
define('GAME', true);
include_once('_incl_data/__config.php');
include_once('_incl_data/class/__db_connect.php');
if(isset($_GET['login'])) {
//
$_GET['login'] = htmlspecialchars($_GET['login'],NULL);
//
$bad = array(
'Мусорщик' => 1,
'Мироздатель' => 1
);
//
function en_ru($txt) {
$g = false;
$en = preg_match("/^(([0-9a-zA-Z _-])+)$/i", $txt);
$ru = preg_match("/^(([0-9а-яА-Я _-])+)$/i", $txt);
if(($ru && $en) || (!$ru && !$en)) {
$g = true;
}
return $g;
}
//
function testBad($txt) {
$white = '-_ 0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNMЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮёйцукенгшщзхъфывапролджэячсмитьбю';
$r = false;
$i = 0;
while( $i != -1 ) {
if( isset($txt[$i]) ) {
$g = false;
$j = 0;
while( $j != -1 ) {
if(isset($white[$j])) {
if( $white[$j] == $txt[$i] ) {
$g = true;
}
}else{
$j = -2;
}
$j++;
}
if( $g == false ) {
$r = true;
}
}else{
$i = -2;
}
$i++;
}
return $r;
}
//
$login = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "'.mysql_real_escape_string($_GET['login']).'" LIMIT 1'));
if( isset($login['id']) || isset($bad[$_GET['login']]) ) {
echo '<b style="color:red">Логин занят.</b>';
}else{
$true = true;
//
/*
Логин может содержать от 4 до 16 символов, и состоять только из букв русского ИЛИ английского алфавита, цифр, символов '_', '-' и пробела.
Логин не может начинаться или заканчиваться символами '_', '-' или пробелом.
*/
//
$_GET['login'] = str_replace(' ',' ',$_GET['login']);
$_GET['login'] = str_replace('%',' ',$_GET['login']);
$_GET['login'] = str_replace('&nbsp;',' ',$_GET['login']);
//
if( strlen($_GET['login']) > 16 ) {
$true = false;
}elseif( strlen($_GET['login']) < 4 ) {
$true = false;
}elseif( strripos($_GET['login'],' ') == true ) {
$true = false;
}elseif( substr($_GET['login'],1) == ' ' || substr($_GET['login'],-1) == ' ' ) {
$true = false;
}elseif( substr($_GET['login'],1) == '-' || substr($_GET['login'],-1) == '-' ) {
$true = false;
}elseif( substr($_GET['login'],1) == '_' || substr($_GET['login'],-1) == '_' ) {
$true = false;
}elseif( testBad($_GET['login']) == true ) {
$true = false;
}elseif( en_ru(str_replace('ё','е',str_replace('Ё','Е',$_GET['login']))) == true ) {
$true = false;
}
//
if( $true == false ) {
echo '<b style="color:red">Неверный логин.</b>';
}else{
echo '<b style="color:green">Логин свободен!</b>';
}
}
if (!isset($_GET['login'])) {
return;
}//
$_GET['login'] = htmlspecialchars($_GET['login'], null);
//
$bad = [
'Мусорщик' => 1,
'Мироздатель' => 1,
];
//
function en_ru($txt)
{
$g = false;
$en = preg_match("/^(([0-9a-zA-Z _-])+)$/i", $txt);
$ru = preg_match("/^(([0-9а-яА-Я _-])+)$/i", $txt);
if (($ru && $en) || (!$ru && !$en)) {
$g = true;
}
return $g;
}
?>
//
function testBad($txt): bool
{
$white = '-_ 0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNMЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮёйцукенгшщзхъфывапролджэячсмитьбю';
$r = false;
$i = 0;
while ($i != -1) {
if (isset($txt[$i])) {
$g = false;
$j = 0;
while ($j != -1) {
if (isset($white[$j])) {
if ($white[$j] == $txt[$i]) {
$g = true;
}
} else {
$j = -2;
}
$j++;
}
if ($g == false) {
$r = true;
}
} else {
$i = -2;
}
$i++;
}
return $r;
}
//
$login = mysql_fetch_array(
mysql_query(
'SELECT `id` FROM `users` WHERE `login` = "' . mysql_real_escape_string($_GET['login']) . '" LIMIT 1'
)
);
if (isset($login['id']) || isset($bad[$_GET['login']])) {
echo '<b style="color:red">Логин занят.</b>';
} else {
$true = true;
/*
Логин может содержать от 4 до 16 символов, и состоять только из букв русского ИЛИ английского алфавита, цифр, символов '_', '-' и пробела.
Логин не может начинаться или заканчиваться символами '_', '-' или пробелом.
*/
$_GET['login'] = str_replace(' ', ' ', $_GET['login']);
$_GET['login'] = str_replace('%', ' ', $_GET['login']);
$_GET['login'] = str_replace('&nbsp;', ' ', $_GET['login']);
//
if (strlen($_GET['login']) > 16) {
$true = false;
} elseif (strlen($_GET['login']) < 4) {
$true = false;
} elseif (strripos($_GET['login'], ' ')) {
$true = false;
} elseif (substr($_GET['login'], 1) == ' ' || substr($_GET['login'], -1) == ' ') {
$true = false;
} elseif (substr($_GET['login'], 1) == '-' || substr($_GET['login'], -1) == '-') {
$true = false;
} elseif (substr($_GET['login'], 1) == '_' || substr($_GET['login'], -1) == '_') {
$true = false;
} elseif (testBad($_GET['login'])) {
$true = false;
} elseif (en_ru(str_replace('ё', 'е', str_replace('Ё', 'Е', $_GET['login'])))) {
$true = false;
}
//
if (!$true) {
echo '<b style="color:red">Неверный логин.</b>';
} else {
echo '<b style="color:green">Логин свободен!</b>';
}
}

View File

@ -1,22 +1,3 @@
<?php
ini_set("display_errors","1");
ini_set("display_startup_errors","1");
ini_set('error_reporting', E_ALL);
ini_set("log_errors","1");
ini_set("error_log","php-errors.log");
//header("Content-Type: audio/mp3; codecs=opus;",true); //charset=us-ascii
//header("Accept-Ranges: bytes");
//charset=us-ascii
$ttime=time();
$body = file_get_contents('php://input');
$loc = "audio/audio_".$ttime.".mp3";
file_put_contents($loc, $body, FILE_APPEND);
//die ('{["'.$ttime.'"]}');
//die ($ttime);
echo $ttime;
//die (file_get_contents('php://input'));
//die ('{["'.file_get_contents('php://input').'"]}');
//$homepage = ('{["'.file_get_contents('./'.$loc).'"]}');
//echo $homepage;
?>
//Âûçûâàåòñÿ èç js/onlineList.js
file_put_contents('audio/audio_' . time() . '.mp3', file_get_contents('php://input'), FILE_APPEND);

View File

@ -32,8 +32,6 @@ $u = User::start();
$filter = new Filter();
$chat = new Chat();
var_dump($_SESSION['uid'], $_COOKIE['login']);
ini_set('max_execution_time', '120');
if (isset($_GET['showcode'])) {
@ -779,7 +777,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
</table>
<!-- -->
</div>
<table id="globalMain" style="width: 100%; height: 99%; border: 0;" cellspacing="0" cellpadding="0">
<table id="globalMain" style="width: 100%; height: 100%; border: 0;" cellspacing="0" cellpadding="0">
<tr id="headerTd">
<td style="width: 9px; background-color: #d6d6d6;"></td>
<td style="background-color: #d6d6d6;">&nbsp;</td>

View File

@ -41,18 +41,11 @@ if( isset($_GET['actions']) ) {
// forign_keys! Никто не знает про foreign_keys!
function delete_user_all( $uid , $login ) {
mysql_query('DELETE FROM `aaa_birthday` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `aaa_bonus` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `aaa_dialog_vars` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `aaa_znahar` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `add_smiles` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `an_data` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `a_com_act` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `a_noob` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `a_system` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `a_vaucher` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `a_vaucher_active` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `bandit` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `bank` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `bank_alh` WHERE `uid` = "'.$uid.'"');
@ -62,12 +55,10 @@ function delete_user_all( $uid , $login ) {
mysql_query('DELETE FROM `battle_last` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `battle_stat` WHERE `uid1` = "'.$uid.'" OR `uid2` = "'.$uid.'"');
mysql_query('DELETE FROM `battle_users` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `bid` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `bs_actions` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `bs_zv` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `building` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `buy_ekr` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `chat_ignore` WHERE `uid` = "'.$uid.'" OR `login` = "'.$login.'"');
mysql_query('DELETE FROM `complects_priem` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `dialog_act` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `dump` WHERE `uid` = "'.$uid.'"');

File diff suppressed because it is too large Load Diff

View File

@ -1,69 +0,0 @@
// if (document.documentElement.clientWidth >= 414 && document.documentElement.clientWidth <= 736 ) {
// console.log(document.documentElement.clientWidth)
// console.log(document.documentElement.clientHeight)
// // var $reline2 = document.getElementById("reline2")
// var $chatMobile = document.getElementsByClassName("allChat")
// var $arrayChatWindow = Array.from($chatMobile)
// var $onlineList = document.getElementById("online_list")
// var $online = document.getElementById("online")
// var $chatList = document.getElementById("chat_list")
// var $chat_menus = document.getElementById("chat_menus")
// // var $cb1 = document.getElementById("cb1")
// // var $cb2 = document.getElementById("cb2")
// var $globalMain = document.getElementById("globalMain")
// for (let key of $arrayChatWindow) {
// key.hidden = true
// }
// // $reline2.hidden = true
// // Кнопка показа чата
// var $buttonChat = document.createElement("button")
// $buttonChat.id = "buttonHiddenChat"
// $buttonChat.textContent = "Показать чат"
// // $buttonChat.style.width = "100%"
// // $buttonChat.style.fontSize = "17pt"
// // $buttonChat.style.position = "fixed"
// $buttonChat.style.top = `${document.documentElement.clientHeight - 33}px`
// document.body.append($buttonChat)
// document.body.addEventListener("click", function (event) {
// if (event.target == $buttonChat) {
// if ($buttonChat.textContent == "Показать чат") {
// $buttonChat.textContent = "Скрыть чат"
// // for (let key of $arrayChatWindow) {
// // key.hidden = false
// // }
// $arrayChatWindow[0].hidden = false
// $onlineList.hidden = true
// $online.hidden = true
// // $chat_menus.display = "none"
// // $chatList.style.width = "410px"
// // var $p = document.createElement("p")
// // $p.textContent = "Онлайн"
// // document.getElementById("chat_menus").prepend(`<button>Онлайн</button>`)
// return
// }
// $buttonChat.textContent = "Показать чат"
// $arrayChatWindow[0].hidden = true
// // for (let key of $arrayChatWindow) {
// // key.hidden = true
// // }
// }
// })
// }

48
ekr.php
View File

@ -1,24 +1,23 @@
<?php
define('GAME', true);
use Core\Database;
use Core\Db;
if (!defined('GAME_VERSION')) {
require_once '_incl_data/autoload.php';
}
//10:05 Внимание! Вы успешно пополнили свой игровой счїт на <b>0.13 ЕКР</b>. Приятной Вам игры!
require_once('_incl_data/__config.php');
require_once('_incl_data/class/__db_connect.php');
Database::init();
$u = User::start();
if (!isset($u->info['id'])) {
header('location: /');
die();
}
$ball = mysql_fetch_array(
mysql_query(
'SELECT SUM(`ekr`) FROM `pay_operation` WHERE `uid` = "' . $u->info['id'] . '" AND `good` > 0 LIMIT 1'
)
);
$ball = 0 + $ball[0];
$ball = Db::getValue('select sum(ekr) from pay_operation where uid = ? and good > 0', [$u->info['id']]);
$day1def = 50; //сколько екр. в день можно менять на кр.
$day2def = 1000 * ($u->info['level'] - 7); //сколько кр. в день можно менять на екр.
@ -31,19 +30,8 @@ if ($day2 < 0) {
}
$timetoday = strtotime(date('d.m.Y'));
//
$dc1 = mysql_fetch_array(
mysql_query(
'SELECT SUM(`money2`) FROM `user_operation` WHERE `time` >= "' . $timetoday . '" AND `uid` = "' . $u->info['id'] . '" AND `type` = "Обмен ЕКР на КР" LIMIT 1'
)
);
$dc2 = mysql_fetch_array(
mysql_query(
'SELECT SUM(`money`) FROM `user_operation` WHERE `time` >= "' . $timetoday . '" AND `uid` = "' . $u->info['id'] . '" AND `type` = "Обмен КР на ЕКР" LIMIT 1'
)
);
$dc1 = $dc1[0];
$dc2 = $dc2[0];
$dc1 = Db::getValue('select sum(money2) from user_operation where time >= unix_timestamp() and uid = ? and type = ?', [$u->info['id'], 'Обмен ЕКР на КР']);
$dc2 = Db::getValue('select sum(money) from user_operation where time >= unix_timestamp() and uid = ? and type = ?', [$u->info['id'], 'Обмен КР на ЕКР']);
$day1 = round($day1 + $dc1, 2);
$day2 = round($day2 + $dc2, 2);
@ -58,7 +46,8 @@ if ($day2 < 0) {
$b1 = 0; //бонус накопительный
$bt = mysql_fetch_array(mysql_query('SELECT * FROM `bank_table` ORDER BY `time` DESC LIMIT 1'));
$bt = Db::getRow('select cur, USD from bank_table order by time desc limit 1');
$bns = [
[0, 0, 0],
@ -759,7 +748,7 @@ if (isset($_POST['do']) && $_POST['do'] == 'newShadow') {
</fieldset>
<fieldset
style="width:480px; border: 1px solid white; margin-top:15px; padding: 10px;">
style="width:480px; border: 1px solid white; margin-top:15px; padding: 10px;">
<legend style='font-weight:bold; color:#8F0000;'>Покупка ЕКР</legend>
<form method="post" id="ekrform" action="ekr.php?buy_ekr=1"
@ -878,8 +867,8 @@ if (isset($_POST['do']) && $_POST['do'] == 'newShadow') {
<form method="post" action="ekr.php"
onsubmit="if(document.getElementById('ekr2').value><?= $day1 ?>) {alert('Сегодня вы можете еще обменять не более <?= $day1 ?> ЕКР');return false;} else if(document.getElementById('ekr2').value<0.01||document.getElementById('ekr2').value><?= $day1 ?>) {alert('За 1 раз Вы можете обменять сумму от 0.01 до <?= $day1 ?> ЕКР.');return false;} else {return confirm('Вы действительно хотите обменять '+document.getElementById('ekr2').value+' ЕКР на '+(document.getElementById('ekr2').value*<?= $c['ecrtocr'] * 2.5 ?>)+' КР ? В обратном направлении обмен с КР на ЕКР будет невозможен.');};">
Обменять ЕКР на КР по курсу <b>1ЕКР=<?= $c['ecrtocr'] * 2.5 ?>КР</b>: &nbsp; <input
type="text" name="ekr2" id="ekr2" value="" size="5" placeholder="<?= $day1 ?> max"
onchange="calc22();" onkeyup="if(event.keyCode<35||event.keyCode>40) calc22();">
type="text" name="ekr2" id="ekr2" value="" size="5" placeholder="<?= $day1 ?> max"
onchange="calc22();" onkeyup="if(event.keyCode<35||event.keyCode>40) calc22();">
&nbsp; <input type="submit" class="btn btn-success" name="submit" id="calc2"
value="Обменять"><br/>
</form>
@ -1096,7 +1085,8 @@ if (isset($_POST['do']) && $_POST['do'] == 'newShadow') {
</option>
</select>
</div>
<div style="width:240px; margin-left:-6px;background:#cbc4aa;padding:5px 0px 5px 0px;border:1px solid #cbc4aa;background-color:#eee;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;outline:none;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;">
<div
style="width:240px; margin-left:-6px;background:#cbc4aa;padding:5px 0px 5px 0px;border:1px solid #cbc4aa;background-color:#eee;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;outline:none;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;">
<input type="button" class="btn btn-success" value="Подтвердить"
style="height: 28px; line-height: 20px; width: 100px;font-size:13px;"
onclick="if(confirm('Действительно хотите купить это изображение?')) $('#fform').submit();"/>
@ -1235,7 +1225,7 @@ if (isset($_POST['do']) && $_POST['do'] == 'newShadow') {
<input type="text" name="login" id="llogin" onkeyup="check_login();" size=35
placeholder="Введите новое имя.." style="margin: 5px 0 5px 0;"/>
<span
id="ajaxLogin"></span><br>
id="ajaxLogin"></span><br>
<input type="button" class="btn btn-success" value="Сменить имя"
onclick="if(confirm('Действительно хотите сменить имя?')) $('#lform').submit();"/>
</form>

View File

@ -32,13 +32,6 @@ if (isset($_GET['list']) && $_GET['list'] == 2015) {
$mail[] = $pl['mail'];
}
}
$sp = mysql_query('SELECT * FROM `beta_testers`');
while ($pl = mysql_fetch_array($sp)) {
if (!isset($yes[$pl['mail']])) {
$yes[$pl['mail']] = true;
$mail[] = $pl['mail'];
}
}
$sp = mysql_query('SELECT * FROM `users_rbk`');
while ($pl = mysql_fetch_array($sp)) {
if (!isset($yes[$pl['email']])) {

184
main.php
View File

@ -23,6 +23,15 @@
background: url(default.gif) center no-repeat #e2e0e1;
}
pre {
border: 1px solid gray;
border-radius: 5px;
padding: 3px 6px;
background: #cecece;
color: black;
font-family: Arial, sans-serif;
font-size: 12px;
}
</style>
<link href="//img.new-combats.tech/css/main.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/css/training/modal.css">
@ -40,7 +49,7 @@ use DarksLight2\Training\TrainingManager;
function var_info($vars, $d = false)
{
echo "<pre style='border: 1px solid gray;border-radius: 5px;padding: 3px 6px;background: #cecece;color: black;font-family: Arial;font-size: 12px;'>\n";
echo "<pre>\n";
var_dump($vars);
echo "</pre>\n";
if ($d) {
@ -48,7 +57,6 @@ function var_info($vars, $d = false)
}
}
Config::init();
Database::init();
define('IP', UserIp::get());
@ -56,6 +64,7 @@ $magic = new Magic();
$u = User::start();
$filter = new Filter();
$q = new Quests;
$code = PassGen::intCode(); //для ссылок вида ?rnd=XXXXXX, вроде как-то борется с кешированием, но это не точно.
$training_manager = TrainingManager::getInstance($u->info['id']);
@ -79,7 +88,7 @@ if ($u->info['bithday'] == '01.01.1800' && $u->info['inTurnirnew'] == 0) {
#--------для общаги, и позже для почты
$sleep = $u->testAction('`vars` = "sleep" AND `uid` = "' . $u->info['id'] . '" LIMIT 1', 1);
if ($u->room['file'] != "room_hostel" && $u->room['file'] != "an/room_hostel" && $sleep['id'] > 0) {
mysql_query('UPDATE `actions` SET `vars` = "unsleep" WHERE `id` = "' . $sleep['id'] . '" LIMIT 1');
Db::sql('update actions set vars = ? where id = ?', ['unsleep', $sleep['id']]);
}
if ($u->room['file'] == "room_hostel" || $u->room['file'] == "post") {
$trololo = 0;
@ -88,16 +97,16 @@ if ($u->room['file'] == "room_hostel" || $u->room['file'] == "post") {
}
#--------для общаги, и позже для почты
if ($u->info['online'] < time() - 60 || $u->info['afk'] != '') {
if (($u->info['online'] < time() - 60 || $u->info['afk'] != '')) {
$filter->setOnline($u->info['8'], $u->info['id']);
mysql_query(
"UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time(
) . "',`afk`='' WHERE `id`='" . $u->info['id'] . "' LIMIT 1"
Db::sql(
'update users set online = unix_timestamp(), timeMain = unix_timestamp(), afk = ? where id = ?',
['', $u->info['id']]
);
} elseif ($u->info['timeMain'] < time() - 60 || $u->info['afk'] != '') {
mysql_query(
"UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time(
) . "',`afk`='' WHERE `id`='" . $u->info['id'] . "' LIMIT 1"
Db::sql(
'update users set online = unix_timestamp(), timeMain = unix_timestamp(), afk = ? where id = ?',
['', $u->info['id']]
);
}
@ -107,15 +116,23 @@ if (!isset($u->info['id']) || ($u->info['joinIP'] == 1 && $u->info['ip'] != $_SE
//Показываем системку и заносим данные
if ($u->info['battle_text'] != '' && $u->info['last_b'] > 0) {
mysql_query(
'INSERT INTO `battle_last` (`battle_id`,`uid`,`time`,`act`,`level`,`align`,`clan`,`exp`) VALUES ("' . $u->info['last_b'] . '","' . $u->info['id'] . '","' . time(
) . '","' . $u->info['last_a'] . '","' . $u->info['level'] . '","' . $u->info['align'] . '","' . $u->info['clan'] . '","' . $u->info['exp'] . '")'
Db::sql(
'insert into battle_last (battle_id, uid, time, act, lvl, align, clan, exp) values (?,?,unix_timestamp(),?,?,?,?,?)',
[
$u->info['last_b'],
$u->info['id'],
$u->info['last_a'],
$u->info['level'],
$u->info['align'],
$u->info['clan'],
$u->info['exp'],
]
);
}
if (!isset($_GET['mAjax']) && !isset($_GET['ajaxHostel'])) {
echo '<!DOCTYPE html>
<div style="padding-top:0; margin-top:7px; height:100%; background-color:#e2e0e1;">';
<div style="padding-top:0; margin-top:17px; /*height:100%;*/ background-color:#e2e0e1;">';
}
$act = -2;
$act2 = 0;
@ -134,49 +151,41 @@ $ul = $u->testLevel();
if (isset($_GET['atak_user']) && $u->info['battle'] == 0 && $_GET['atak_user'] != $u->info['id']) {
if ($u->room['noatack'] == 0) {
$ua = mysql_fetch_array(
mysql_query(
'SELECT `id`,`clan` FROM `users` WHERE`id` = "' . mysql_real_escape_string(
$_GET['atak_user']
) . '" LIMIT 1'
)
$clan = Db::getValue('select clan from users where id = ?', [(int)$_GET['atak_user']]);
$cruw = Db::getRow(
'select id, type from clan_wars where ((clan1 = ? and clan2 = ?) or (clan1 = ? and clan2 = ?)) and time_finish > unix_timestamp() limit 1',
[
$clan,
$u->info['clan'],
$u->info['clan'],
$clan,
]
);
$cruw = mysql_fetch_array(
mysql_query(
'SELECT `id`,`type` FROM `clan_wars` WHERE
((`clan1` = "' . $ua['clan'] . '" AND `clan2` = "' . $u->info['clan'] . '") OR (`clan2` = "' . $ua['clan'] . '" AND `clan1` = "' . $u->info['clan'] . '")) AND
`time_finish` > ' . time() . ' LIMIT 1'
)
);
unset($ua);
unset($clan);
if (isset($cruw['id'])) {
$cruw = $cruw['type'];
} else {
$cruw = 0;
}
$ua = mysql_fetch_array(
mysql_query(
'SELECT `s`.*,`u`.* FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `s`.`id` = `u`.`id` WHERE (`s`.`atack` > "' . time(
) . '" OR `s`.`atack` = 1 OR 1 = ' . $cruw . ' OR 2 = ' . $cruw . ') AND `s`.`id` = "' . mysql_real_escape_string(
$_GET['atak_user']
) . '" LIMIT 1'
)
$ua = Db::getRow(
'select * from users left join stats on users.id = stats.id where (atack > unix_timestamp() or atack = 1 or 1 = ? or 2 = ?) and stats.id = ?',
[
$cruw,
$cruw,
(int)$_GET['atak_user'],
]
);
$check = mysql_fetch_array(
mysql_query(
'SELECT * FROM `eff_users` WHERE `id_eff` = 478 AND `uid` = "' . $u->info['id'] . '" AND `delete` = 0 ORDER BY `overType` DESC LIMIT 1;'
)
$check = Db::getValue(
'select id from eff_users where id_eff = 478 and uid = ? and `delete` = 0 order by overType desc limit 1',
[$u->info['id']]
);
$check2 = mysql_fetch_array(
mysql_query(
'SELECT * FROM `eff_users` WHERE `id_eff` = 479 AND `uid` = "' . $ua['id'] . '" AND `delete` = 0 ORDER BY `overType` DESC LIMIT 1;'
)
$check2 = Db::getValue(
'select id from eff_users where id_eff = 479 and uid = ? and `delete` = 0 order by overType desc limit 1',
[$ua['id']]
);
$test = mysql_fetch_array(
mysql_query(
'SELECT `id` FROM `battle_last` WHERE `uid` = "' . $u->info['id'] . '" AND `battle_id` = "' . $ua['battle'] . '" LIMIT 1'
)
$check3 = Db::getValue(
'select id from battle_last where uid = ? and battle_id = ? limit 1', [$u->info['id'], $ua['battle']]
);
if ($ua['no_ip'] == 'trupojor' && $ua['level'] == 9 && $u->info['level'] > 9) {
$u->error = 'Нельзя нападать на монстра этого уровня!';
@ -184,21 +193,19 @@ if (isset($_GET['atak_user']) && $u->info['battle'] == 0 && $_GET['atak_user'] !
$u->error = 'Нельзя нападать на монстра этого уровня!';
} elseif ($ua['no_ip'] != 'trupojor' && $ua['level'] != $u->info['level']) {
$u->error = 'Нападать можно на персонажей только своего уровня!';
} elseif (isset($test['id'])) {
} elseif (isset($check3)) {
$u->error = 'Нельзя вмешаться, вы уже были в этом поединке.';
} elseif ($ua['no_ip'] == 'trupojor' && isset($check['id'])) {
} elseif ($ua['no_ip'] == 'trupojor' && isset($check)) {
$u->error = 'Нельзя нападать на монстра чаще одного раза в 3 часа!';
} elseif (isset($check2['id'])) {
} elseif (isset($check2)) {
$u->error = 'Персонаж имеет защиту от нападения!';
} elseif (isset($ua['id']) && $ua['online'] > time() - 520) {
$usta = $u->getStats($ua['id'], 0); // статы цели
$minHp = floor($usta['hpAll'] / 100 * 33); // минимальный запас здоровья цели при котором можно напасть
if ($ua['battle'] > 0) {
$uabt = mysql_fetch_array(
mysql_query(
'SELECT * FROM `battle` WHERE `id` = "' . $ua['battle'] . '" AND `team_win` = "-1" LIMIT 1'
)
$uabt = Db::getRow(
'select id, type, invis from battle where id = ? and team_win = -1 limit 1', [$ua['battle']]
);
if (!isset($uabt['id'])) {
$ua['battle'] = 0;
@ -227,14 +234,20 @@ if (isset($_GET['atak_user']) && $u->info['battle'] == 0 && $_GET['atak_user'] !
$ua['type_pers'] = 500;
}
mysql_query(
'UPDATE `stats` SET `hpNow` = "' . $usta['hpNow'] . '",`mpNow` = "' . $usta['mpNow'] . '" WHERE `id` = "' . $usta['id'] . '" LIMIT 1'
Db::sql(
'update stats set hpNow = ?, mpNow = ? where id = ?', [
$usta['hpNow'],
$usta['mpNow'],
$usta['id'],
]
);
$goodt = $magic->atackUser(
$u->info['id'], $ua['id'], $ua['team'], $ua['battle'], $ua['bbexp'], $ua['type_pers']
);
$sx = $u->info['sex'] ? 'a' : '';
if ($cruw == 2) {
$rtxt = '[img[items/pal_button9.gif]] &quot;' . $u->info['login'] . '&quot; совершил' . $sx . ' кровавое нападение по метке на персонажа &quot;' . $ua['login'] . '&quot;.';
} else {
@ -276,10 +289,8 @@ if ($ul == 1) {
/*-----------------------*/
if ($u->info['battle'] == 0) {
$btl_last = mysql_fetch_array(
mysql_query(
'SELECT `id`,`battle` FROM `battle_users` WHERE `uid` = "' . $u->info['id'] . '" AND `finish` = "0" LIMIT 1'
)
$btl_last = Db::getRow(
'select id, battle from battle_users where uid = ? and finish = 0 limit 1', [$u->info['id']]
);
}
if (isset($btl_last['id']) && $u->info['battle'] == 0) {
@ -377,12 +388,23 @@ if (isset($_GET['security']) && !isset($u->tfer['id']) && $trololo == 1) {
require_once('modules_data/_mod.php');
} elseif (isset($_GET['vip']) && !isset($u->tfer['id'])) {
require_once('modules_data/vip.php');
} elseif ((isset($_GET['zayvka']) && $u->info['battle'] == 0) || (isset($_GET['zayvka']) && ($_GET['r'] == 6 || $_GET['r'] == 7 || !isset($_GET['r'])) && $u->info['battle'] > 0) && !isset($u->tfer['id'])) {
if ($u->room['zvsee'] == 1) {
require_once('modules_data/_zv2.php');
} else {
require_once('modules_data/_zv.php');
}
} elseif (
(
isset($_GET['zayvka']) &&
$u->info['battle'] == 0
) ||
(
isset($_GET['zayvka']) &&
(
$_GET['r'] == 6 ||
$_GET['r'] == 7 ||
!isset($_GET['r'])
) &&
$u->info['battle'] > 0
) &&
!isset($u->tfer['id'])
) {
require_once('modules_data/_zv.php');
} elseif (isset($_GET['alh']) && !isset($u->tfer['id'])) {
require_once('modules_data/_alh.php');
} elseif ($u->info['clan'] > 0 && isset($_GET['clan']) && !isset($u->tfer['id'])) {
@ -411,8 +433,8 @@ if (isset($_GET['security']) && !isset($u->tfer['id']) && $trololo == 1) {
} else {
if (isset($_GET['talk']) && !isset($u->tfer['id'])) {
echo "
<script language='JavaScript'>
var elem = document.getElementById('se-pre-con');
<script>
let elem = document.getElementById('se-pre-con');
elem.parentNode.removeChild(elem);
</script>
";
@ -470,7 +492,8 @@ $sp = Db::getRows(
[$u->info['room'], $u->info['login']]
);
foreach ($sp as $pl) {
$itmo = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = ' . $pl['item_id']));
$itmo = Db::getRow('select id, name, img from items_main where id = ?', [$pl['item_id']]);
if (isset($itmo['id'])) {
$tk = 1;
$glid = 0;
@ -494,18 +517,16 @@ foreach ($sp as $pl) {
if ($pl['time'] + 86400 < time()) {
//Не успели поднять
$glid = 1;
mysql_query(
'UPDATE `items_local` SET `delete` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
);
Db::sql('update items_local set `delete` = unix_timestamp() where id = ?', [$pl['id']]);
} elseif (isset($_GET['take_loc_item']) && $_GET['take_loc_item'] == $pl['id']) {
//
if ($u->info['battle'] > 0 && $tk == 1) {
$iloce = 'Вы не можете поднять предмет, завершите поединок...';
} elseif ($tk == 1) {
$iloce = 'Вы успешно подняли предмет &quot;' . $itmo['name'] . '&quot; в локации &quot;' . $u->room['name'] . '&quot;.';
mysql_query(
'UPDATE `items_local` SET `delete` = "' . time(
) . '" , `user_take` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
Db::sql(
'update items_local set `delete` = unix_timestamp(), user_take = ? where id = ?',
[$u->info['id'], $pl['id']]
);
//выдаем предмет
$glid = 1;
@ -545,7 +566,7 @@ foreach ($sp as $pl) {
if ($iloc != '') {
if ($iloce != '') {
$iloc = '<div style="padding:10px;"><font color=red>' . $iloce . '</font></div>' . $iloc;
$iloc = '<div style="padding:10px; color: red;">' . $iloce . '</div>' . $iloc;
}
$iloc = '<style>' . '.tolobf0 { display:inline-block; width:80px; height:80px; background-color:#e5e5e5; text-align:center; }.tolobf0:hover { background-color:#d5d5d5; text-align:center; }.tolobf2 { display:inline-block; width:80px; height:80px; background-color:#FFD700; text-align:center; }.tolobf2:hover { background-color:#DAA520; text-align:center; }.tolobf1 { display:inline-block; width:80px; height:80px; background-color:#d5d5e5; text-align:center; }.tolobf1:hover { background-color:#d5d5d5; text-align:center; }.outer { display: table; position: absolute; height: 80px; width: 80px;}.middle { display: table-cell; vertical-align: middle;}.inner { margin-left: auto; margin-right: auto; width: 80px; }' . '</style>' . '<h3>В комнате разбросаны предметы</h3>' . $iloc;
$tjs .= 'top.frames[\'main\'].locitems=1;parent.$(\'#canal1\').html( \'' . $iloc . '\' );';
@ -555,16 +576,13 @@ if ($iloc != '') {
unset($iloc, $iloce);
/*-----------------------*/
$spl = mysql_fetch_array(
mysql_query(
'SELECT `exp` FROM `levels` WHERE `nextLevel` = "' . ($u->info['level'] + 1) . '" ORDER BY `exp` ASC LIMIT 1'
)
);
$spl = $spl['exp'];
$spl = Db::getValue('select exp from levels where nextLevel = ? order by exp limit 1', [$u->info['level'] + 1]);
echo '<script>top.myexpLineTop27(' . $u->info['exp'] . ',' . $spl . ');' . $tjs . 'top.ctest("' . $u->info['city'] . '");top.sd4key="' . $u->info['nextAct'] . '"; var battle = ' . (0 + $u->info['battle']) . '; top.hic();</script></body>
</html>';
$training_manager->render();
//Сломаное обучение. Как оно достало! Ins. 🤬
//$training_manager->render();
?>
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.2/modernizr.js"></script>-->
<script>

View File

@ -1,278 +0,0 @@
<?php
if (!defined('GAME')) {
die();
}
class turnir
{
public $info, $user, $name = [
0 => 'Выжить любой ценой',
1 => 'Каждый сам за себя',
2 => 'Захват ключа',
];
public function start()
{
global $c, $u;
$this->info = mysql_fetch_array(
mysql_query('SELECT * FROM `turnirs` WHERE `id` = "' . $u->info['inTurnir'] . '" LIMIT 1')
);
$this->user = mysql_fetch_array(
mysql_query(
'SELECT * FROM `users_turnirs` WHERE `turnir` = "' . $u->info['inTurnir'] . '" AND `bot` = "' . $u->info['id'] . '" LIMIT 1'
)
);
}
public function startTurnir()
{
global $c, $u;
$row = mysql_fetch_array(
mysql_query('SELECT COUNT(*) FROM `users` WHERE `win` = "0" AND `lose` = "0" AND `nich` = "0"')
);
if ($row[0] > 0 && $this->info['status'] != 3) {
//Создание поединка
mysql_query(
'INSERT INTO `battle` (`city`,`time_start`,`timeout`,`type`,`turnir`) VALUES ("' . $u->info['city'] . '","' . time(
) . '","60","1","' . $this->info['id'] . '")'
);
$uri = mysql_insert_id();
//Закидываем персонажей в поединок
mysql_query(
'UPDATE `users` SET `battle` = "' . $uri . '" WHERE `inUser` = "0" AND `inTurnir` = "' . $this->info['id'] . '"'
);
//Обозначаем завершение турнира при выходе
mysql_query('UPDATE `turnirs` SET `status` = "3" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
die('Перейтиде в раздел "поединки"...');
} else {
if ($this->info['status'] == 3) {
$this->finishTurnir();
}
}
}
public function finishTurnir()
{
global $c, $u;
$this->info = mysql_fetch_array(
mysql_query('SELECT * FROM `turnirs` WHERE `id` = "' . $u->info['inTurnir'] . '" LIMIT 1')
);
//mysql_query('UPDATE `users` SET `inUser` = 0, `inTurnir` = 0 WHERE `inTurnir` = '.$this->info['id'].' AND `inUser` > 0 LIMIT '.$this->info['users_in']);
if ($this->info['status'] == 3) {
$win = '';
$sp = mysql_query(
'SELECT * FROM `users_turnirs` WHERE `turnir` = "' . $this->info['id'] . '" ORDER BY `points` DESC LIMIT ' . $this->info['users_in']
);
while ($pl = mysql_fetch_array($sp)) {
$inf = mysql_fetch_array(
mysql_query('SELECT * FROM `users` WHERE `id` = "' . $pl['uid'] . '" LIMIT 1')
);
$bot = mysql_fetch_array(
mysql_query('SELECT * FROM `users` WHERE `id` = "' . $pl['bot'] . '" LIMIT 1')
);
if (isset($inf['id'], $bot['id'])) {
//выдаем призы и т.д
mysql_query('DELETE FROM `users` WHERE `id` = "' . $bot['id'] . '" LIMIT 1');
mysql_query('DELETE FROM `stats` WHERE `id` = "' . $bot['id'] . '" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $bot['id'] . '" LIMIT 1000');
mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $bot['id'] . '" LIMIT 1000');
}
if ($bot['win'] > 0 && $bot['lose'] < 1) {
$win .= '<b>' . $inf['login'] . '</b>, ';
}
}
mysql_query(
'UPDATE `users` SET `inUser` = "0",`inTurnir` = "0" WHERE `inTurnir` = "' . $this->info['id'] . '" LIMIT ' . $this->info['users_in']
);
mysql_query(
'UPDATE `turnirs` SET `users_in` = 0,`status` = 0,`winner` = -1,`step` = 0,`time` = "' . (time(
) + $this->info['time2']) . '",`count` = `count` + 1 WHERE `id` = ' . $this->info['id'] . ' LIMIT 1'
);
if ($win != '') {
$win = rtrim($win, ', ');
$win = 'Победители турнира: ' . $win . '. Следующий турнир начнется через ' . $u->timeOut(
$this->info['time2']
) . ' (' . date('d.m.Y H:i', (time() + $this->info['time2'])) . ').';
} else {
$win = 'Победители турнира отсутствует. Следующий турнир начнется через ' . $u->timeOut(
$this->info['time2']
) . ' (' . date('d.m.Y H:i', (time() + $this->info['time2'])) . ').';
}
$r = '<b>Турнир &laquo;' . $this->name[$this->info['type']] . ' [' . $this->info['level'] . '] №' . $this->info['count'] . '&raquo; завершился!</b> ' . $win;
mysql_query(
'DELETE FROM `users_turnirs` WHERE `turnir` = "' . $this->info['id'] . '" LIMIT ' . $this->info['users_in']
);
$cmsg = new ChatMessage();
$cmsg->setType(6);
$cmsg->setText($r);
(new Chat())->sendMsg($cmsg);
}
}
public function locationSee()
{
global $c, $u;
$r = '';
$tm1 = '';
$tm2 = '';
if ($this->info['step'] != 3 && $this->info['step'] != 0) {
//получение комплекта
if (isset($_GET['gocomplect']) && $this->user['points'] < 2) {
$aso = [];
$noitm = [
869 => 1,
];
$sp = mysql_query(
'SELECT `id`,`price1`,`inslot`,`price2` FROM `items_main` WHERE `inslot` > 0 AND `inslot` <= 26 AND `inslot` != 25 AND `inslot` != 24 AND `inslot` != 23 AND `inslot` != 16 AND `inslot` != 17 AND `inslot` != 2 AND `price2` = 0'
);
while ($pl = mysql_fetch_array($sp)) {
if (!isset($noitm[$pl['id']])) {
$aso[$pl['inslot']][count($aso[$pl['inslot']])] = $pl;
}
}
$i = 0;
$com = [];
while ($i <= 17) {
if ($i == 16) {
//левая рука
} elseif ($i == 17) {
//правая рука
} else {
//обмундирование
$com[$i] = $aso[$i][rand(0, count($aso[$i]))];
}
if ($com[$i]['id'] > 0) {
$u->addItem($com[$i]['id'], $u->info['id']);
$this->user['points'] += $com[$i]['price1'];
}
echo ',' . $com[$i];
$i++;
}
mysql_query(
'UPDATE `users_turnirs` SET `points` = "' . $this->user['points'] . '" WHERE `bot` = "' . $u->info['id'] . '" LIMIT 1'
);
$this->info['step'] == 0;
}
}
if ($this->info['step'] == 3) {
$this->finishTurnir();
} elseif ($this->info['step'] == 0) {
//распределяем команды
$po = [0, 0];
$sp = mysql_query(
'SELECT * FROM `users_turnirs` WHERE `turnir` = "' . $this->info['id'] . '" ORDER BY `points` DESC LIMIT ' . $this->info['users_in']
);
$tmr = rand(1, 2);
if ($tmr == 1) {
$tmr = [2, 1];
} else {
$tmr = [1, 2];
}
while ($pl = mysql_fetch_array($sp)) {
$inf = mysql_fetch_array(
mysql_query('SELECT * FROM `users` WHERE `id` = "' . $pl['uid'] . '" LIMIT 1')
);
$bot = mysql_fetch_array(
mysql_query('SELECT * FROM `users` WHERE `id` = "' . $pl['bot'] . '" LIMIT 1')
);
if (isset($inf['id'], $bot['id'])) {
if ($po[1] == $po[2]) {
$tm = rand(1, 2);
} elseif ($po[1] > $po[2]) {
$tm = 2;
} else {
$tm = 1;
}
//$tm = $tmr[$tm];
$bot['team'] = $tm;
$po[$bot['team']] += $pl['points'];
mysql_query(
'UPDATE `stats` SET `team` = "' . $bot['team'] . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1'
);
mysql_query(
'UPDATE `users_turnirs` SET `team` = "' . $bot['team'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
);
}
}
mysql_query(
'UPDATE `turnirs` SET `step` = "1",`time` = "' . (time(
) + $this->info['time3']) . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'
);
}
$sp = mysql_query(
'SELECT * FROM `users_turnirs` WHERE `turnir` = "' . $this->info['id'] . '" LIMIT ' . $this->info['users_in']
);
$po = [0, 0];
while ($pl = mysql_fetch_array($sp)) {
$inf = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $pl['uid'] . '" LIMIT 1'));
$bot = mysql_fetch_array(
mysql_query(
'SELECT `u`.*,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `u`.`id` = `st`.`id` WHERE `u`.`id` = "' . $pl['bot'] . '" LIMIT 1'
)
);
if (isset($inf['id'], $bot['id'])) {
$po[$bot['team']] += $pl['points'];
${'tm' . $bot['team']} .= '<b>' . $bot['login'] . '</b> [' . $bot['level'] . '], ';
}
}
$r .= '<style>/* цвета команд */
.CSSteam0 { font-weight: bold; cursor:pointer; }
.CSSteam1 { font-weight: bold; color: #6666CC; cursor:pointer; }
.CSSteam2 { font-weight: bold; color: #B06A00; cursor:pointer; }
.CSSteam3 { font-weight: bold; color: #269088; cursor:pointer; }
.CSSteam4 { font-weight: bold; color: #A0AF20; cursor:pointer; }
.CSSteam5 { font-weight: bold; color: #0F79D3; cursor:pointer; }
.CSSteam6 { font-weight: bold; color: #D85E23; cursor:pointer; }
.CSSteam7 { font-weight: bold; color: #5C832F; cursor:pointer; }
.CSSteam8 { font-weight: bold; color: #842B61; cursor:pointer; }
.CSSteam9 { font-weight: bold; color: navy; cursor:pointer; }
.CSSvs { font-weight: bold; }</style>';
$r .= '<h3>&laquo;' . $this->name[$this->info['type']] . '&raquo;</h3><br>Начало турнира через ' . $u->timeOut(
$this->info['time'] - time()
) . '! ';
if ($this->user['points'] < 3) {
//Еще не получили обмундирование
if ($this->user['points'] < 2) {
$r .= '<INPUT class=\'btn_grey\' onClick="location=\'main.php?gocomplect=1\';" TYPE=button name=tmp value="Получить обмундирование">';
} else {
$r .= ' <INPUT class=\'btn_grey\' onClick="location=\'main.php\';" TYPE=button name=tmp value="Я готов';
if ($u->info['sex'] == 1) {
$r .= 'а';
}
$r .= '!">';
}
} else {
$r .= '<small><b>Вы участвуете в турнире!</b></small>';
}
$r .= '<div style="float:right"><INPUT onClick="location=\'main.php\';" TYPE=button name=tmp value="Обновить"></div><hr>';
$r .= '<b class="CSSteam1">Команда №1</b>: ' . rtrim($tm1, ', ');
$r .= '<br><b class="CSSteam2">Команда №2</b>: ' . rtrim($tm2, ', ');
if (($this->info['time'] - time() < 0) && $this->info['step'] == 1) {
//начинаем турнир
$this->startTurnir();
}
echo $r;
}
}
$tur = new turnir;
$tur->start();

View File

@ -358,7 +358,7 @@ if (isset($_POST['tologin'], $_POST['message'])) {
?>
<table>
<a href="#"
onClick="openMod('<b>Заклятие молчания</b>','<form action=\'main.php?<?= alhp . '&usemod=' . $code; ?>\' method=\'post\'>Логин персонажа: <input type=\'text\' style=\'width:144px;\' id=\'logingo\' name=\'logingo\'><br>Время заклятия: &nbsp; <select style=\'margin-left:2px;\' name=\'time\'><option value=\'1440\'>Сутки</option></select> <input type=\'submit\' name=\'usem1\' value=\'Исп-ть\'></form>');"><img
onClick="openMod('<b>Заклятие молчания</b>','<form action=\'main.php?<?= 'alhp&usemod=' . $code; ?>\' method=\'post\'>Логин персонажа: <input type=\'text\' style=\'width:144px;\' id=\'logingo\' name=\'logingo\'><br>Время заклятия: &nbsp; <select style=\'margin-left:2px;\' name=\'time\'><option value=\'1440\'>Сутки</option></select> <input type=\'submit\' name=\'usem1\' value=\'Исп-ть\'></form>');"><img
src="//img.new-combats.tech/i/items/sleep.gif" title="Заклятие молчания"/></a>
&nbsp;
<br><h4>Телеграф</h4>

File diff suppressed because it is too large Load Diff

View File

@ -1,358 +0,0 @@
<?php
if(!defined('GAME'))
{
die();
}
$friend = mysql_fetch_array(mysql_query("SELECT * FROM `friends` WHERE `user` = '".mysql_real_escape_string($u->info['id'])."' LIMIT 1;"));
if($_POST['sd4'] && $_POST['friendadd']){
$_POST['friendadd']=htmlspecialchars($_POST['friendadd'],NULL);
if(preg_match("/__/",$_POST['friendadd']) || preg_match("/--/",$_POST['friendadd'])){
echo"<font color=red>Персонаж не найден.</font>";
}else{
$frd = mysql_fetch_array(mysql_query("SELECT `id` FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['friendadd'])."' LIMIT 1;"));
}
$_POST['comment']=htmlspecialchars($_POST['comment'],NULL);
$frd2 = mysql_fetch_array(mysql_query("SELECT enemy,friend,notinlist FROM `friends` WHERE `user` = '".mysql_real_escape_string($u->info['id'])."' and (`friend`='".mysql_real_escape_string($frd['id'])."' or `enemy`='".mysql_real_escape_string($frd['id'])."' or `notinlist`='".mysql_real_escape_string($frd['id'])."') LIMIT 1;"));
if(!$frd['id']){echo"<font color=red>Персонаж не найден.</font>";}
elseif($frd['id']==$u->info['id']){echo"<font color=red>Себя добавить нельзя.</font>";}
elseif(preg_match("/__/",$_POST['comment']) || preg_match("/--/",$_POST['comment'])){echo"<font color=red>Введен неверный текст.</font>";}
elseif($frd2['enemy'] or $frd2['friend'] or $frd2['notinlist']){echo"<font color=red>Персонаж уже есть в вашем списке.</font>";}
else{
if($_POST['group']==0){$notinlist=0; $friend=$frd['id']; $enemy=0;}
elseif($_POST['group']==1){$notinlist=0; $friend=0; $enemy=$frd['id'];}
else{$notinlist=$frd['id']; $friend=0; $enemy=0;}
mysql_query("INSERT INTO `friends` (`user`, `friend`, `enemy`, `notinlist`, `comment`) VALUES(".mysql_real_escape_string($u->info['id']).", ".mysql_real_escape_string($friend).", ".mysql_real_escape_string($enemy).", ".mysql_real_escape_string($notinlist).", '".mysql_real_escape_string($_POST['comment'])."');");
echo"<font color=red>Персонаж <b>".$_POST['friendadd']."</b> добавлен.</font>";
}
}
if($_POST['friendremove']){
$_POST['friendremove']=htmlspecialchars($_POST['friendremove'],NULL);
if(preg_match("/__/",$_POST['friendremove']) || preg_match("/--/",$_POST['friendremove'])){
echo"<font color=red>Персонаж не найден.</font>";
}else{
$frd = mysql_fetch_array(mysql_query("SELECT id FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['friendremove'])."' LIMIT 1;"));
}
if(!$frd['id']){echo"<font color=red>Персонаж не найден.</font>";}
else{$frd2 = mysql_fetch_array(mysql_query("SELECT enemy,friend,notinlist FROM `friends` WHERE `user` = '".mysql_real_escape_string($u->info['id'])."' and (`friend`='".mysql_real_escape_string($frd['id'])."' or `enemy`='".mysql_real_escape_string($frd['id'])."' or `notinlist`='".mysql_real_escape_string($frd['id'])."') LIMIT 1;"));
if(!$frd2['enemy'] && !$frd2['friend'] && !$frd2['notinlist']){echo"<font color=red>Персонаж не найден в вашем списке.</font>";}else{
if($frd2['friend']>0){$per="`friend`='".$frd2['friend']."'";}
if($frd2['enemy']>0){$per="`enemy`='".$frd2['enemy']."'";}
if($frd2['notinlist']>0){$per="`notinlist`='".$frd2['notinlist']."'";}
if(mysql_query("DELETE FROM `friends` WHERE `user`='".mysql_real_escape_string($u->info['id'])."' and ".$per.";")){echo"<font color=red>Данные контакта <b>".$_POST['friendremove']."</b> успешно удалены.</font>";}
}
}
}
if($_POST['friendedit']){
$_POST['friendedit']=htmlspecialchars($_POST['friendedit'],NULL);
if(preg_match("/__/",$_POST['friendedit']) || preg_match("/--/",$_POST['friendedit'])){
echo"<font color=red>Персонаж не найден.</font>";
}else{
$frd = mysql_fetch_array(mysql_query("SELECT id FROM `users` WHERE `login` = '".mysql_real_escape_string($_POST['friendedit'])."' LIMIT 1;"));
}
$_POST['comment']=htmlspecialchars($_POST['comment'],NULL);
if(!$frd['id']){echo"<font color=red>Персонаж не найден.</font>";}
elseif($frd['id']==$u->info['id']){echo"<font color=red>Себя отредактировать нельзя.</font>";}
elseif(preg_match("/__/",$_POST['comment']) || preg_match("/--/",$_POST['comment'])){echo"<font color=red>Введен неверный текст.</font>";}
else{
if($_POST['group']==0){$notinlist=0; $friend=$frd['id']; $enemy=0;}
elseif($_POST['group']==1){$notinlist=0; $friend=0; $enemy=$frd['id'];}
else{$notinlist=$frd['id']; $friend=0; $enemy=0;}
$frd2 = mysql_fetch_array(mysql_query("SELECT enemy,friend,notinlist FROM `friends` WHERE `user` = '".mysql_real_escape_string($u->info['id'])."' and (`friend`='".mysql_real_escape_string($frd['id'])."' or `enemy`='".mysql_real_escape_string($frd['id'])."' or `notinlist`='".mysql_real_escape_string($frd['id'])."') LIMIT 1;"));
if(!$frd2['enemy'] && !$frd2['friend'] && !$frd2['notinlist']){echo"<font color=red>Персонаж не найден в вашем списке.</font>";}else{
if($frd2['friend']>0){$per="`friend`='".mysql_real_escape_string($frd2['friend'])."'";}
if($frd2['enemy']>0){$per="`enemy`='".mysql_real_escape_string($frd2['enemy'])."'";}
if($frd2['notinlist']>0){$per="`notinlist`='".mysql_real_escape_string($frd2['notinlist'])."'";}
$comment = $_POST['comment'];
mysql_query("UPDATE `friends` SET `friend` = '".mysql_real_escape_string($friend)."',`enemy` = '".mysql_real_escape_string($enemy)."',`notinlist` = '".mysql_real_escape_string($notinlist)."',`comment` = '".mysql_real_escape_string($comment)."' WHERE `user`='".mysql_real_escape_string($u->info['id'])."' and $per");
echo"<font color=red>Данные контакта <b>".$_POST['friendedit']."</b> успешно изменены.</font>";
}
}
}
?>
<HTML><HEAD>
<META Http-Equiv=Cache-Control Content=no-cache>
<meta http-equiv=PRAGMA content=NO-CACHE>
<META Http-Equiv=Expires Content=0>
<link rel=stylesheet type="text/css" href="//img.new-combats.tech/main.css">
<link href="//img.new-combats.tech/move/design3.css" rel="stylesheet" type="text/css">
<SCRIPT>
var nlevel=0;
var from = Array('+', ' ', '#');
var to = Array('%2B', '+', '%23');
function editcontact(title, script, name, login, flogin, group, groups, subgroup, subgroups, comment)
{ var s = '<table width=250 cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>'+title+'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>';
s +='<table width=250 cellspacing=0 cellpadding=4 bgcolor=FFF6DD><tr><form action="'+script+'" method=POST><td align=center>';
s +='<table width=1% border=0 cellspacing=0 cellpadding=2 align=center><tr><td align=right>';
flogin = flogin.replace( /^<SCRIPT>drwfl\((.*)\)<\/SCRIPT>$/i, 'drw($1)' );
s +='<small><b>Контакт:</b></small></td><td><INPUT TYPE=hidden NAME="'+name+'" VALUE="'+login+'">'+( flogin.match(/^drw\(/) ? eval(flogin) : flogin )+'</td></tr>';
if (groups && groups.length>0) {
s+='<tr><td align=right><small><b>Группа:</b></small></td><td align><SELECT NAME=group style="width: 140px">';
for(i=0; i< groups.length; i++) {
s+='<option value="'+i+'"'+( group == i ? ' selected' : '' ) +'>'+groups[i];
}
s+='</SELECT></td></tr>';
};
s += '<tr><td align=right><small><b>Комментарий:</b></small></td><td width="1%"><INPUT TYPE=text NAME="comment" VALUE="'+comment+'" style="width: 105px">&nbsp;';
s += '<INPUT type=image SRC=//img.new-combats.tech/i/b__ok.gif WIDTH=25 HEIGHT=18 ALT="Сохранить" style="border:0; vertical-align: middle"></TD></TR></TABLE><INPUT TYPE=hidden name=sd4 value=""></TD></FORM></TR></TABLE></td></tr></table>';
document.all("hint4").innerHTML = s;
document.all("hint4").style.visibility = "visible";
document.all("hint4").style.left = 100;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all("comment").focus();
Hint3Name = '';
}
function findlogin2(title, script, name, groups, subgroups)
{ var s = '<table width=270 cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>'+title+'</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>';
s +='<table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><form action="'+script+'" method=POST><td align=center>';
s +='<table width=90% cellspacing=0 cellpadding=2 align=center><tr><td align=left colspan="2">';
s +='Укажите логин персонажа:<br><small>(можно щелкнуть по логину в чате)</small></td></tr>';
s += '<tr><td align=right><small><b>Логин:</b></small></td><td><INPUT TYPE=text NAME="'+name+'" style="width:140px"></td></tr>';
if (groups && groups.length>0) {
s+='<tr><td align=right><small><b>Группа:</b></small></td><td width=140><SELECT NAME=group style="width:140px">';
for(i=0; i< groups.length; i++) {
s+='<option value="'+i+'">'+groups[i];
}
s+='</SELECT></td></tr>';
};
s += '<tr><td align=right><small><b>Комментарий:</b></small></td><td><INPUT TYPE=text NAME="comment" VALUE="" style="width:105px">&nbsp;';
s += '<INPUT type=image SRC=//img.new-combats.tech/i/b__ok.gif WIDTH=25 HEIGHT=18 ALT="Добавить контакт" style="border:0; vertical-align: middle"></TD></TR></TABLE><INPUT TYPE=hidden name=sd4 value="1"></TD></FORM></TR></TABLE></td></tr></table>';
document.all("hint4").innerHTML = s;
document.all("hint4").style.visibility = "visible";
document.all("hint4").style.left = 100;
document.all("hint4").style.top = document.body.scrollTop+50;
document.all(name).focus();
Hint3Name = name;
}
function w(login,id,align,klan,level,online, city, battle){
var s='';
if (online!="") {
if (city!="") {
s+='<IMG style="filter:gray()" SRC=//img.new-combats.tech/i/lock.gif WIDTH=20 HEIGHT=15 ALT="В другом городе">';
} else {
s+='<a href="javascript:top.addTo(\''+login+'\',\'private\')"><IMG SRC=//img.new-combats.tech/i/lock.gif WIDTH=20 HEIGHT=15 ALT="Приватно"'+(battle!=0?' style="filter: invert()"':'')+'></a>';
}
if (city!="") {
s+='<img src="//img.new-combats.tech/misc/forum/fo'+city+'.gif" width=17 height=15>';
}
s+=' <IMG SRC=//img.new-combats.tech/i/align/align'+align+'.gif WIDTH=12 HEIGHT=15>';
if (klan!='') {s+='<A HREF="/encicl/klan/'+klan+'.html" target=_blank><IMG SRC="//img.new-combats.tech/i/clan/'+klan+'.gif" WIDTH=24 HEIGHT=15 ALT=""></A>'}
s+='<a href="javascript:top.addTo(\''+login+'\',\'to\');">'+login+'</a>['+level+']<a href=/info/'+id+' target=_blank><IMG SRC=//img.new-combats.tech/i/inf_.gif WIDTH=12 HEIGHT=11 ALT="Информация о персонаже"></a>';
s+='</td><td bgcolor=efeded nowrap>';
if (city!="") {
s+="нет в этом городе";
} else {
s+=online;
}
}
else {
s+='<IMG SRC="//img.new-combats.tech/i/offline.gif" WIDTH=20 HEIGHT=15 BORDER=0 ALT="Нет в клубе">';
if (city!="") {
s+='<img src="//img.new-combats.tech/misc/forum/fo'+city+'.gif" width=17 height=15>';
}
if (align == "") align="0";
s+=' <IMG SRC=//img.new-combats.tech/i/align/align'+align+'.gif WIDTH=12 HEIGHT=15>';
if (klan!='') {s+='<A HREF="/encicl/klan/'+klan+'.html" target=_blank><IMG SRC="//img.new-combats.tech/i/clan/'+klan+'.gif" WIDTH=24 HEIGHT=15 ALT=""></A>'}
if (level) {
if (nlevel==0) {
nlevel=1; //s="<BR>"+s;
}
s+='<FONT color=gray><b>'+login+'</b>['+level+']<a href=/info/'+id+' target=_blank><IMG SRC=//img.new-combats.tech/inf_dis.gif WIDTH=12 HEIGHT=11 ALT="Информация о персонаже"></a></td><td bgcolor=efeded nowrap>Нет в клубе';
} else {
if (nlevel==1) {
nlevel=2; //s="<BR>"+s;
}
mlogin = login;
for(var i=0;i<from.length;++i) while(mlogin.indexOf(from[i])>=0) mlogin= mlogin.replace(from[i],to[i]);
s+='<FONT color=gray><i>'+login+'</i> <a href=/info/'+mlogin+' target=_blank><IMG SRC=//img.new-combats.tech/inf_dis.gif WIDTH=12 HEIGHT=11 ALT="Информация о персонаже"></a></td><td bgcolor=efeded nowrap>нет в этом городе';
}
s+='</FONT>';
}
document.write(s+'<BR>');
}
function m(login,id,align,klan,level){
var s='';
s+='<a href="javascript:top.addTo(\''+login+'\',\'private\')"><IMG SRC=//img.new-combats.tech/i/lock.gif WIDTH=20 HEIGHT=15 ALT="Приватно"></a>';
s+=' <IMG SRC=//img.new-combats.tech/i/align/align'+align+'.gif WIDTH=12 HEIGHT=15>';
if (klan!='') {
s+='<A HREF="/encicl/klan/'+klan+'.html" target=_blank><IMG SRC="//img.new-combats.tech/i/clan/'+klan+'.gif" WIDTH=24 HEIGHT=15 ALT=""></A>'
}
s+='<a href="javascript:top.addTo(\''+login+'\',\'to\');">'+login+'</a>['+level+']<a href=/info/'+id+' target=_blank><IMG SRC=//img.new-combats.tech/i/inf_.gif WIDTH=12 HEIGHT=11 ALT="Информация о персонаже"></a>';
document.write(s+'<BR>');
}
function drw(name, id, level, align, klan, img, sex)
{
var s="";
if (align!="0") s+="<A HREF='"+getalignurl(align)+"' target=_blank><IMG SRC='//img.new-combats.tech/i/align/align"+align+".gif' WIDTH=12 HEIGHT=15 ALT=\""+getalign(align)+"\"></A>";
if (klan) s+="<A HREF='claninfo/"+klan+"' target=_blank><IMG SRC='//img.new-combats.tech/i/clan/"+klan+".gif' WIDTH=24 HEIGHT=15 ALT=''></A>";
s+="<B>"+name+"</B>";
if (level!=-1) s+=" ["+level+"]";
if (id!=-1 && !img) s+="<A HREF='/info/"+id+"' target='_blank'><IMG SRC=//img.new-combats.tech/i/inf_.gif WIDTH=12 HEIGHT=11 ALT='Инф. о "+name+"'></A>";
if (img) s+="<A HREF='/encicl/obraz_"+(sex?"w":"m")+"1.html?l="+img+"' target='_blank'><IMG SRC=//img.new-combats.tech/i/inf_.gif WIDTH=12 HEIGHT=11 ALT='Образ "+name+"'></A>";
return s;
}
</SCRIPT>
</HEAD>
<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor=e2e0e0>
<div id=hint4 class=ahint></div>
<TABLE cellspacing=0 cellpadding=2 width="100%">
<TR>
<TD style="vertical-align: top; "><TABLE cellspacing=0 cellpadding=2 width="100%">
<TR>
<TD colspan="4" align="center"><h4>Контакты</h4></TD>
</TR>
<?php
$data=mysql_query("SELECT `notinlist`,`comment` FROM `friends` WHERE `user` = '".mysql_real_escape_string($u->info['id'])."' and `notinlist`>0;");
while ($row = mysql_fetch_array($data)) {
$us=mysql_fetch_array(mysql_query("SELECT `id`,`login`,`clan`,`level`,`align`,`room`,`online`,`city`,
(select `name_mini` from `clan` WHERE `id` = users.`clan`) as `klan`,
(select `name` from `room` WHERE `id` = users.`room`) as `room`
FROM `users` WHERE `id` = '".mysql_real_escape_string($row['notinlist'])."';"));?>
<TR valign="top">
<TD bgcolor=efeded nowrap>
<?php
//function w(login,id,align,klan,level,online, city, battle)
if ($us['online']>(time()-120)) {
$rrm = $us['room'];
}else{
$rrm = '';
}
?>
<SCRIPT>w('<?=$us['login']?>','<?=$us['id']?>','<?=$us['align']?>','<?=$us['klan']?>','<?=$us['level']?>','<?=$rrm?>','','<?$us['battle']?>');</SCRIPT></TD>
<TD bgcolor=efeded width="40%"><small><FONT class=dsc><i><?=$row['comment']?></i></FONT></small><TD>
<TD width="1%"><INPUT type=image SRC=//img.new-combats.tech/i/b__ok.gif WIDTH=25 HEIGHT=18 ALT="Редактировать" style="float: right" onclick='editcontact("Редактирование контакта", "main.php?friends", "friendedit", "<?=$us['login']?>", "<SCRIPT>drwfl(\"<?=$us['login']?>\",<?=$row['notinlist']?>,\"<?=$us['level']?>\",0,\"<?=$us['klan']?>\")</SCRIPT>", "2", new Array( "Друзья","Враги","Не в группе" ), "", new Array( ), "<?=$row['comment']?>");'></TD>
</TR>
<?php
}
$data=mysql_query("SELECT `enemy`,`comment` FROM `friends` WHERE `user` = '".mysql_real_escape_string($u->info['id'])."' and `enemy`>0;");
while ($row = mysql_fetch_array($data)) {
$us=mysql_fetch_array(mysql_query("SELECT `id`,`login`,`clan`,`level`,`align`,`room`,`online`,`city`,
(select `name_mini` from `clan` WHERE `id` = users.`clan`) as `klan`,
(select `name` from `room` WHERE `id` = users.`room`) as `room`
FROM `users` WHERE `id` = '".mysql_real_escape_string($row['enemy'])."';"));
$n++;
if($n==1){
?>
<TR>
<TD colspan="4" nowrap align="center" style="height: 40px" valign="bottom"><h4>Враги</h4></TD>
</TR>
<?}?>
<TR valign="top">
<TD bgcolor=efeded nowrap>
<?php
//function w(login,id,align,klan,level,online, city, battle)
if ($us['online']>(time()-120)) {
$rrm = $us['room'];
}else{
$rrm = '';
}
?>
<SCRIPT>w('<?=$us['login']?>','<?=$us['id']?>','<?=$us['align']?>','<?=$us['klan']?>','<?=$us['level']?>','<?=$rrm?>','','<?$us['battle']?>');</SCRIPT></TD>
<TD bgcolor=efeded width="40%"><small><FONT class=dsc><i><?=$row['comment']?></i></FONT></small><TD>
<TD width="1%"><INPUT type=image SRC=//img.new-combats.tech/i/b__ok.gif WIDTH=25 HEIGHT=18 ALT="Редактировать" style="float: right" onclick='editcontact("Редактирование контакта", "main.php?friends", "friendedit", "<?=$us['login']?>", "<SCRIPT>drwfl(\"<?=$us['login']?>\",<?=$row['enemy']?>,\"<?=$us['level']?>\",0,\"<?=$us['klan']?>\")</SCRIPT>", "1", new Array( "Друзья","Враги","Не в группе" ), "", new Array( ), "<?=$row['comment']?>");'></TD>
</TR>
<?php
}
$data=mysql_query("SELECT `friend`,`comment` FROM `friends` WHERE `user` = '".mysql_real_escape_string($u->info['id'])."' and `friend`>0;");
while ($row = mysql_fetch_array($data)) {
$us=mysql_fetch_array(mysql_query("SELECT `id`,`login`,`clan`,`level`,`align`,`room`,`online`,`city`,
(select `name_mini` from `clan` WHERE `id` = users.`clan`) as `klan`,
(select `name` from `room` WHERE `id` = users.`room`) as `room`
FROM `users` WHERE `id` = '".mysql_real_escape_string($row['friend'])."' ORDER BY online DESC, login ASC;"));
$i++;
if($i==1){
?>
<TR>
<TD colspan="4" nowrap align="center" style="height: 40px" valign="bottom"><h4>Друзья</h4></TD>
</TR>
<?}?>
<TR valign="top">
<TD bgcolor=efeded nowrap>
<?php
//function w(login,id,align,klan,level,online, city, battle)
if ($us['online']>(time()-120)) {
$rrm = $us['room'];
}else{
$rrm = '';
}
?>
<SCRIPT>w('<?=$us['login']?>','<?=$us['id']?>','<?=$us['align']?>','<?=$us['klan']?>','<?=$us['level']?>','<?=$rrm?>','','<?$us['battle']?>');</SCRIPT></TD>
<TD bgcolor=efeded width="40%"><small><FONT class=dsc><i><?=$row['comment']?></i></FONT></small><TD>
<TD width="1%"><INPUT type=image SRC=//img.new-combats.tech/i/b__ok.gif WIDTH=25 HEIGHT=18 ALT="Редактировать" style="float: right" onclick='editcontact("Редактирование контакта", "main.php?friends", "friendedit", "<?=$us['login']?>", "<SCRIPT>drwfl(\"<?=$us['login']?>\",<?=$row['friend']?>,\"<?=$us['level']?>\",0,\"<?=$us['klan']?>\")</SCRIPT>", "7", new Array( "Друзья","Враги","Не в группе" ), "", new Array( ), "<?=$row['comment']?>");'></TD>
</TR>
<?php
}
?>
<TR>
<TD colspan="4"><INPUT type='button' style='width: 100px' value='Добавить' onclick='findlogin2("Добавить в список", "main.php?friends", "friendadd", new Array("Друзья","Враги","Не в группе"), new Array())'>
&nbsp;&nbsp;&nbsp;
<INPUT type='button' style='width: 100px' value='Удалить' onclick='findlogin("Удалить из списка", "main.php?friends", "friendremove", "", 0)'></TD>
</TR>
</TABLE></TD>
<TD style="width: 5%; vertical-align: top; ">&nbsp;</TD>
<TD style="width: 30%; vertical-align: top; "><TABLE cellspacing=0 cellpadding=2>
<TR>
<TD style="width: 25%; vertical-align: top; text-align: right; "><INPUT type='button' value='Обновить' style='width: 75px' onclick='location="main.php?friends"'>
&nbsp;<INPUT TYPE=button value="Вернуться" style='width: 75px' onclick='location="main.php"'></TD>
</TR>
<TR>
<TD align=center><h4>Модераторы on-line</h4></TD>
</TR>
<TR>
<TD bgcolor=efeded nowrap style="text-align: left; "><table align="left">
<tr><td>
<SCRIPT>
<?php
$data=mysql_query("SELECT `id`, `login`, `level`, `align`, `clan` FROM `users` WHERE `online` > '".(time()-120)."' AND ((align>1 and align<2 and align!=1.2) or (align>3 and align<4)) AND `city` = '".mysql_real_escape_string($u->info['city'])."' order by align asc;");
while ($row = mysql_fetch_array($data)) {
//m( login, id, align, klan, level)
echo"m('".$row['login']."','".$row['id']."','".$row['align']."','".$row['klan']."','".$row['level']."');";
}
?>
</SCRIPT>
<?php
$chk=mysql_fetch_array(mysql_query("SELECT `id` FROM `users` WHERE `online` > '".(time()-120)."' AND ((align>1 and align<2 and align!=1.2) or (align>3 and align<4)) AND `city` = '".mysql_real_escape_string($u->info['city'])."' order by align asc;"));
if(!$chk['id']) {echo'<font color=grey>К сожалению в данный момент никого из модераторов нет в городе.</font>';}?>
</TD></tr></table></TD>
</TR>
<TR>
<TD style="text-align: left; "><small>Уважаемые Игроки!<BR>Для более быстрого и эффективного решения Вашей проблемы просьба обращаться к тем паладинам или тарманам, ники которых находятся вверху списка «Модераторы on-line».
<BR>Цените свое и чужое время!<BR>P.S. не пишите всем модераторам сразу и воздержитесь от вопросов стажерам - они находятся в процессе получения знаний
</small></div></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE>
<!--Тут рейтинг-->
</HTML>

View File

@ -7,7 +7,7 @@
use Core\Database;
session_start();
//session_start();
if (!defined('GAME')) {
die();
@ -424,7 +424,7 @@ if (isset($_GET['mAjax'])) {
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<table cellspacing="0" cellpadding="0" style="border-width: 0; width: 100%;">
<tr>
<td width="250" valign="top" align="right">
<div style="padding-top: 6px; text-align: center">

View File

@ -3,7 +3,6 @@ if (!defined('GAME')) {
die();
}
session_start();
$rang = '';
if (floor($u->info['align']) == 1) {

View File

@ -1,443 +0,0 @@
<?php
echo "
<script language='JavaScript'>
var elem = document.getElementById('se-pre-con');
elem.parentNode.removeChild(elem);
</script>
";
if(!defined('GAME')) {
die();
}
$slot = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal_slot` WHERE `uid` = "'.$u->info['id'].'" LIMIT 1'));
if(!isset($slot['id'])) {
if( mysql_query('INSERT INTO `users_animal_slot` ( `uid`,`slots`,`ekr` ) VALUES ( "'.$u->info['id'].'","2","0" )') ) {
$slot = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal_slot` WHERE `uid` = "'.$u->info['id'].'" LIMIT 1'));
}else{
$u->error = 'Ошибка в работе базы данных...';
}
}
$slot['price_next'] = 5;
$petox = mysql_fetch_array(mysql_query('SELECT * FROM `obraz_pet` WHERE `uid` = "'.$u->info['id'].'" LIMIT 1'));
$petox = $petox[0];
$an_eda = array(
0.05,
0.07,
0.10,
0.15,
0.20,
0.30,
0.40,
0.50,
0.60,
0.70,
0.80,
1.00,
1.50,
2.00,
2.50,
3.00,
3.50,
4.00,
4.50,
5.00,
5.50,
7.00
);
function en_ru($txt) {
$g = false;
$en = preg_match("/^(([0-9a-zA-Z _-])+)$/i", $txt);
$ru = preg_match("/^(([0-9а-яА-Я _-])+)$/i", $txt);
if(($ru && $en) || (!$ru && !$en)) {
$g = true;
}
return $g;
}
//
function testBad($txt) {
$white = '-_ 0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNMЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮёйцукенгшщзхъфывапролджэячсмитьбю';
$r = false;
$i = 0;
while( $i != -1 ) {
if( isset($txt[$i]) ) {
$g = false;
$j = 0;
while( $j != -1 ) {
if(isset($white[$j])) {
if( $white[$j] == $txt[$i] ) {
$g = true;
}
}else{
$j = -2;
}
$j++;
}
if( $g == false ) {
$r = true;
}
}else{
$i = -2;
}
$i++;
}
return $r;
}
function is_login_an($login) {
$r = true;
//
$login = htmlspecialchars($login,NULL);
//
$bad = array(
'Мусорщик' => 1,
'Мироздатель' => 1
);
//
//$login_db = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "'.mysql_real_escape_string($login).'" LIMIT 1'));
//$login_an_db = mysql_fetch_array(mysql_query('SELECT `id` FROM `users_animal` WHERE `name` = "'.mysql_real_escape_string($login).'" LIMIT 1'));
if( isset($login_db['id']) || isset($login_an_db['id']) || isset($bad[$login]) ) {
$r = false;
}else{
$true = true;
//
/*
Логин может содержать от 2 до 16 символов, и состоять только из букв русского ИЛИ английского алфавита, цифр, символов '_', '-' и пробела.
Логин не может начинаться или заканчиваться символами '_', '-' или пробелом.
*/
//
$login = str_replace(' ',' ',$login);
$login = str_replace('%',' ',$login);
$login = str_replace('&nbsp;',' ',$login);
//
if( strlen($login) > 16 ) {
$true = false;
}elseif( strlen($login) < 2 ) {
$true = false;
}elseif( strripos($login,' ') == true ) {
$true = false;
}elseif( substr($login,1) == ' ' || substr($login,-1) == ' ' ) {
$true = false;
}elseif( substr($login,1) == '-' || substr($login,-1) == '-' ) {
$true = false;
}elseif( substr($login,1) == '_' || substr($login,-1) == '_' ) {
$true = false;
}elseif( testBad($login) == true ) {
$true = false;
}elseif( en_ru(str_replace('ё','е',str_replace('Ё','Е',$login))) == true ) {
$true = false;
}
//
if( $true == false ) {
$r = false;
}else{
$r = true;
}
}
return $r;
}
if(isset($_GET['buy_slot'])) {
if($u->info['money2'] < $slot['price_nex']) {
$u->error = 'Недостаточно денег';
}elseif($u->info['money2'] < 5 ) {
$u->error = 'Недостаточно екр!';
}elseif( isset($slot['id']) && $slot['slots'] < 7 ) {
$slot['slots']++;
$u->info['money2'] -= 5;
mysql_query('UPDATE `users_animal_slot` SET `slots` = "'.$slot['slots'].'" WHERE `id` = "'.$slot['id'].'" LIMIT 1');
mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
$u->error = 'Куплен слот для зверя.';
}else{
$u->error = 'Нельзя купить больше слотов';
}
}elseif(isset($_GET['pet'])) {
$_GET['pet'] = round((int)$_GET['pet']);
$_GET['petname'] = htmlspecialchars($_GET['petname'],NULL);
$ax = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users_animal` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 LIMIT 1'));
$ax = $ax[0];
if( $_GET['pet'] < 1 || $_GET['pet'] > 7 ) {
$u->error = 'Нельзя привзвать такого зверя';
}elseif( $ax >= $slot['slots'] ) {
$u->error = 'Нет свободных слотов для зверя';
}elseif( $u->info['money'] < 50 ) {
$u->error = 'Недостаточно денег';
}elseif(is_login_an($_GET['petname']) == false) {
$u->error = 'Неверная кличка зверя, выберите другую';
}else{
$u->error = 'Зверь пришел к Вам!';
$u->info['money'] -= 50;
mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
//
$anm['type'] = $_GET['pet'];
//
if($anm['type']==1)
{
$anm['name'] = 'Кот';
$anm['sex'] = 0;
$anm['obraz'] = array(1=>'20864.gif',2=>'21301.gif',3=>'21139.gif',4=>'20427.gif');
$anm['stats'] = 's1=2|s2=5|s3=2|s4=5|rinv=40|m9=5|m6=10';
}elseif($anm['type']==2)
{
$anm['name'] = 'Сова';
$anm['sex'] = 1;
$anm['obraz'] = array(1=>'21415.gif',2=>'21722.gif',3=>'21550.gif');
$anm['stats'] = 's1=2|s2=2|s3=5|s4=5|rinv=40|m9=5|m6=10';
}elseif($anm['type']==3)
{
$anm['name'] = 'Светляк';
$anm['sex'] = 0;
$anm['obraz'] = array(1=>'22277.gif',2=>'22265.gif',3=>'22333.gif',4=>'22298.gif');
$anm['stats'] = 's1=3|s2=10|s3=3|s4=4|rinv=40|m9=5|m6=10';
}elseif($anm['type']==4)
{
$anm['name'] = 'Чертяка';
$anm['sex'] = 0;
$anm['obraz'] = array(1=>'22177.gif',2=>'21976.gif',3=>'21877.gif');
$anm['stats'] = 's1=25|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10';
}elseif($anm['type']==5)
{
$anm['name'] = 'Пес';
$anm['sex'] = 0;
$anm['obraz'] = array(1=>'22352.gif',2=>'23024.gif',3=>'22900.gif',4=>'22501.gif',5=>'22700.gif');
$anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';
}elseif($anm['type']==6)
{
$anm['name'] = 'Свин';
$anm['sex'] = 0;
$anm['obraz'] = array(1=>'24000.gif',2=>'25000.gif',3=>'27000.gif',4=>'28000.gif');
$anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';
}elseif($anm['type']==7)
{
$anm['name'] = 'Дракон';
$anm['sex'] = 0;
$anm['obraz'] = array(1=>'21338_pgtpdbx.gif');
$anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';
}
//
$anm['name'] = $_GET['petname'];
//
$anm['obraz'] = $anm['obraz'][rand(1,count($anm['obraz']))];
$anm['obraz'] = str_replace('.gif','',$anm['obraz']);
$anm['obraz'] = str_replace('.jpg','',$anm['obraz']);
$anm['obraz'] = str_replace('.png','',$anm['obraz']);
$ins = mysql_query('INSERT INTO `users_animal` (`type`,`name`,`uid`,`obraz`,`stats`,`sex`,`eda`) VALUES ("'.$anm['type'].'","'.$anm['name'].'","'.$u->info['id'].'","'.$anm['obraz'].'","'.$anm['stats'].'","'.$anm['sex'].'","0")');
if($ins)
{
$u->addDelo(1,$u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: Персонаж призвал зверя &quot;'.$_GET['petname'].'&quot; ('.$_GET['pet'].') - 50 кр.',time(),$u->info['city'],'System.inventory',0,0);
}else{
$u->error = 'Не удалось призвать зверя, что-то здесь не так ...';
}
//
}
//
}elseif(isset($_GET['eda'])) {
$anm = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal` WHERE `id` = "'.mysql_real_escape_string($_GET['eda']).'" AND `uid` = "'.$u->info['id'].'" AND `delete` = 0 LIMIT 1'));
$x = round((int)$_GET['vvv']);
if($x > 100 - $anm['eda']) { $x = 100 - $anm['eda']; }
if($x < 1) { $x = 1; }
if($x > 100) { $x = 100; }
if(!isset($anm['id'])) {
$u->error = 'Зверь не найден.';
}elseif( $anm['eda'] >= 100 ) {
$u->error = 'Зверь сыт и не нуждается в еде.';
}elseif($an_eda[$anm['level']]*$_GET['vvv'] > $u->info['money']) {
$u->error = 'Недостаточно денег.';
}else{
$u->error = 'Покормили зверя &quot;'.$anm['name'].'&quot; на '.$x.' ед. за '.($x*$an_eda[$anm['level']]).' кр.';
$u->info['money'] -= ($x*$an_eda[$anm['level']]);
$anm['eda'] += $x;
mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('UPDATE `users_animal` SET `eda` = "'.$anm['eda'].'" WHERE `id` = "'.$anm['id'].'" LIMIT 1');
}
}elseif(isset($_GET['pet_del'])) {
if(mysql_query('UPDATE `users_animal` SET `delete` = "'.time().'" WHERE `id` = "'.mysql_real_escape_string($_GET['pet_del']).'" AND `delete` = 0 AND `uid` = "'.$u->info['id'].'" LIMIT 1')) {
$u->error = 'Зверь был выгнан.';
}else{
$u->error = 'Зверь не найден.';
}
}elseif(isset($_GET['rename'])) {
$anm = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal` WHERE `id` = "'.mysql_real_escape_string($_GET['rename']).'" AND `uid` = "'.$u->info['id'].'" AND `delete` = 0 LIMIT 1'));
$_GET['vvv'] = htmlspecialchars($_GET['vvv'],NULL);
if(!isset($anm['id'])) {
$u->error = 'Зверь не найден.';
}elseif(30 > $u->info['money']) {
$u->error = 'Недостаточно денег.';
}else{
$u->info['money'] -= 30;
$anm['name'] = $_GET['vvv'];
$u->error = 'Кличка зверя изменена на &quot;'.$anm['name'].'&quot; за 30 кр.';
mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('UPDATE `users_animal` SET `name` = "'.$anm['name'].'" WHERE `id` = "'.$anm['id'].'" LIMIT 1');
}
}elseif(isset($_GET['shadow']) && $petox > 0) {
if(isset($_GET['rechange'])) {
$u->error = 'Образ питомца снят.';
mysql_query('UPDATE `obraz_pet` SET `use` = 0 WHERE `uid` = "'.$u->info['id'].'"');
}elseif(isset($_GET['change'])) {
$u->error = 'Образ питомца установлен.';
mysql_query('UPDATE `obraz_pet` SET `use` = 0 WHERE `uid` = "'.$u->info['id'].'"');
mysql_query('UPDATE `obraz_pet` SET `use` = 1 WHERE `uid` = "'.$u->info['id'].'" AND `id` = "'.mysql_real_escape_string($_GET['change']).'" LIMIT 1');
}
}
?>
<style>
.an_border {
border:1px solid #aaaaaa;
padding:2px;
width:120px;
height:220px;
}
.an_btn {
cursor:pointer;
}
.an_btn:hover {
cursor:pointer;
background-color:#cccccc;
}
.an_img64x64 {
padding-top:75px;
height:145px;
}
.an_line {
text-align:center;
padding:5px;
}
.an_line2 {
text-align:left;
padding:5px;
width:124px;
}
.an_w120 {
width:120px;
}
.cp {
cursor:pointer;
}
.obrsl1 {
border:1px solid #888;
padding:1px;
margin-bottom:5px;
}
.obrsl1d {
display:inline-block;
widows:120px;
}
</style>
<center><b>Ваши деньги:<font color=darkgreen> <?=$u->info['money']?> кр.</center></b></font>
<div align="right">
<?php
if(!isset($_GET['shadow']) || $petox == 0 ) {
if( $petox > 0 ) {
echo '<button onClick="location.href=\'/main.php?newanimal&shadow\';" class="btn btn-success">Образ</button>&nbsp;';
}else{
echo '<button disabled="disabled" onClick="alert(\'Установка образов возможно после покупки хотя бы одного образа для питомца.\');" class="btn btn-success">Образ</button>&nbsp;';
}
?>
<button onClick="location.href='/main.php?newanimal';" class="btn">Обновить</button>&nbsp;
<button onClick="location.href='/main.php?inv';" class="btn">Вернуться</button>
<?php }else{ ?>
<button onClick="location.href='/main.php?newanimal&shadow';" class="btn">Обновить</button>&nbsp;
<button onClick="location.href='/main.php?newanimal';" class="btn">Вернуться</button>
<?php } ?>
</div>
<?php
if( $u->error != '' ) {
echo '<div><b><font color="red">'.$u->error.'</font></b></div>';
}
?>
<hr>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<?php
if(isset($_GET['shadow']) && $petox > 0) {
//
echo '<td align="left">';
$sp = mysql_query('SELECT * FROM `obraz_pet` WHERE `uid` = "'.$u->info['id'].'"');
while( $pl = mysql_fetch_array($sp) ) {
echo '<div class="obrsl1d">';
//
echo '<img class="obrsl1" src="//img.new-combats.tech/pet/'.$pl['img'].'" width="120" height="40"><br><div align="center">';
if( $pl['use'] == 0 ) {
echo '<input onclick="location.href=\'/main.php?newanimal&shadow&change='.$pl['id'].'\';" style="width:120px;" type="button" value="Выбрать" class="btn">';
}else{
echo '<input onclick="location.href=\'/main.php?newanimal&shadow&rechange\';" style="width:120px;" type="button" value="Используется" class="btn btn-success">';
}
echo '</div>';
//
echo '</div>';
}
echo '</td>';
}else{
$sp = mysql_query('SELECT * FROM `users_animal` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 LIMIT 6');
$i = 1;
while( $pl = mysql_fetch_array($sp) ) {
//
if( isset($_GET['selected']) && $pl['id'] == $_GET['selected'] ) {
if( $u->info['animal'] != $pl['id'] ) {
$u->info['animal'] = $pl['id'];
}else{
$u->info['animal'] = 0;
}
mysql_query('UPDATE `users` SET `animal` = "'.$u->info['animal'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}
//
//$kp = 0.05; //цена корма
$kp = $an_eda[$pl['level']];
//$kp = $an_eda[1];
//
echo '<td width="16%" align="center" valign="top">';
//
echo '<div class="an_line"><b><img onclick="top.anrename('.$pl['id'].',\''.$pl['name'].'\');" class="cp" src="//img.new-combats.tech/pencil.png" width="16" height="16" title="Изменить кличку"> <small>'.$pl['name'].'</small> <img onclick="if(confirm(\'Вы действительно хотите ВЫГНАТЬ зверя &quot;'.$pl['name'].'&quot;?\')) location.href=\'main.php?newanimal&pet_del='.$pl['id'].'\';" class="cp" src="//img.new-combats.tech/i/clear.gif" title="Выгнать" width="13" height="13"></b></div>';
//
echo '<div title="'.$pl['name'].'" class="an_border"><img src="//img.new-combats.tech/i/obraz/'.$pl['sex'].'/'.$pl['obraz'].'.gif" width="120" height="220"></div>';
//
echo '<div class="an_line2"><small>';
echo 'Уровень: '.$pl['level'].'<br>Опыт: <b>'.$pl['exp'].'</b><br>Сытность: '.$pl['eda'].'/100<br>';
//
echo '<input ';
if( $pl['eda'] >= 100 ) {
echo ' disabled="disabled" ';
}else{
echo ' onclick="top.eda('.$pl['id'].',\''.$pl['name'].'\','.(0+$kp).','.(0+100-$pl['eda']).');" ';
}
echo 'type="button" value="Покормить" class="btn an_w120';
if( $pl['eda'] < 1 ) {
echo ' btn-danger';
}
echo '">';
//
if( $pl['id'] != $u->info['animal'] || ( isset($_GET['selected']) && $pl['id'] != $_GET['selected'] ) ) {
echo '<input onClick="location.href=\'main.php?newanimal&selected='.$pl['id'].'\';" type="button" value="Выбрать" class="btn an_w120">';
}else{
echo '<input onClick="location.href=\'main.php?newanimal&selected='.$pl['id'].'\';" type="button" value="Используется" class="btn btn-success an_w120">';
}
//
echo '</small></div>';
//
echo '</td>';
$i++;
}
if( $i <= 6 ) {
$j = 0;
while( $i <= 6 ) {
if( $i <= $slot['slots'] ) {
echo '<td width="16%" align="center" valign="top"><div class="an_line">&nbsp;</div><div onclick="top.petbuy();" onMouseOver="top.hi(this,\'Завести питомца (50 КР)\',event,0,1,1,1,\'\');" onMouseOut="top.hic(event);" onMouseDown="top.hic(event);" class="an_border an_btn an_img64x64"><img src="//img.new-combats.tech/pet_free_slot.png" width="64" height="64"></div></td>';
}else{
if( $j == 0 ) {
echo '<td width="16%" align="center" valign="top"><div class="an_line">&nbsp;</div><div onclick="if(confirm(\'Вы действительно хотите купить слот за '.$slot['price_next'].' ЕКР?\')) location.href=\'main.php?newanimal&buy_slot\';" onMouseOver="top.hi(this,\'Купить слот ('.$slot['price_next'].' ЕКР)\',event,0,1,1,1,\'\');" onMouseOut="top.hic(event);" onMouseDown="top.hic(event);" class="an_border an_btn an_img64x64"><img src="//img.new-combats.tech/pet_add.png" width="64" height="64"></div></td>';
$j++;
}else{
echo '<td width="16%" align="center" valign="top"><div class="an_line">&nbsp;</div><div title="Недоступно" class="an_border an_img64x64"><img src="//img.new-combats.tech/pet_lock.png" width="64" height="64"></div></td>';
}
}
$i++;
}
}
}
?>
</tr>
</table>

View File

@ -1,100 +1,14 @@
<?php
echo "
echo "
<script language='JavaScript'>
var elem = document.getElementById('se-pre-con');
elem.parentNode.removeChild(elem);
</script>
";
if(!defined('GAME') || !isset($_GET['referals']))
{
die();
if (!defined('GAME') || !isset($_GET['referals'])) {
die();
}
?>
<style> .row { cursor:pointer; } </style>
<script type="text/javascript">
function show(ele) {
var srcElement = document.getElementById(ele);
if(srcElement != null) {
if(srcElement.style.display == "block") {
srcElement.style.display= 'none';
}
else {
srcElement.style.display='block';
}
}
}
</script>
<style type="text/css">
.bordered, .bordered tr, .bordered tr td { font-family: Times New Roman; font-size: 14px;
border: 1px solid black; border-collapse: collapse; text-align: center; vertical-align: top; }
.bordered { border: 3px solid black; border-collapse: collapse;}
.bordered .al { text-align: left; }
.bordered .vam { vertical-align: middle; }
.bordered .ac { text-align: center; }
.bordered .b { font-weight: bold; }
.bordered .p { padding: 0px 5px 0px 5px; }
.bordered .btop { border-top: 3px solid black; border-collapse: collapse;}
.bordered .bright { border-right: 3px solid black; border-collapse: collapse;}
.bordered .bleft { border-left: 3px solid black; border-collapse: collapse;}
.bordered .bbottom { border-bottom: 3px solid black; border-collapse: collapse;}
.bordered .light { background: #F4E7CC;}
.font16, .font16 tr, .font16 tr td { font-family: Times New Roman; font-size: 16px;}
</style>
<div id="hint4" class="ahint"></div>
<table cellspacing="0" cellpadding="2" style="width: 100%; margin-top: 10px; margin-bottom: 10px;">
<tr>
<td style="width: 70%; vertical-align: top; text-align: center;">
<h4 style="font-family: Times New Roman; font-size: 18px">Реферальная Система</h4>
</td>
<td style="width: 27%; vertical-align: top; text-align: right; padding-right: 20px;">
<input type="button" class="btn" value="Обновить" onclick='location="/main.php?referals"'>
<input type="button" class="btn" value="Вернуться" onclick="location.href='/main.php'">
</td>
</tr>
</table>
<p style="margin: 5px 20px 5px 20px; padding: 0px;">С помощью реферальной системы Вы можете приводить в игру своих друзей используя ссылку ниже, и получать за это кредиты.</p>
<p style="margin: 5px 20px 5px 20px; padding: 0px;">
<b>При каждом пополнении баланса ЕКР Вашим рефералом Вы будете получать:</b><br>
- <b>10% ЕКР</b> от суммы пополнения реферала ;<br>
</p>
<p style="margin: 5px 20px 5px 20px; padding: 0px;">Ваша ссылка на регистрацию для новых игроков: <b style="color: red">/r<?=$u->info['id']?></b></p>
<?php
$rtg = mysql_fetch_array(mysql_query('SELECT * FROM `ref_mult` WHERE `uid1` = "'.$u->info['id'].'" LIMIT 1'));
if(isset($rtg['id'])) {
echo '<p style="margin: 5px 20px 5px 20px; padding: 0px;">Реферал с пересечением IP (разрешены бонусы только за этого реферала): <b style="color: red">'.$u->microLogin($rtg['uid2'],1).'</b><br>'.
'<small>(Сменить на другого реферала с одного IP больше нельзя!)</small></p>';
}
?>
<center>
<b>За каждого приведенного в игру реферала,Вы будете получать:</b>
</center>
<table cellspacing="0" cellpadding="2" style="width: 620px; margin: 7px auto 15px;" class="bordered ac font16 b">
<tr class="bbottom">
<td style="width: 16%;" class="bright">
<b>Уровень</b>
</td>
<td style="width: 28%;">
<b>Награда за реферала</b>
</td>
</tr>
<tr><td class="bright">8</td><td>0 КР</td>
<tr><td class="bright">9</td><td><font color=green>30 ЕКР</font></td>
<tr><td class="bright">10</td><td><font color=green>75 ЕКР</font></td>
<tr><td class="bright">11</td><td><font color=green>150 ЕКР</font></td>
</table>
<p style="margin: 5px 20px 15px 20px; padding: 0px;">
Разрешено создание не более одного реферала с одного айпи. Запрещена повторная регистрация одного и того же игрока по реферальной ссылке если он когда-либо уже играл. Реферальная система предусмотрена ТОЛЬКО ДЛЯ ПРИВЛЕЧЕНИЯ НОВЫХ ИГРОКОВ.<br>
Внимание! Запрещены просьбы о перерегистрации имеющихся в игре игроков, с целью получения "бесплатного" реферала. Новые рефералы в любом случае проходят модерацию и при наличии нарушений обнуляются, а ваш аккаунт может получить наказание за нарушение правил реферальной системы.<br>
Запрещается любая реклама реферальной ссылки внутри игры, в том числе размещение в анкете.
</p>
<?php
$x1 = 0;
$x2 = 0;
$x3 = 0;
@ -102,39 +16,205 @@ $xh1 = '';
$xh2 = '';
$xh3 = '';
$sp = mysql_query('SELECT `id`,`login`,`level`,`align`,`clan`,`online` FROM `users` WHERE `host_reg` = "'.$u->info['id'].'" AND `banned` = 0 ORDER BY `timereg` DESC');
while( $pl = mysql_fetch_array($sp) ) {
$x1++;
$clr = 'grey';
if( $pl['online'] > time() - 240 ) {
$clr = 'green';
}
$xh1 .= '<tr><td align="center"><font color="'.$clr.'">'.$u->microLogin($pl,2).'</font></td></tr>';
$sp2 = mysql_query('SELECT `id`,`login`,`level`,`align`,`clan`,`online` FROM `users` WHERE `host_reg` = "'.$pl['id'].'" AND `banned` = 0 ORDER BY `timereg` DESC');
while( $pl2 = mysql_fetch_array($sp2) ) {
$x2++;
$clr = 'grey';
if( $pl2['online'] > time() - 240 ) {
$clr = 'green';
}
$xh2 .= '<tr><td align="center"><font color="'.$clr.'">'.$u->microLogin($pl2,2).'</font></td></tr>';
$sp3 = mysql_query('SELECT `id`,`login`,`level`,`align`,`clan`,`online` FROM `users` WHERE `host_reg` = "'.$pl2['id'].'" AND `banned` = 0 ORDER BY `timereg` DESC');
while( $pl3 = mysql_fetch_array($sp3) ) {
$x3++;
$clr = 'grey';
if( $pl3['online'] > time() - 240 ) {
$clr = 'green';
}
$xh3 .= '<tr><td align="center"><font color="'.$clr.'">'.$u->microLogin($pl3,2).'</font></td></tr>';
}
}
$sp = mysql_query(
'SELECT `id`,`login`,`level`,`align`,`clan`,`online` FROM `users` WHERE `host_reg` = "' . $u->info['id'] . '" AND `banned` = 0 ORDER BY `timereg` DESC'
);
while ($pl = mysql_fetch_array($sp)) {
$x1++;
$clr = 'grey';
if ($pl['online'] > time() - 240) {
$clr = 'green';
}
$xh1 .= '<tr><td align="center"><font color="' . $clr . '">' . $u->microLogin($pl, 2) . '</font></td></tr>';
$sp2 = mysql_query(
'SELECT `id`,`login`,`level`,`align`,`clan`,`online` FROM `users` WHERE `host_reg` = "' . $pl['id'] . '" AND `banned` = 0 ORDER BY `timereg` DESC'
);
while ($pl2 = mysql_fetch_array($sp2)) {
$x2++;
$clr = 'grey';
if ($pl2['online'] > time() - 240) {
$clr = 'green';
}
$xh2 .= '<tr><td align="center"><font color="' . $clr . '">' . $u->microLogin($pl2, 2) . '</font></td></tr>';
$sp3 = mysql_query(
'SELECT `id`,`login`,`level`,`align`,`clan`,`online` FROM `users` WHERE `host_reg` = "' . $pl2['id'] . '" AND `banned` = 0 ORDER BY `timereg` DESC'
);
while ($pl3 = mysql_fetch_array($sp3)) {
$x3++;
$clr = 'grey';
if ($pl3['online'] > time() - 240) {
$clr = 'green';
}
$xh3 .= '<tr><td align="center"><font color="' . $clr . '">' . $u->microLogin(
$pl3, 2
) . '</font></td></tr>';
}
}
}
if( $xh1 == '' ) {
$xh1 = '<tr><td align="center"><font color="grey">У вас нет рефералов</font></td></tr>';
if ($xh1 == '') {
$xh1 = '<tr><td align="center"><font color="grey">У вас нет рефералов</font></td></tr>';
}
$rtg = mysql_fetch_array(mysql_query('SELECT * FROM `ref_mult` WHERE `uid1` = "' . $u->info['id'] . '" LIMIT 1'));
$reflink = $_SERVER['SERVER_NAME'] . DIRECTORY_SEPARATOR . 'r' . $u->info['id'];
?>
<script type="text/javascript">
function show(ele) {
var srcElement = document.getElementById(ele);
if (srcElement != null) {
if (srcElement.style.display == "block") {
srcElement.style.display = 'none';
} else {
srcElement.style.display = 'block';
}
}
}
</script>
<style>
.bordered, .bordered tr, .bordered tr td {
font-family: Times New Roman;
font-size: 14px;
border: 1px solid black;
border-collapse: collapse;
text-align: center;
vertical-align: top;
}
.bordered {
border: 3px solid black;
border-collapse: collapse;
}
.bordered .al {
text-align: left;
}
.bordered .vam {
vertical-align: middle;
}
.bordered .ac {
text-align: center;
}
.bordered .b {
font-weight: bold;
}
.bordered .p {
padding: 0px 5px 0px 5px;
}
.bordered .btop {
border-top: 3px solid black;
border-collapse: collapse;
}
.bordered .bright {
border-right: 3px solid black;
border-collapse: collapse;
}
.bordered .bleft {
border-left: 3px solid black;
border-collapse: collapse;
}
.bordered .bbottom {
border-bottom: 3px solid black;
border-collapse: collapse;
}
.bordered .light {
background: #F4E7CC;
}
.font16, .font16 tr, .font16 tr td {
font-family: Times New Roman;
font-size: 16px;
}
.row {
cursor: pointer;
}
.green {
color: #00CC00;
}
table.data {
width: 620px;
margin: 7px auto 15px;
}
div.tablecaption {
text-align: center;
font-weight: bold;
margin-bottom: 5px;
}
</style>
<div id="hint4" class="ahint"></div>
<table cellspacing="0" cellpadding="2" style="width: 100%; margin-top: 10px; margin-bottom: 10px;">
<tr>
<td style="width: 70%; vertical-align: top; text-align: center;">
<h4 style="font-family: Times New Roman; font-size: 18px">Реферальная Система</h4>
</td>
<td style="width: 27%; vertical-align: top; text-align: right; padding-right: 20px;">
<input type="button" class="btn" value="Обновить" onclick='location="/main.php?referals"'>
<input type="button" class="btn" value="Вернуться" onclick="location.href='/main.php'">
</td>
</tr>
</table>
<p>С помощью реферальной системы Вы можете приводить в игру своих
друзей используя ссылку ниже, и получать за это кредиты.</p>
<p>При каждом пополнении баланса ЕКР Вашим рефералом Вы будете получать <b>10% ЕКР</b> от суммы пополнения реферала.</p>
<p>Ваша ссылка на регистрацию для новых игроков: <b class="green"><?= $reflink ?></b></p>
<?php
if (isset($rtg['id'])) {
echo '<p>Реферал с пересечением IP (разрешены бонусы только за этого реферала): <b style="color: red">' . $u->microLogin(
$rtg['uid2'], 1
) . '</b><br>' .
'<small>(Сменить на другого реферала с одного IP больше нельзя!)</small></p>';
}
?>
<div align="center"><p style="margin: 5px 20px 15px 20px; padding: 0px;"><b>Ваши рефералы (<?=$x1?>)</b></p></div>
<table align="center" cellpadding="2" cellspacing="0" class="bordered ac font16 b" style="width: 620px; margin: 7px auto 15px;">
<?=$xh1?>
<div class="tablecaption">За каждого приведенного в игру реферала, Вы будете получать:</div>
<table cellspacing="0" cellpadding="2" class="bordered ac font16 b data">
<tr class="bbottom">
<td style="width: 16%;" class="bright">
<b>Уровень</b>
</td>
<td style="width: 28%;">
<b>Награда</b>
</td>
</tr>
<tr>
<td class="bright">9</td>
<td class="green">30 ЕКР</td>
<tr>
<td class="bright">10</td>
<td class="green">75 ЕКР</td>
<tr>
<td class="bright">11</td>
<td class="green">150 ЕКР</td>
</table>
<ul>
<li>Разрешено создание не более одного реферала с одного айпи.</li>
<li>Запрещена повторная регистрация одного и того же игрока по реферальной ссылке если он когда-либо уже играл.</li>
<li>Реферальная система предусмотрена ТОЛЬКО ДЛЯ ПРИВЛЕЧЕНИЯ НОВЫХ ИГРОКОВ.</li>
<li>Запрещены просьбы о перерегистрации имеющихся в игре игроков, с целью получения "бесплатного" реферала.</li>
<li>Новые рефералы в любом случае проходят модерацию и при наличии нарушений обнуляются, а ваш аккаунт может получить
наказание за нарушение правил реферальной системы.</li>
<li>Запрещается любая реклама реферальной ссылки внутри игры, в том числе размещение в анкете.</li>
</ul>
<div class="tablecaption">Ваши рефералы (<?= $x1 ?>)</div>
<table align="center" cellpadding="2" cellspacing="0" class="bordered ac font16 b data">
<?= $xh1 ?>
</table>

View File

@ -1,171 +0,0 @@
<?php
if(!defined('GAME') || !isset($_GET['referals']))
{
die();
}
$rfs = array();
$rfs['count'] = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `users` WHERE `host_reg` = "'.$u->info['id'].'" AND `mail` != "No E-Mail" LIMIT 1000'));
$rfs['count'] = 0+$rfs['count'][0];
$rfs['c'] = 1;
$rfs['data'] = explode('|',$u->info['ref_data']);
if(isset($_POST['r_bank']) || isset($_POST['r_type']))
{
$bnk = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `id` = "'.mysql_real_escape_string($_POST['r_bank']).'" AND `uid` = "'.$u->info['id'].'" AND `block` = "0" LIMIT 1'));
if(!isset($bnk['id']))
{
}else{
if($_POST['r_type']==1){ $_POST['r_type'] = 1; }else{ $_POST['r_type'] = 2; }
$u->info['ref_data'] = $bnk['id'].'|'.$_POST['r_type'];
$rfs['data'] = explode('|',$u->info['ref_data']);
mysql_query('UPDATE `stats` SET `ref_data` = "'.mysql_real_escape_string($u->info['ref_data']).'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}
}
$rfs['see'] = '';
$sp = mysql_query('SELECT `s`.`active`,`u`.`online`,`u`.`id`,`u`.`level` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`host_reg` = "'.$u->info['id'].'" AND `u`.`mail` != "No E-Mail" ORDER BY `u`.`level` DESC LIMIT '.$rfs['count']);
while($pl = mysql_fetch_array($sp))
{
$rfs['c2'] = '&nbsp; '.$rfs['c'].'. &nbsp; '.$u->microLogin($pl['id'],1).'';
if($pl['active']!='')
{
$rfs['c2'] = '<font color="grey">'.$rfs['c2'].' &nbsp; <small>не активирован</small></font>';
}elseif($pl['level']>5)
{
$rfs['c2'] = '<font color="green">'.$rfs['c2'].'</font>';
}
if($pl['online'] >time()-520) {
$rfs['c2'] .= '<font color="green"> &nbsp; <small>ONLINE</small></font>';
}
$rfs['see'] .= $rfs['c2'].'<br>';
$rfs['c']++;
}
if($rfs['see']=='')
{
$rfs['see'] = '<b>К сожалению у Вас нет рефералов</b>';
}
?>
<table cellspacing="0" cellpadding="2" width="100%">
<tr>
<td style="vertical-align: top; "><table cellspacing="0" cellpadding="2" width="100%">
<tr>
<td colspan="4" align="center"><h4>Как заработать игровую валюту и реальные деньги в БК:</h4></td>
</tr>
<tr>
<td colspan="4">
<u><font color=#003388><b>Активация подарочных ваучеров</b>:</font></u><br>
<form style="padding:10px;" method="post" action="main.php?referals">
Номер: <input type="text" value="" name="va_num" /> &nbsp; Пароль: <input type="password" name="va_psw" value="" /><button type="submit"><small>Активировать</small></button><br />Ссылка на ваучер: <input style="width:280px" type="text" name="va_url" value="" /><br>
</form>
<small><b>Правила размещения ваучера:</b>
<br />- Ваучер должен быть размещен в социальных сетях, либо других сайтах с подробной информацией по его использованию
<br />- Он должен находиться на указанном адресе не менее суток
<br />- Награду за ваучер возможно получить в течении 24 ч. (Защита от "накрутки")
<br />- Для создания собственного ваучера перейдите по ссылке: <a href="В разработке">В разработке</a>
</small>
<br><br>
<u><font color=#003388><b>Кредиты</b> можно получить:</font></u> <br>
- набирая опыт в боях и поднимаясь по апам и уровням в соответствии с <a href=https://lib.new-combats.com/main/85 target=_blank>Таблицей Опыта</a> (доступно на любом уровне)<br>
- в Пещерах: продав ресурсы в Магазин<br>
- с помощью <b>Реферальной системы</b>, которая описана ниже (доступно на любом уровне)<br>
- лечением и другими магическими услугами (доступно с 4 уровня)<br>
- торговлей (доступно с 4 уровня)<br>
- в Башне Смерти: обналичив у Архивариуса найденный в башне чек (доступно с 1 уровня)<br>
<br><br>
<u><font color=#003388><b>Еврокредиты</b> можно получить:</font></u><br>
- с помощью <b>Реферальной системы</b>, которая описана ниже (доступно на любом уровне)<br>
- купив еврокредиты у официальных дилеров БК<br>
<br>
<br>
<u><font color=#003388><b>Реальные деньги</b> можно получить:</font></u><br>
- с помощью <b>Партнерской программы БК</b>.<br>
<br><br>
<b>Реферальная система</b> - это возможность Вашего <b>дополнительного заработка</b> в игре. При открытии счета в банке, Вы автоматически получаете личную <b>реферальную ссылку</b>, которую можете раздать своим друзьям и знакомым.<br><br>
<b>Каждый персонаж</b>, зарегистрировавшийся в БК по Вашей реферальной ссылке, по достижению им <b>7го</b> уровня начнет приносить Вам <b>дополнительный заработок</b>.<br>
<br>
При достижении Вашим рефералом:<br>
<b>&nbsp;2го</b> уровня - <b>0.50 кр</b>.<br>
<b>&nbsp;4го</b> уровня - <b>1.00 кр</b>.<br>
<b>&nbsp;5го</b> уровня - <b>25.00 кр</b>.<br>
<b>&nbsp;6го</b> уровня - <b>35.00 кр</b>.<br>
<b>&nbsp;7го</b> уровня - <b>75.00 кр</b>.<br>
<b>&nbsp;8го</b> уровня, Вам автоматически будет переведено на счет <b>1 екр</b>.<br>
<b>&nbsp;9го</b> уровня - <b>5 екр</b>.<br>
<b>10го</b> уровня - <b>15 екр</b>.<br>
<b>11го</b> уровня - <b>35 екр</b>.<br>
<b>12го</b> уровня - <b>50 екр</b>.<br>
<p>&nbsp;</p>
<p>Ваша уникальная ссылка
<input style="background-color:#FBFBFB; border:1px solid #EFEFEF; padding:5px;" size="45" value="new-combats.com/register.php?ref=<?=$u->info['id']?>" /> или <input style="background-color:#FBFBFB; border:1px solid #EFEFEF; padding:5px;" size="45" value="new-combats.com/r<?=$u->info['id']?>" />
</p></td>
</tr>
<tr>
<td colspan="4"><p>&nbsp;</p>
<ul>
В реферальной системе отображаются персонажи прошедшие регистрацию
Выплаты производятся по банковскому счету указаному в настройках системы
</ul>
</td>
</tr>
<tr>
<td colspan="4">Количество рефералов: <b><?=$rfs['count']?></b> шт.</td>
</tr>
<tr>
<td colspan="4"><?=$rfs['see']?></td>
</tr>
</table></td>
<td style="width: 5%; vertical-align: top; ">&nbsp;</td>
<td style="width: 30%; vertical-align: top; "><table width="100%" cellpadding="2" cellspacing="0">
<tr>
<td style="width: 25%; vertical-align: top; text-align: right; "><input type='button' value='Обновить' style='width: 75px' onclick='location=&quot;main.php?referals&quot;' />
&nbsp;
<input type="button" value="Вернуться" style='width: 75px' onclick='location=&quot;main.php&quot;' /></td>
</tr>
<tr>
<td align="center"><h4>Настройка реферальной системы</h4></td>
</tr>
<tr>
<td style="text-align:left;"><form method="post" action="main.php?referals"><table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="200">Счет зачисления Екр.:</td>
<td>
<?php $bsees = '';
$sp = mysql_query('SELECT * FROM `bank` WHERE `uid` = "'.$u->info['id'].'" AND `block` = "0" LIMIT 1');
while($pl = mysql_fetch_array($sp))
{
if($rfs['data'][0]==$pl['id'])
{
$bsees .= '<option selected="selected" value="'.$pl['id'].'">№ '.$pl['id'].'</option>';
}else{
$bsees .= '<option value="'.$pl['id'].'">№ '.$pl['id'].'</option>';
}
}
if($bsees != '') {
?>
<select name="r_bank" id="r_bank">
<?php
echo $bsees;
?>
</select>
<?php }else{
echo '<b>Для начала откройте счет в банке на страшилкиной улице.</b>';
}?>
</td>
</tr>
<tr>
<td align="right"><input type="submit" name="button" id="button" value="сохранить изменения" /></td>
<td>&nbsp;</td>
</tr>
</table></form></td>
</tr>
</table></td>
</tr>
</table>

File diff suppressed because it is too large Load Diff

View File

@ -2,34 +2,56 @@
use Core\Config;
use Core\Db;
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . '_incl_data/autoload.php';
use Tournament\Tournament;
use Tournament\TournamentModel;
if (!defined('GAME')) {
die();
}
if (isset($_GET['r'])) {
$_GET['r'] = (int)$_GET['r'];
} else {
$_GET['r'] = null;
}
if ($_GET['r'] == 3 || $_GET['r'] == 8 || !isset($_GET['r'])) {
$_GET['r'] = 2;
}
/** @var User $u */
if ($u->info['inTurnir'] > 0 && $u->info['inUser'] == 0 && $u->info['room'] == 318) {
die('<script>location="main.php";</script>');
}
$zv = new FightRequest();
// Турниры по умолчанию.
// 4-group,5-chaos,6-current,7-ended,10-tournament
$r = (int)$_GET['r'] ??= FightRequest::BATTLE_RAZDEL_TOURNAMENTS;
$js_5356 = sprintf(
"top.lafstReg[%d] = 0; top.startHpRegen(\"main\",%d,%d,%d,%d,%d,%d,%d,%d,%d,1);",
$u->info['id'], $u->info['id'], 0 + $u->stats['hpNow'], 0 + $u->stats['hpAll'],
0 + $u->stats['mpNow'], 0 + $u->stats['mpAll'], time() - $u->info['regHP'], time() - $u->info['regMP'],
0 + $u->rgd[0], 0 + $u->rgd[1]
$u->info['id'],
$u->info['id'],
$u->stats['hpNow'],
$u->stats['hpAll'],
$u->stats['mpNow'],
$u->stats['mpAll'],
time() - $u->info['regHP'],
time() - $u->info['regMP'],
$u->rgd[0],
$u->rgd[1]
);
$code ??= PassGen::intCode();
$userinfo = UserStats::getLoginHpManaBars($u);
$slogin = null;
$dt = null;
$dateformatter = null;
if ($r === FightRequest::BATTLE_RAZDEL_ENDED) {
$dateformatter = new IntlDateFormatter(
'ru_RU',
IntlDateFormatter::LONG,
IntlDateFormatter::NONE
);
$dt = $_GET['logs2'] ??= time();
$slogin = $_GET['filter'] ?? $_POST['filter'] ?? $u->info['login'];
$slogin = str_replace('"', '', $slogin);
$slogin = str_replace("'", '', $slogin);
$slogin = str_replace('\\', '', $slogin);
}
?>
<script type="text/javascript" src="js/jquery.js"></script>
<script>
@ -62,13 +84,95 @@ $js_5356 = sprintf(
.firsttd {
width: 70px;
}
.seehp, .hpborder, .senohp, .senomp, .hp_none, .seemp {
position: absolute;
}
.seehp, .hpborder, .hp_none, .seemp {
width: 120px;
}
.seehp, .hp_none, .seemp {
height: 10px;
}
.hpborder, .senohp, .senomp {
height: 9px;
}
.seehp {
z-index: 12;
}
.hpborder {
z-index: 13;
}
.senohp {
width: <?= $userinfo->hpbarwidth ?>px;
z-index: 11;
}
.senomp {
width: <?= $userinfo->hpbarwidth ?>px;
z-index: 11;
}
.hp_none {
z-index: 10;
}
.seemp {
z-index: 12;
}
.hptop {
top: -10px;
}
.mptop {
top: 0px;
}
</style>
<TABLE class="wfix" cellspacing=1 cellpadding=3>
<TR>
<TD colspan=<?= $u->info['level'] == 0 ? '4' : '6' ?> align=right>
<div style="float:left"><?= $zv->userInfo() ?></div>
<TD colspan=6 align=right>
<div style="float:left">
<table border="0" cellspacing="0" cellpadding="0" height="20">
<tr>
<td valign="middle">&nbsp;<?= $userinfo->login ?>&nbsp;</td>
<td valign="middle" width="120">
<div style="position:relative;<?= $userinfo->divstyle ?>">
<div id="vhp$uid" title="Уровень жизни"
class="seehp hptop"><?= $userinfo->hpbartext ?></div>
<div title="Уровень жизни" class="hpborder hptop">
<img src="//img.new-combats.tech/1x1.gif" height="9" width="1" alt="">
</div>
<div class="hp_3 senohp hptop" id="lhp$uid">
<img src="//img.new-combats.tech/1x1.gif" height="9" width="1">
</div>
<div title="Уровень жизни" class="hp_none hptop">
<img src="//img.new-combats.tech/1x1.gif" height="10">
</div>
<?php if ($userinfo->hasmana): ?>
<div id="vmp$uid" title="Уровень маны"
class="seemp mptop"><?= $userinfo->mpbartext ?></div>
<div title="Уровень маны" class="hpborder mptop">
<img src="//img.new-combats.tech/1x1.gif" height="9" width="1" alt="">
</div>
<div class="hp_mp senomp mptop" id="lmp$uid">
<img src="//img.new-combats.tech/1x1.gif" height="9" width="1" alt="">
</div>
<div title="Уровень маны" class="hp_none mptop"></div>
<?php endif; ?>
</div>
</td>
</tr>
</table>
</div>
<div style="float:right;">
<INPUT class="btn" onClick="location='main.php?zayvka&r=<?= $_GET['r'] ?>&rnd=<?= $code ?>';"
<INPUT class="btn" onClick="location='main.php?zayvka&r=<?= $r ?>&rnd=<?= $code ?>';"
TYPE=button name=tmp value="Обновить">
<INPUT class="btn" TYPE=button value="Вернуться" onClick="location.href='main.php?rnd=<?= $code ?>';">
</div>
@ -76,85 +180,69 @@ $js_5356 = sprintf(
</tr>
<tr>
<td class="firsttd m">&nbsp;<b>Бои:</b>&nbsp;</td>
<?php if ($u->info['level'] == 0): ?>
<td class="<?= $_GET['r'] == 1 ? 's' : 'm' ?>"><a href="main.php?zayvka=1&r=1&rnd=<?= $code ?>">Новички</a>
</td>
<?php else: ?>
<td class="<?= $_GET['r'] == 2 ? 's' : 'm' ?>"><a href="main.php?zayvka=1&r=2&rnd=<?= $code ?>">Турниры</a>
</td>
<td class="<?= $_GET['r'] == 4 ? 's' : 'm' ?>"><a
href="main.php?zayvka=1&r=4&rnd=<?= $code ?>">Групповые</a></td>
<td class="<?= $_GET['r'] == 5 ? 's' : 'm' ?>"><a
href="main.php?zayvka=1&r=5&rnd=<?= $code ?>">Хаотичные</a></td>
<?php endif; ?>
<td class="<?= $_GET['r'] == 6 ? 's' : 'm' ?>"><a href="main.php?zayvka=1&r=6&rnd=<?= $code ?>">Текущие</a></td>
<td class="<?= $_GET['r'] == 7 ? 's' : 'm' ?>"><a href="main.php?zayvka=1&r=7&rnd=<?= $code ?>">Завершенные</a>
<td class="<?= $r == FightRequest::BATTLE_RAZDEL_TOURNAMENTS ? 's' : 'm' ?>">
<a href="/main.php?zayvka=1&r=<?= FightRequest::BATTLE_RAZDEL_TOURNAMENTS ?>&rnd=<?= $code ?>">Турниры</a>
</td>
<td class="<?= $r == FightRequest::BATTLE_RAZDEL_GROUP ? 's' : 'm' ?>">
<a href="main.php?zayvka=1&r=<?= FightRequest::BATTLE_RAZDEL_GROUP ?>&rnd=<?= $code ?>">Групповые</a>
</td>
<td class="<?= $r == FightRequest::BATTLE_RAZDEL_CHAOTIC ? 's' : 'm' ?>">
<a href="main.php?zayvka=1&r=<?= FightRequest::BATTLE_RAZDEL_CHAOTIC ?>&rnd=<?= $code ?>">Хаотичные</a>
</td>
<td class="<?= $r == FightRequest::BATTLE_RAZDEL_CURRENT ? 's' : 'm' ?>">
<a href="/main.php?zayvka=1&r=<?= FightRequest::BATTLE_RAZDEL_CURRENT ?>&rnd=<?= $code ?>">Текущие</a>
</td>
<td class="<?= $r == FightRequest::BATTLE_RAZDEL_ENDED ? 's' : 'm' ?>">
<a href="/main.php?zayvka=1&r=<?= FightRequest::BATTLE_RAZDEL_ENDED ?>&rnd=<?= $code ?>">Завершенные</a>
</td>
</tr>
</table>
<script>
function console_clonelogin() {
var s = prompt("Введите логин персонажа с которым хотите сразиться:", "");
if ((s !== null) && (s !== '')) {
location.href = "main.php?zayvka=1&r=2&bot_clone=" + s + "&rnd=1";
}
}
</script>
<div style="padding:2px;">
<?php
$zi = false;
$zi = [];
if ($u->info['battle'] == 0) {
if (isset($_POST['add_new_zv'])) {
$zv->add();
} elseif (isset($_GET['bot']) && ($u->info['level'] <= 7 || $u->info['admin'] > 0)) {
$zv->addBot();
} elseif (isset($_GET['bot_clone'])) {
$zvclone = Db::getValue(
'select id from users where admin = 0 and `real` = 1 and login = ?',
[$_GET['bot_clone']]
);
$zv->addBotClone($zvclone['id']);
} elseif (isset($_GET['add_group'])) {
$zv->add();
} elseif (isset($_GET['start_haot'])) {
$zv->add();
}
if (
$u->info['battle'] == 0 &&
(isset($_GET['add_group']) || isset($_GET['start_haot']))
) {
$zv->addGroupOrChaoticRequest($r);
}
if ($u->info['zv'] != 0) {
$zi = mysql_fetch_array(
mysql_query(
'SELECT * FROM `zayvki` WHERE `id`=' . $u->info['zv'] . ' AND `start` = 0 AND `cancel` = 0 AND
(`time` > unix_timestamp() - 60 * 60 * 2 OR `razdel` > 3)'
)
//fixme результаты этого запроса используются в методах класса FightRequest как global $zi.
$zi = Db::getRow(
'select * from zayvki where id = ? and start = 0 and cancel = 0 and time > unix_timestamp() - 60 * 60 * 2 or razdel > 3',
[$u->info['zv']]
);
if (!isset($zi['id'])) {
$zi = false;
$zi = [];
$u->info['zv'] = 0;
mysql_query('UPDATE `stats` SET `zv` = 0 WHERE `id` = ' . $u->info['id']);
Db::sql('update stats set zv = 0 where id = ?', [$u->info['id']]);
}
}
if ($u->info['battle'] == 0) {
if (isset($_POST['groupClick']) && !isset($zi['id'])) {
$zg = mysql_fetch_array(
mysql_query(
'SELECT * FROM `zayvki` WHERE `id` = ' . (int)$_POST['groupClick'] . ' AND `cancel` = 0 AND
`btl_id` = 0 AND `razdel` = 4 AND `start` = 0 AND `time` > unix_timestamp() - 60 * 60 * 2')
$zg = Db::getRow(
'select * from zayvki where id = ? and start = 0 and cancel = 0 and time > unix_timestamp() - 60 * 60 * 2 and btl_id = 0 and razdel = 4',
[(int)$_POST['groupClick']]
);
if (!isset($zg['id'])) {
echo '<center><br /><br />Заявка на групповой бой не найдена.</center>';
echo '<div style="text-align: center;"><br><br>Заявка на групповой бой не найдена.</div>';
} else {
$tm_start = floor(($zg['time'] + $zg['time_start'] - time()) / 6) / 10;
$tm_start = $zv->rzv($tm_start);
$tm1 = '';
$tm2 = '';
$users = mysql_query(
'SELECT `u`.`id`, `u`.`login`, `u`.`level`, `u`.`align`, `u`.`clan`, `u`.`admin`, `st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `u`.`id` = `st`.`id` WHERE `st`.`zv` = "' . $zg['id'] . '"'
$tm3 = '';
$users = Db::getRow(
'select users.id, login, level, align, clan, admin, team from users left join stats on users.id = stats.id where zv = ?',
[$zg['id']]
);
while ($s = mysql_fetch_array($users)) {
${'tm' . $s['team']} .= '<b>' . $s['login'] . '</b> [' . $s['level'] . ']<a href="info/' . $s['id'] . '" target="_blank"><img src="//img.new-combats.tech/i/inf_capitalcity.gif" title="Инф. о ' . $s['login'] . '" /></a><br />';
foreach ($users as $user) {
${'tm' . $user['team']} .= '<b>' . $user['login'] . '</b> [' . $user['level'] . ']<a href="info/' . $user['id'] . '" target="_blank"><img src="//' . Config::get(
'img'
) . '/i/inf_capitalcity.gif" title="Инф. о ' . $user['login'] . '" alt="inf"></a><br>';
}
if (empty($tm1)) {
$tm1 = 'группа пока не набрана';
@ -186,15 +274,16 @@ $js_5356 = sprintf(
$sv3 = $zg['tm2max'] - $sv3;
}
?></div>
?>
</div>
<table style="margin-top:2px;" width="100%">
<tr>
<td> Бой начнется через <?= $tm_start; ?> мин.</td>
<td align="right">
<INPUT class="btn" onClick="location='main.php?zayvka&r=<?= $_GET['r']; ?>&rnd=<?= $code; ?>';"
<INPUT class="btn" onClick="location='main.php?zayvka&r=<?= $r; ?>&rnd=<?= $code; ?>';"
TYPE=button name=tmp value="Обновить">
<input class="btn" type="button" value="Вернуться"
onclick="location.href='main.php?zayvka&r=<?= $_GET['r']; ?>&rnd=<?= $code; ?>';">
onclick="location.href='main.php?zayvka&r=<?= $r; ?>&rnd=<?= $code; ?>';">
</td>
</tr>
</table>
@ -237,12 +326,12 @@ $js_5356 = sprintf(
<tr>
<td align="center">
<input class="btn" title="На данный момент свободно мест: <?= $sv1 ?>"
onclick="location='main.php?r=<?= $_GET['r'] ?>&zayvka&btl_go=<?= $zg['id'] ?>&tm1=<?= $code ?>'"
onclick="location='main.php?r=<?= $r ?>&zayvka&btl_go=<?= $zg['id'] ?>&tm1=<?= $code ?>'"
type="submit" name="confirm1" value="Я за этих!"/>
</td>
<td align="center">
<input class="btn" title="На данный момент свободно мест: <?= $sv2 ?>"
onclick="location='main.php?r=<?= $_GET['r'] ?>&zayvka&btl_go=<?= $zg['id'] ?>&tm2=<?= $code ?>'"
onclick="location='main.php?r=<?= $r ?>&zayvka&btl_go=<?= $zg['id'] ?>&tm2=<?= $code ?>'"
type="submit" name="confirm2" value="Я за этих!"/>
</td>
<?php
@ -250,7 +339,7 @@ $js_5356 = sprintf(
?>
<td align="center">
<input class="btn" title="На данный момент свободно мест: <?= $sv3 ?>"
onclick="location='main.php?r=<?= $_GET['r'] ?>&zayvka&btl_go=<?= $zg['id'] ?>&tm3=<?= $code ?>'"
onclick="location='main.php?r=<?= $r ?>&zayvka&btl_go=<?= $zg['id'] ?>&tm3=<?= $code ?>'"
type="submit" name="confirm3" value="Я за этих!"/>
</td>
<?php
@ -260,35 +349,218 @@ $js_5356 = sprintf(
</table>
<?php
}
} elseif (isset($_GET['cancelzv']) && !isset($_POST['add_new_zv'])) {
$zv->cancelzv();
} elseif (isset($_GET['startBattle']) && isset($zi['id']) && ($zi['razdel'] >= 1 || $zi['razdel'] <= 3)) {
} elseif (isset($_GET['startBattle']) && isset($zi['id']) && ($zi['razdel'] >= 1 && $zi['razdel'] <= 3)) {
$zv->startBattle($zi['id']);
}
}
if (isset($_POST['btl_go'])) {
$zv->go($_POST['btl_go']);
} elseif (isset($_GET['btl_go'])) {
$zv->go($_GET['btl_go']);
$btl_go = (int)$_POST['btl_go'] ?? (int)$_GET['btl_go'] ?? 0;
$zv->go($btl_go);
if ($zv->error) {
echo '<b style="color: red">' . $zv->error . '</b><br>';
}
if ($zv->error != '') {
echo '<b style="color: red">' . $zv->error . '</b><br />';
}
if ($zv->test_s != '') {
echo '<b style="color: red">' . $zv->test_s . '</b><br />';
}
?>
<table style="padding:2px;" width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td><?php $zv->see(); ?></td>
<td>
<?php if ($r === FightRequest::BATTLE_RAZDEL_GROUP && $u->room['zvsee'] == 0): ?>
<span id="hidezv1_btn"><INPUT class="btn" onClick="openfizrmk();" TYPE=button name=tmp
value="Подать заявку на групповой бой" style="margin:3px;"></span>
<FIELDSET id="hidezv1" style="display:none; border-color:#FFF; width:500px;">
<LEGEND><B style="color:#8f0000">Подать заявку на групповой бой</B></LEGEND>
<form method="post" action="/main.php?zayvka&r=<?= $r ?>&add_group&rnd=<?= $code ?>">
<table>
<tr>
<td>
Начало боя через
<select style="padding:2px;" name="startime">
<option value="300" selected>5 минут</option>
<option value="600">10 минут</option>
</select>
&nbsp;&nbsp;&nbsp;&nbsp;Таймаут
<select style="padding:2px;" name="timeout">
<option value="1" selected>1 мин.</option>
<option value="2">2 мин.</option>
<option value="3">3 мин.</option>
</select>
<br/>
Ваша команда
<input style="padding:2px;" type="text" name="nlogin1" size="3" maxlength="2"/>
игроков
<select style="padding:2px;" name="levellogin1">
<option value="0">любой</option>
<option value="1">только моего и ниже</option>
<option value="2">только ниже моего уровня</option>
<option value="3" selected>только моего уровня</option>
<option value="4">не старше меня более чем на уровень</option>
<option value="5">не младше меня более чем на уровень</option>
<option value="6">мой уровень +/- 1</option>
<option value="99">мой клан</option>
<option value="98">моя склонность</option>
</select>
<br>
Противники &nbsp;
<input style="padding:2px;" type="text" name="nlogin2" size="3" maxlength="2"/>
игроков
<select style="padding:2px;" name="levellogin2">
<option value="0">любой</option>
<option value="1">только моего и ниже</option>
<option value="2">только ниже моего уровня</option>
<option value="3" selected>только моего уровня</option>
<option value="4">не старше меня более чем на уровень</option>
<option value="5">не младше меня более чем на уровень</option>
<option value="6">мой уровень +/- 1</option>
<option value="99">только клан</option>
<option value="98">только склонность</option>
</select>
<br/>
<input type="checkbox" name="travma">
<label for="travma">Бой без правил <span class="dsc">(проигравшая сторона
получает инвалидность)</span></label><br>
<INPUT maxLength="40" size="40" name="cmt" placeholder="Комментарий к бою"><BR>
</td>
</tr>
<tr>
<td align="left">
<input class="btn" type="submit" value="Подать заявку" name="open">
</td>
</tr>
</table>
</form>
</FIELDSET>
<?php elseif ($r === FightRequest::BATTLE_RAZDEL_CHAOTIC && $u->room['zvsee'] == 0): ?>
<div id="hidezv1_btn">
<INPUT class="btn" onClick="openfizrmk();" TYPE=button name=tmp
value="Подать заявку на хаотичный бой" style="margin:3px;">
</div>
<form method="post" action="/main.php?zayvka&r=<?= $r ?>&add_group&rnd=<?= $code ?>">
<input type="hidden" name="timeout" value="1">
<div style="display:none; width:600px;" id="hidezv1">
<br>
<FIELDSET style="border-color:#FFF;">
<LEGEND><strong style="color:#8f0000">Подать заявку на хаотичный бой</strong></LEGEND>
Начало боя через
<SELECT name="startime2">
<option value="60" selected>1 минута
<OPTION value="180">3 минуты
<OPTION value="300">5 минут
</SELECT>
Игроков
<SELECT name="players">
<OPTION selected value="6">6</OPTION>
<OPTION value="8">8</OPTION>
<OPTION value="10">10</OPTION>
<OPTION value="12">12</OPTION>
</SELECT>
<BR>
Уровни бойцов
<SELECT name="levellogin1">
<OPTION value="0">любой
<OPTION selected value="3">только моего уровня
<OPTION value="6">мой уровень +/- 1</OPTION>
</SELECT>
<BR><BR>
<INPUT type="checkbox" name="travma">
Бой без правил <span
style="color: #777; ">(проигравшая сторона получает инвалидность)</span><BR>
<INPUT type="checkbox" name="noatack"> Закрытый поединок <span style="color: #777; ">(бой будет изолирован от нападений)</span><BR>
<INPUT type="checkbox" name="noeff">
Запрет на использование свитков восстановления НР и Маны<BR>
<?php if (!$u->info['no_zv_key']): ?>
<img src="/show_reg_img/security2.php?id=<?= time() ?>" width="70" height="20">
Код подтверждения: <input style="width:40px;" type="text" name="code21">'
<?php endif; ?>
<INPUT maxLength="40" size="40" name="cmt" placeholder="Комментарий к бою"><BR>
<INPUT class="btn" value="Подать заявку" type="submit" name="open">
</FIELDSET>
</div>
</form>
<?php elseif ($r === FightRequest::BATTLE_RAZDEL_CURRENT): ?>
<h3>Записи текущих боев на <?= date('d.m.Y'); ?></h3>
<?php $zv->getCurrentBattlesList(); ?>
<?php elseif ($r === FightRequest::BATTLE_RAZDEL_ENDED): ?>
<TABLE width=100% cellspacing=0 cellpadding=0>
<TR>
<TD valign=top>
&nbsp;
<A HREF="?filter=<?= $slogin ?>&zayvka=1&r=7&logs2=<?= $dt - 86400 ?>">« Предыдущий день</A>
</TD>
<TD valign=top align=center>
<H3>Записи о завершенных боях за <?= $dateformatter->format($dt) ?></H3>
</TD>
<TD valign=top align=right>
<A HREF="?filter=<?= $slogin ?>&zayvka=1&r=7&logs2=<?= $dt + 86400 ?>">Следующий день »</A>
&nbsp;
</TD>
</TR>
<TR>
<TD colspan=3 align=center>
<form method="POST" action="main.php?zayvka=1&r=7&rnd=<?= $code ?>">
Показать только бои персонажа:
<INPUT TYPE=text NAME=filter value="<?= $slogin ?>"> за
<INPUT TYPE=text NAME=logs size=12 value="<?= date('d.m.Y', $dt) ?>">
<INPUT class="btn" TYPE=submit value="фильтр!">
</form>
</TD>
</TR>
</TABLE>
<?php $zv->getEndedBattlesList($slogin, $dt); ?>
<?php elseif ($r === FightRequest::BATTLE_RAZDEL_TOURNAMENTS): ?>
<?php if (Tournament::IS_ENABLED): ?>
<div>
<strong style="color: red;">Внимание!</strong>
<ul>
<li style="color: blue;">В случае создания либо присоединения к Турниру, покинуть его -
<u>невозможно</u>!
</li>
<?php if (TournamentModel::isEkrOverpriced($u->info['id'])): ?>
<li>Стоимость предметов, одетых на вас не должна
превышать <?= Tournament::ekrOverpriceFormula($u->info['level']) ?> еврокредитов.
</li>
<?php endif; ?>
<?php if ($u->info['exp'] < Tournament::MIN_EXP): ?>
<li>У вас должно быть не менее <?= Tournament::MIN_EXP ?> опыта.</li>
<?php endif; ?>
<li style="color: blue;">Турнир начнётся, когда в заявке
наберётся <?= Tournament::START_TOURNAMENT ?> человек.
</li>
<li style="color: blue;">Игроки занявшие 1, 2 и 3 места получат 25, 15, 5 Реликвий
Ангела, а так же задержки на участие в турнире 12 часов, 6 и 3 часа соответственно!
</li>
</ul>
</div>
<?php $trn = $zv->getTournaments(); ?>
<?php if ($trn->hasTournaments): ?>
<div>
<strong>Активные турниры.</strong><br>
<?= $trn->listTournaments ?>
</div>
<?php endif; ?>
<?php if (!TournamentModel::getTournamentIdByUserId(
$this->u->info['id']
) || !TournamentModel::isStarted($this->u->info['level'])): ?>
<form method="post">
<input type="submit" name="tournament_start" value="Принять участие в турнире">
<input type="hidden" name="key" value="<?= $_SESSION['bypass'] ?>">
</form>
<?php else: ?>
Вы учавствуете.
<?php endif; ?>
<?php else: ?>
<div style="font-weight: bold; color: firebrick;">В данный момент турниры не проводятся!</div>
<?php endif; ?>
<?php else: ?>
nan
<?php endif; ?>
<?php $zv->getCurrentStatus($zi, $r); ?>
</td>
</tr>
<tr>
<td><?php $zv->seeZv(); ?></td>
<td><?php $zv->seeZv($zi, $r); ?></td>
</tr>
</table><br/>
<div style="text-align: right">
</table>
<div style="text-align: right; margin-top: 5px;">
<?= Config::get('counters') ?>
</div>

View File

@ -1,64 +0,0 @@
<?php
echo "
<script language='JavaScript'>
var elem = document.getElementById('se-pre-con');
elem.parentNode.removeChild(elem);
</script>
";
if(!defined('GAME'))
{
die();
}
if(isset($_GET['r']))
{
$_GET['r'] = (int)$_GET['r'];
}else{
$_GET['r'] = NULL;
}
$u->info['referals'] = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `register_code` WHERE `uid` = "'.$u->info['id'].'" AND `time_finish` > 0 AND `end` = 0 LIMIT 1000'));
$u->info['referals'] = $u->info['referals'][0];
$zv = new FightRequest();
?>
<script> var zv_Priem = 0; </script>
<style>
.m {background: #d2d2d2;text-align: center;}
.s {background: #b4b4b4;text-align: center;}
</style>
<TABLE width=100% cellspacing=1 cellpadding=3>
<TR><TD colspan=8 align=right>
<div style="float:left">
<?php
echo ' &nbsp; &nbsp; <b style="color:grey">(Удаленный просмотр)</b>';
?>
</div>
<div style="float:right">
<INPUT TYPE=button value="Вернуться" onClick="location.href='main.php?rnd=<?= $code; ?>';">
</div>
</TD></TR>
<TR>
<TD class=m width=40>&nbsp;<B>Бои:</B></TD>
<TD width="15%" class="<?php if($_GET['r']==1){ echo 's'; }else{ echo 'm'; } ?>"><A HREF="main.php?zayvka=1&r=1&rnd=<?= $code; ?>">Новички</A></TD>
<TD width="15%" class="<?php if($_GET['r']==2){ echo 's'; }else{ echo 'm'; } ?>"><A HREF="main.php?zayvka=1&r=2&rnd=<?= $code; ?>">Физические</A></TD>
<TD width="14%" class="<?php if($_GET['r']==3){ echo 's'; }else{ echo 'm'; } ?>"><A HREF="main.php?zayvka=1&r=3&rnd=<?= $code; ?>">Договорные</A></TD>
<TD width="14%" class="<?php if($_GET['r']==4){ echo 's'; }else{ echo 'm'; } ?>"><A HREF="main.php?zayvka=1&r=4&rnd=<?= $code; ?>">Групповые</A></TD>
<TD width="14%" class="<?php if($_GET['r']==5){ echo 's'; }else{ echo 'm'; } ?>"><A HREF="main.php?zayvka=1&r=5&rnd=<?= $code; ?>">Хаотичные</A></TD>
<TD width="14%" class="<?php if($_GET['r']==6){ echo 's'; }else{ echo 'm'; } ?>"><A HREF="main.php?zayvka=1&r=6&rnd=<?= $code; ?>">Текущие</A></TD>
<TD width="14%" class="<?php if($_GET['r']==7){ echo 's'; }else{ echo 'm'; } ?>"><A HREF="main.php?zayvka=1&r=7&rnd=<?= $code; ?>">Завершенные</A></TD>
</TR></TR></TABLE>
<table style="padding:2px;" width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td><?= $zv->see(); ?></td>
</tr>
<tr>
<td><?php $zv->seeZv(); ?></td>
</tr>
</table><br />
<DIV align="right">
<?php
echo $c['counters'];
?>
</DIV>

View File

@ -1,587 +1,267 @@
<?php
echo "
<script language='JavaScript'>
var elem = document.getElementById('se-pre-con');
elem.parentNode.removeChild(elem);
</script>
";
if(!defined('GAME'))
use Core\Config;
use Core\Db;
echo "
<script>
var elem = document.getElementById('se-pre-con');
elem.parentNode.removeChild(elem);
</script>
";
if (!defined('GAME')) {
die();
}
/** @var User $u */
if (
$u->info['room'] == 214 ||
$u->info['room'] == 217 ||
$u->info['room'] == 218 ||
$u->info['room'] == 219 ||
$u->info['battle'] > 0
) {
header('Location:main.php');
die();
}
$currentEffectList = '';
$effNow = Db::getColumn(
'select img from eff_main where id2 in (select id_eff from eff_users where uid = ? and `delete` = 0)',
[$u->info['id']]
);
foreach ($effNow as $eff) {
$img = Config::get('img') . '/i/eff/' . $eff;
$currentEffectList .= "<img src='//$img' alt='$eff'>";
}
function useItem($int): string
{
die();
global $u;
global $magic;
$items = [
1 => ['cost' => 10, 'id' => 4941, 'name' => 'Защита от магии',],
['cost' => 10, 'id' => 4942, 'name' => 'Магическое усиление',],
['cost' => 10, 'id' => 994, 'name' => 'Сокрушение',],
['cost' => 10, 'id' => 1001, 'name' => 'Защита от оружия',],
['cost' => 10, 'id' => 1460, 'name' => 'Холодный разум',],
['cost' => 12.50, 'id' => 3102, 'name' => 'Жажда Жизни +5',],
['cost' => 1, 'id' => 2418, 'name' => 'Эликсир Восстановления',],
['cost' => 1, 'id' => 3140, 'name' => 'Эликсир потока',],
['cost' => 5, 'id' => 4736, 'name' => 'Эликсир Жизни',],
['cost' => 5, 'id' => 4737, 'name' => 'Эликсир Маны',],
['cost' => 10, 'id' => 870, 'name' => 'Зелье Могущества',],
['cost' => 10, 'id' => 872, 'name' => 'Зелье Стремительности',],
['cost' => 10, 'id' => 871, 'name' => 'Зелье Прозрения',],
['cost' => 10, 'id' => 873, 'name' => 'Зелье Разума',],
['cost' => 25, 'id' => 2139, 'name' => 'Нектар Неуязвимости',],
['cost' => 25, 'id' => 2140, 'name' => 'Нектар Отрицания',],
17 => ['cost' => 0.5, 'id' => 3101, 'name' => 'Жажда Жизни +6',], // екровещи
['cost' => 0.99, 'id' => 1463, 'name' => 'Звездное Сияние',],
['cost' => 0.4, 'id' => 4037, 'name' => 'Нектар Великана',],
['cost' => 0.4, 'id' => 4040, 'name' => 'Нектар Змеи',],
['cost' => 0.4, 'id' => 4038, 'name' => 'Нектар Предчувствия',],
['cost' => 0.4, 'id' => 4039, 'name' => 'Нектар Разума',],
['cost' => 2.99, 'id' => 5110, 'name' => 'Эликсир Магического Искусства',],
['cost' => 2.99, 'id' => 5109, 'name' => 'Снадобье Забытых Мастеров',],
['cost' => 4.99, 'id' => 5069, 'name' => 'Амброзия Скучающих Владык',],
30 => ['cost' => 1, 'id' => 6455, 'name' => 'Защита от нападения [30]',],
];
$moneyType = 'money';
if ($int > 16) {
$moneyType = 'money2';
}
if ($u->info[$moneyType] < $items[$int]['cost']) {
return 'Недостаточно денег!';
}
$additm = $u->addItem($items[$int]['id'], $u->info['id']);
if (empty($additm)) {
return 'Что-то пошло не так, каст не сработал...';
}
$u->info[$moneyType] -= $items[$int]['cost'];
$magic->useItems($additm);
$query = "update users set $moneyType = ? where id = ?";
Db::sql($query, [$u->info['money'], $u->info['id']]);
Db::sql('delete from items_users where id = ?', [$additm]);
return 'Вы использовали &quot;' . $items[$int]['name'] . '&quot;.';
}
if($u->info['room'] == 214 || $u->info['room'] == 217 || $u->info['room'] == 218 || $u->info['room'] == 219 || $u->info['battle'] > 0 ) {
header('Location:main.php');
$msg = '';
if (isset($_GET['1'])) {
$msg = useItem(1);
} elseif (isset($_GET['2'])) {
$msg = useItem(2);
} elseif (isset($_GET['3'])) {
$msg = useItem(3);
} elseif (isset($_GET['4'])) {
$msg = useItem(4);
} elseif (isset($_GET['5'])) {
$msg = useItem(5);
} elseif (isset($_GET['6'])) {
$msg = useItem(6);
} elseif (isset($_GET['7'])) {
$msg = useItem(7);
} elseif (isset($_GET['8'])) {
$msg = useItem(8);
} elseif (isset($_GET['9'])) {
$msg = useItem(9);
} elseif (isset($_GET['10'])) {
$msg = useItem(10);
} elseif (isset($_GET['11'])) {
$msg = useItem(11);
} elseif (isset($_GET['12'])) {
$msg = useItem(12);
} elseif (isset($_GET['13'])) {
$msg = useItem(13);
} elseif (isset($_GET['14'])) {
$msg = useItem(14);
} elseif (isset($_GET['15'])) {
$msg = useItem(15);
} elseif (isset($_GET['16'])) {
$msg = useItem(16);
} elseif (isset($_GET['17'])) {
$msg = useItem(17);
} elseif (isset($_GET['18'])) {
$msg = useItem(18);
} elseif (isset($_GET['19'])) {
$msg = useItem(19);
} elseif (isset($_GET['20'])) {
$msg = useItem(20);
} elseif (isset($_GET['21'])) {
$msg = useItem(21);
} elseif (isset($_GET['22'])) {
$msg = useItem(22);
} elseif (isset($_GET['23'])) {
$msg = useItem(23);
} elseif (isset($_GET['24'])) {
$msg = useItem(24);
} elseif (isset($_GET['25'])) {
$msg = useItem(25);
} elseif (isset($_GET['30'])) {
$msg = useItem(30);
}
?>
<center><h3>Купить временные усиления</h3><br>
<input class="btn btn-success" onClick="location.href='/main.php?add_eff';" type="button" value="Обновить">
<input class="btn btn-success" onClick="location.href='/main.php';" type="button" value="Вернуться"><br>
</center><br>
<fieldset style="border: 1px solid black;-webkit-border-radius: 50px;-moz-border-radius: 50px;border-radius: 50px;">
<center>&nbsp;<b>Деньги: <font color=green><?=$u->info['money']?></font> кр.<br>&nbsp;Деньги:<font color=green> <?=$u->info['money2']?></font> екр.</b><br>
<b>Текущие эффекты:<b><br>
<?php
$eff = mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0');
while($now = mysql_fetch_array($eff)) {
$ef = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "'.$now['id_eff'].'" LIMIT 1'));
echo '<img src="https://'.$c['img'].'/i/eff/'.$ef['img'].'">';
}
?>
<hr><h3>Усиления за кредиты:</h3><hr>
<b>Заклинания:</b></center><hr><center>
<?php
if( isset($_GET['1'])) {
$p = 10;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(4941,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 10;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Защита от магии</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['2'])) {
$p = 10;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(4942,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 10;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Магическое усиление</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['3'])) {
$p = 10;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(994,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 10;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Сокрушение</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['4'])) {
$p = 10;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(1001,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 10;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Защита от оружия</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['5'])) {
$p = 10;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(1460,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 10;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Холодный разум</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['6'])) {
$p = 12.50;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(3102,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 12.50;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Жажда Жизни +5</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['7'])) {
$p = 1;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(2418,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 1;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Эликсир Восстановления</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['8'])) {
$p = 1;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(3140,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 1;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Эликсир потока</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['9'])) {
$p = 0.50;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(4736,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 5;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Эликсир Жизни</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['10'])) {
$p = 1;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(4737,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 5;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Эликсир Маны</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['11'])) {
$p = 1;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(870,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 10;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Зелье Могущества</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['12'])) {
$p = 1;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(872,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 10;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Зелье Стремительности</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['13'])) {
$p = 1;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(871,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 10;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Зелье Прозрения</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['14'])) {
$p = 1;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(873,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 10;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Зелье Разума</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['15'])) {
$p = 10;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(2139,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 25;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Нектар Неуязвимости</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['16'])) {
$p = 10;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(2140,$u->info['id']);
if( $additm > 0 ) {
$u->info['money'] -= 25;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Нектар Отрицания</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['17'])) {
$p = 0.5;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money2'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(3101,$u->info['id']);
if( $additm > 0 ) {
$u->info['money2'] -= 0.5;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Жажда Жизни +6</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['18'])) {
$p = 0.99;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money2'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(1463,$u->info['id']);
if( $additm > 0 ) {
$u->info['money2'] -= 0.99;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Звездное Сияние</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['19'])) {
$p = 0.4;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money2'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(4037,$u->info['id']);
if( $additm > 0 ) {
$u->info['money2'] -= 0.4;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Нектар Великана</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['20'])) {
$p = 0.4;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money2'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(4040,$u->info['id']);
if( $additm > 0 ) {
$u->info['money2'] -= 0.4;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Нектар Змеи</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['21'])) {
$p = 0.4;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money2'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(4038,$u->info['id']);
if( $additm > 0 ) {
$u->info['money2'] -= 0.4;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Нектар Предчувствия</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['22'])) {
$p = 0.4;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money2'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(4039,$u->info['id']);
if( $additm > 0 ) {
$u->info['money2'] -= 0.4;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Нектар Разума</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['23'])) {
$p = 2.99;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money2'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(5110,$u->info['id']);
if( $additm > 0 ) {
$u->info['money2'] -= 2.99;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Эликсир Магического Искусства</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['24'])) {
$p = 2.99;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money2'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(5109,$u->info['id']);
if( $additm > 0 ) {
$u->info['money2'] -= 2.99;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Снадобье Забытых Мастеров</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}elseif( isset($_GET['25'])) {
$p = 4.99;
if($u->info['battle'] > 0) {
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money2'] < $p) {
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}else{
$additm = $u->addItem(5069,$u->info['id']);
if( $additm > 0 ) {
$u->info['money2'] -= 4.99;
$_GET['login'] = $u->info['login']; //на кого кастуем
$magic->useItems($additm);
unset($_GET['login']);
Mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$additm.'" LIMIT 1');
echo '<font color=red><b>Вы использовали &quot;<b>Амброзия Скучающих Владык</b>&quot;.</font></b><br>';
}else{
echo 'Что-то пошло не так, каст не сработал...';
}
}
}
elseif(isset($_GET['30']))
{
$p = 1;
if($u->info['battle'] > 0)
{
echo '<font color=red><b>Вы в поединке!<br></font></b>';
}elseif($u->info['money2'] < $p)
{
echo '<font color=red><b>Недостаточно денег :)<br></font></b>';
}
else
{
$u->info['money2'] -= $p;
Mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","479","112","'.$u->info['id'].'","Защита от нападения","zashitatk=1","'.(time()+290).'")');
echo '<font color=red><b>Вы использовали &quot;<b>Защиту от нападения</b>&quot;.</font></b><br>';
}
}
echo '<img onclick="location.href=\'/main.php?add_eff&1\';" onMouseOver="top.hi(this,\'<b>Защита от магии<hr>Цена: 10 кредитов<hr>Увеличивает защиту от магии на 100 едениц, продолжительностью 3 часа.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/magearmor.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&2\';" onMouseOver="top.hi(this,\'<b>Магическое усиление<hr>Цена: 10 кредитов<hr>Увеличивает мощность магии на 25 единиц, продолжительностью 3 часа.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/invoke_spell_godintel100.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&3\';" onMouseOver="top.hi(this,\'<b>Сокрушение<hr>Цена: 10 кредитов<hr>Увеличивает мощность урона на 25 единиц, продолжительностью 1 часа.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/spell_powerup10.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&4\';" onMouseOver="top.hi(this,\'<b>Защита от оружия<hr>Цена: 10 кредитов<hr>Увеличивает защиту от урона на 100 едениц, продолжительностью 3 часа.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/spell_protect10.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&5\';" onMouseOver="top.hi(this,\'<b>Холодный Разум<hr>Цена: 10 кредитов<hr>Увеличивает Интелект продолжительностью 3 часа.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/spell_stat_intel.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&6\';" onMouseOver="top.hi(this,\'<b>Жажда Жизни +5<hr>Цена: 10 кредитов<hr>Увеличивает колличество жизней продолжительностью 6 часов.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/spell_powerHPup5.gif">';
?>
<hr><b>Эликсиры:<b><hr>
<?php
echo '<img onclick="location.href=\'/main.php?add_eff&9\';" onMouseOver="top.hi(this,\'<b>Эликсир Жизни<hr>Цена: 5 кредитов.<hr>Мгновенно восстанавливает 500 жизней.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/pot_cureHP250_20.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&10\';" onMouseOver="top.hi(this,\'<b>Эликсир Маны<hr>Цена: 5 кредитов.<hr>Мгновенно восстанавливает 1000 маны.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/pot_curemana500_20.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&11\';" onMouseOver="top.hi(this,\'<b>Зелье Могущества<hr>Цена: 10 кредитов<hr>Добавит игроку 10 силы на 6 часов.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/pot_base_50_str.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&12\';" onMouseOver="top.hi(this,\'<b>Зелье Стремительности<hr>Цена: 10 кредитов<hr>Добавит игроку 10 ловкости на 6 часов.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/pot_base_50_dex.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&13\';" onMouseOver="top.hi(this,\'<b>Зелье Прозрения<hr>Цена: 10 кредитов<hr>Добавит игроку 10 интуиции на 6 часов.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/pot_base_50_inst.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&14\';" onMouseOver="top.hi(this,\'<b>Зелье Разума<hr>Цена: 10 кредитов<hr>Добавит игроку 10 интеллекта на 6 часов.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/pot_base_50_intel.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&15\';" onMouseOver="top.hi(this,\'<b>Нектар Неуязвимости<hr>Цена: 25 кредитов<hr>Добавит игроку 160 защиты от урона на 3 часа.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/pot_base_200_alldmg3.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&16\';" onMouseOver="top.hi(this,\'<b>Нектар Отрицания<hr>Цена: 25 кредитов<hr>Добавит игроку 160 защиты от магии на 3 часа.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/pot_base_200_allmag3.gif">';
?>
<hr><h3>Усиления за ЕКР:</h3><hr><b>Заклинания и защиты:</b><hr>
<?php
echo '<img onclick="location.href=\'/main.php?add_eff&17\';" onMouseOver="top.hi(this,\'<b>Жажда Жизни +6<hr><font color=green>Цена: 0.5 ЕКР</font><hr>Увеличивает колличество жизней продолжительностью 6 часов.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/spell_powerHPup6.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&30\';" onMouseOver="top.hi(this,\'<b>Защита от нападения<hr><font color=green>Цена: 1 ЕКР</font><hr>Защитит Вас от любых нападений на протяжении 5 минут.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/eff/wis_light_shield.gif">';
?>
<hr><b>Эликсиры:</b><hr>
<?php
echo '<img onclick="location.href=\'/main.php?add_eff&19\';" onMouseOver="top.hi(this,\'<b>Нектар Великана<hr><font color=green>Цена: 0.4 ЕКР</font><hr>Продолжительность действия: 6 ч.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/pot_base_50_str2.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&20\';" onMouseOver="top.hi(this,\'<b>Нектар Змеи<hr><font color=green>Цена: 0.4 ЕКР</font><hr>Продолжительность действия: 6 ч.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/pot_base_50_dex2.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&21\';" onMouseOver="top.hi(this,\'<b>Нектар Предчувствия<hr><font color=green>Цена: 0.4 ЕКР</font><hr>Продолжительность действия: 6 ч.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/pot_base_50_inst2.gif">';
echo '<img onclick="location.href=\'/main.php?add_eff&22\';" onMouseOver="top.hi(this,\'<b>Нектар Разума<hr><font color=green>Цена: 0.4 ЕКР</font><hr>Продолжительность действия: 6 ч.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="//img.new-combats.tech/i/items/pot_base_50_intel2.gif">';
<style>
fieldset {
border: 1px solid black;
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
border-radius: 50px;
}
?>
</fieldset></center>
.red {
color: red;
}
.green {
color: green;
}
.ac {
text-align: center;
}
</style>
<?php if ($msg) {
echo "<b class='red'>$msg</b><br>";
} ?>
<h3>Купить временные усиления</h3>
<div class="ac">
<b>Деньги: <span class="green"><?= $u->info['money'] ?></span> кр. |
<span class="green"><?= $u->info['money2'] ?></span> екр.</b><br>
<?php if ($currentEffectList) {
echo 'Текущие эффекты:<br>' . $currentEffectList;
} ?>
<br>
<input class="btn btn-success" onClick="location.href='/main.php?add_eff';" type="button" value="Обновить">
<input class="btn btn-success" onClick="location.href='/main.php';" type="button" value="Вернуться"><br><br>
<fieldset>
<h3>Усиления за кредиты:</h3>
<img onclick="location.href='/main.php?add_eff&1';"
onMouseOver="top.hi(this,\'<b>Защита от магии<hr>Цена: 10 кредитов<hr>Увеличивает защиту от магии на 100 едениц, продолжительностью 3 часа.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/magearmor.gif" alt="">
<img onclick="location.href='/main.php?add_eff&2';"
onMouseOver="top.hi(this,\'<b>Магическое усиление<hr>Цена: 10 кредитов<hr>Увеличивает мощность магии на 25 единиц, продолжительностью 3 часа.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/invoke_spell_godintel100.gif" alt="">
<img onclick="location.href='/main.php?add_eff&3';"
onMouseOver="top.hi(this,\'<b>Сокрушение<hr>Цена: 10 кредитов<hr>Увеличивает мощность урона на 25 единиц, продолжительностью 1 часа.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/spell_powerup10.gif" alt="">
<img onclick="location.href='/main.php?add_eff&4';"
onMouseOver="top.hi(this,\'<b>Защита от оружия<hr>Цена: 10 кредитов<hr>Увеличивает защиту от урона на 100 едениц, продолжительностью 3 часа.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/spell_protect10.gif" alt="">
<img onclick="location.href='/main.php?add_eff&5';"
onMouseOver="top.hi(this,\'<b>Холодный Разум<hr>Цена: 10 кредитов<hr>Увеличивает Интелект продолжительностью 3 часа.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/spell_stat_intel.gif" alt="">
<img onclick="location.href='/main.php?add_eff&6';"
onMouseOver="top.hi(this,\'<b>Жажда Жизни +5<hr>Цена: 10 кредитов<hr>Увеличивает колличество жизней продолжительностью 6 часов.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/spell_powerHPup5.gif" alt="">
<br><br>
<img onclick="location.href='/main.php?add_eff&9';"
onMouseOver="top.hi(this,\'<b>Эликсир Жизни<hr>Цена: 5 кредитов.<hr>Мгновенно восстанавливает 500 жизней.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/pot_cureHP250_20.gif" alt="">
<img onclick="location.href='/main.php?add_eff&10';"
onMouseOver="top.hi(this,\'<b>Эликсир Маны<hr>Цена: 5 кредитов.<hr>Мгновенно восстанавливает 1000 маны.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/pot_curemana500_20.gif" alt="">
<img onclick="location.href='/main.php?add_eff&11';"
onMouseOver="top.hi(this,\'<b>Зелье Могущества<hr>Цена: 10 кредитов<hr>Добавит игроку 10 силы на 6 часов.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/pot_base_50_str.gif" alt="">
<img onclick="location.href='/main.php?add_eff&12';"
onMouseOver="top.hi(this,\'<b>Зелье Стремительности<hr>Цена: 10 кредитов<hr>Добавит игроку 10 ловкости на 6 часов.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/pot_base_50_dex.gif" alt="">
<img onclick="location.href='/main.php?add_eff&13';"
onMouseOver="top.hi(this,\'<b>Зелье Прозрения<hr>Цена: 10 кредитов<hr>Добавит игроку 10 интуиции на 6 часов.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/pot_base_50_inst.gif" alt="">
<img onclick="location.href='/main.php?add_eff&14';"
onMouseOver="top.hi(this,\'<b>Зелье Разума<hr>Цена: 10 кредитов<hr>Добавит игроку 10 интеллекта на 6 часов.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/pot_base_50_intel.gif" alt="">
<img onclick="location.href='/main.php?add_eff&15';"
onMouseOver="top.hi(this,\'<b>Нектар Неуязвимости<hr>Цена: 25 кредитов<hr>Добавит игроку 160 защиты от урона на 3 часа.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/pot_base_200_alldmg3.gif" alt="">
<img onclick="location.href='/main.php?add_eff&16';"
onMouseOver="top.hi(this,\'<b>Нектар Отрицания<hr>Цена: 25 кредитов<hr>Добавит игроку 160 защиты от магии на 3 часа.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/pot_base_200_allmag3.gif" alt="">
<hr>
<h3>Усиления за ЕКР:</h3>
<img onclick="location.href='/main.php?add_eff&17';"
onMouseOver="top.hi(this,\'<b>Жажда Жизни +6<hr><font color=green>Цена: 0.5 ЕКР</font><hr>Увеличивает колличество жизней продолжительностью 6 часов.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/spell_powerHPup6.gif" alt="">
<img onclick="location.href='/main.php?add_eff&30';"
onMouseOver="top.hi(this,\'<b>Защита от нападения<hr><font color=green>Цена: 1 ЕКР</font><hr>Защитит Вас от любых нападений на протяжении 5 минут.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/eff/wis_light_shield.gif" alt="">
<br><br>
<img onclick="location.href='/main.php?add_eff&19';"
onMouseOver="top.hi(this,\'<b>Нектар Великана<hr><font color=green>Цена: 0.4 ЕКР</font><hr>Продолжительность действия: 6 ч.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/pot_base_50_str2.gif" alt="">
<img onclick="location.href='/main.php?add_eff&20';"
onMouseOver="top.hi(this,\'<b>Нектар Змеи<hr><font color=green>Цена: 0.4 ЕКР</font><hr>Продолжительность действия: 6 ч.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/pot_base_50_dex2.gif" alt="">
<img onclick="location.href='/main.php?add_eff&21';"
onMouseOver="top.hi(this,\'<b>Нектар Предчувствия<hr><font color=green>Цена: 0.4 ЕКР</font><hr>Продолжительность действия: 6 ч.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/pot_base_50_inst2.gif" alt="">
<img onclick="location.href='/main.php?add_eff&22';"
onMouseOver="top.hi(this,\'<b>Нектар Разума<hr><font color=green>Цена: 0.4 ЕКР</font><hr>Продолжительность действия: 6 ч.</b>\',event,2,0,1,1,\'max-width:307px\')"
onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp"
src="//img.new-combats.tech/i/items/pot_base_50_intel2.gif" alt="">
</fieldset>
</div>

File diff suppressed because one or more lines are too long

View File

@ -1,10 +0,0 @@
<?php
if(!defined('GAME'))
{
die();
}
if($u->room['file'] != 'turnir') {
return;
}
$tur = new Tournir();

View File

@ -461,13 +461,8 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
$cmsg = new ChatMessage();
if (preg_match("/анекдот/i", mb_convert_case($_POST['msg'], MB_CASE_LOWER))) {
$text_com = '';
$sp_all = mysql_fetch_array(
mysql_query(
'SELECT COUNT(`id`) FROM `a_com_act` WHERE `act` = "' . $com_act . '" AND `time` > "' . time(
) . '" LIMIT 5'
)
);
if ($sp_all[0] > 0) {
$sp_all = Db::getValue('select count(*) from a_com_act where act = ? and time > unix_timestamp() limit 5', [$com_act]);
if ($sp_all > 0) {
if (rand(0, 100) < 75) {
$text_com = [
'Отстань попрошайка! ... Ищу анекдоты, интернет не маленький!',
@ -479,31 +474,24 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
$text_com = $text_com[rand(0, (count($text_com) - 1))];
}
} else {
$sp_all = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `a_com_anekdot`'));
$sp_all = rand(1, $sp_all[0]);
$sp_all = mysql_fetch_array(
mysql_query('SELECT * FROM `a_com_anekdot` WHERE `id` = "' . $sp_all . '" LIMIT 1')
);
$sp_all = Db::getRow('select * from a_com_anekdot order by rand() limit 1');
if (isset($sp_all['id'])) {
$text_com = $sp_all['text'];
$text_com = str_replace("<br>", "<br>&nbsp; &nbsp; ", $text_com);
$text_com = str_replace("<br />", "<br />&nbsp; &nbsp; ", $text_com);
$text_com = str_ireplace("\r\n", "", $text_com);
$text_com = str_replace("", "", $text_com);
$text_com = '<font color=red><b>Анекдот</b></font>:<br>&nbsp; &nbsp; ' . $text_com . '<br>';
$text_com = '<b style="color: red">Анекдот</b>:<br>&nbsp; &nbsp; ' . $text_com . '<br>';
} else {
$text_com = 'Анекдот из головы вылетел...';
}
mysql_query(
'INSERT INTO `a_com_act` (`act`,`time`,`uid`) VALUES ("0","' . (time(
) + 60) . '","' . $u->info['id'] . '")'
);
Db::sql('insert into a_com_act (act, time, uid) values (0, unix_timestamp() + 60, ?)', [$u->info['id']]);
}
if ($text_com != '') {
$cmsg->setText($text_com);
}
} else {
include('commentator.php');
include_once 'commentator.php';
if ($comment != '') {
$cmsg->setText($comment);
}
@ -517,10 +505,7 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
$chat->sendMsg($cmsg);
}
}
mysql_query(
'UPDATE `users` SET `afk` = "",`dnd` = "",`timeMain` = "' . time(
) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
);
Db::sql('update users set afk = default, dnd = default, timeMain = unix_timestamp() where id = ?', [$u->info['id']]);
}
}
@ -1076,19 +1061,6 @@ if ($posts > 0) {
$r['js'] .= ' $("#postdiv").hide();';
}
//Предложения вступить в клан
$sp = mysql_query('SELECT * FROM `clan_add` WHERE `uid` = "' . $u->info['id'] . '" AND `yes` = 0 AND `no` = 0');
while ($pl = mysql_fetch_array($sp)) {
$clns = mysql_fetch_array(
mysql_query('SELECT `id`,`name`,`align` FROM `clan` WHERE `id` = "' . $pl['clan'] . '" LIMIT 1')
);
$usr = mysql_fetch_array(
mysql_query('SELECT `id`,`login`,`level` FROM `users` WHERE `id` = "' . $pl['uid_clan'] . '" LIMIT 1')
);
$r['js'] .= 'top.inclanNew(' . $pl['id'] . ',"' . $clns['align'] . '","' . $clns['id'] . '","' . $clns['name'] . '","' . $usr['login'] . '</b>[' . $usr['level'] . ']<b>");';
}
unset($clns);
//Предложение на обмен
$trf = mysql_fetch_array(
mysql_query(

View File

@ -13,7 +13,7 @@ if(isset($p['id'])) {
}
}
function microLogin($id,$t,$nnz = 1) {
function microLogin($id,$t,$nnz = 1) {
$inf = $id;
$id = $inf['id'];
$r = '';