Merge pull request 'dev' (#28) from dev into master

Reviewed-on: new-combats.com/game#28
This commit is contained in:
Ivor Barhansky 2023-01-11 13:19:06 +00:00
commit 75da4ded8f
493 changed files with 73378 additions and 87373 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/.idea/

81
AI.php
View File

@ -12,8 +12,8 @@ if(isset($_GET['m1'])) {
setlocale(LC_CTYPE, "ru_RU.CP1251");
include('_incl_data/__config.php');
include('_incl_data/class/__db_connect.php');
include_once '_incl_data/__config.php';
include_once '_incl_data/class/__db_connect.php';
$sp = mysql_query('SELECT * FROM `users_recombats` WHERE `email` != "" ORDER BY `name` DESC LIMIT 7000');
while ($pl = mysql_fetch_array($sp)) {
@ -26,13 +26,15 @@ if(isset($_GET['m1'])) {
include('_incl_data/__config.php');
include('_incl_data/class/__db_connect.php');
include('_incl_data/class/__user.php');
$u = User::start();
$ins = 'Âåùè ÁÊ-1:<hr>';
$sp = mysql_query('SELECT * FROM `items_main` WHERE `geni` = 1');
while ($pl = mysql_fetch_array($sp)) {
$po = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$pl['id'].'" LIMIT 1'));
$po = mysql_fetch_array(
mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "' . $pl['id'] . '" LIMIT 1')
);
$po = $u->lookStats($po['data']);
if (!isset($po['add_minAtack']) && isset($po['sv_minAtack'])) {
@ -117,14 +119,9 @@ if( isset($_GET['test'])) {
$i = 3;
function yrn($sila) {
$r = 0;
$level = $_GET['test'];
$r = 2 + $level + $sila - round($sila / 5);
return $r;
function yrn($sila)
{
return 2 + $_GET['test'] + $sila - round($sila / 5);
}
@ -136,7 +133,7 @@ if( isset($_GET['test'])) {
echo ' style="background-color:grey;color:#fff;"';
}
echo '>&nbsp;';
echo $i.' = '.yrn($i).'';
echo $i . ' = ' . yrn($i);
echo '</div>';
$i++;
}
@ -144,52 +141,42 @@ if( isset($_GET['test'])) {
die();
}
function getIP() {
if(isset($_SERVER['HTTP_X_REAL_IP'])) return $_SERVER['HTTP_X_REAL_IP'];
return $_SERVER['REMOTE_ADDR'];
function getIP()
{
return isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : $_SERVER['REMOTE_ADDR'];
}
if(isset($_GET['robot'])) {
}elseif(getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '' && getIP() != '31.131.116.166') {
if( !isset($_GET['test'])) {
if (!isset($_GET['robot']) && getIP() != $_SERVER['SERVER_ADDR'] && getIP() != '127.0.0.1' && getIP() != '' && getIP(
) != '31.131.116.166' && !isset($_GET['test'])) {
die(getIP() . '<br>' . $_SERVER['SERVER_ADDR']);
}
}
define('GAME',true);
const GAME = true;
setlocale(LC_CTYPE, "ru_RU.CP1251");
include('_incl_data/__config.php');
include('_incl_data/class/__db_connect.php');
include('_incl_data/class/__user.php');
include('_incl_data/class/bot.priem.php');
include('_incl_data/class/bot.logic.php');
function e($t) {
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #'.date('d.m.Y').' %'.date('H:i:s').' (Êðèòè÷åñêàÿ îøèáêà): <b>'.mysql_real_escape_string($t).'</b>","capitalcity","LEL","6","1","-1")');
$count = [0, 0, 0, 0, 0, 0];
function inuser_go_btl($id)
{
if (isset($id['id'])) {
file_get_contents(
'https://new-combats.com/jx/battle/refresh.php?uid=' . $id['id'] . '&cron_core=' . md5(
$id['id'] . '_brfCOreW@!_' . $id['pass']
) . '&pass=' . $id['pass']
);
}
}
$count = array(
0,
0,
0,
0,
0,
0
$sp = mysql_query(
'SELECT `u`.* , `s`.* FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `u`.`pass` = "botforpeople" ORDER BY `s`.`nextAct` ASC LIMIT 200'
);
function inuser_go_btl($id) {
if(isset($id['id'])) {
file_get_contents('https://new-combats.com/jx/battle/refresh.php?uid='.$id['id'].'&cron_core='.md5($id['id'].'_brfCOreW@!_'.$id['pass']).'&pass='.$id['pass']);
}
}
$sp = mysql_query('SELECT `u`.* , `s`.* FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `u`.`pass` = "botforpeople" ORDER BY `s`.`nextAct` ASC LIMIT 200');
$btltest = array();
$btltest = [];
while ($pl = mysql_fetch_array($sp)) {
@ -211,12 +198,12 @@ while($pl = mysql_fetch_array($sp)) {
mysql_query('UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
botLogic::start( $pl['id'] );
BotLogic::start($pl['id']);
} else {
if ($pl['zv'] > 0) {
botLogic::start( $pl['id'] );
BotLogic::start($pl['id']);
}
if ($pl['timereg'] == 0) {
@ -234,7 +221,7 @@ while($pl = mysql_fetch_array($sp)) {
echo '*';
}
echo '+';
echo '['.$pl['login'].'] -> Äåéñòâèå: '.$pl['ipreg'].' , îæèäàåì: '.($pl['timeMain']-time()).' ñåê., çàÿâêà: '.$pl['zv'].', ïîåäèíîê: '.$pl['battle'].'';
echo '[' . $pl['login'] . '] -> Äåéñòâèå: ' . $pl['ipreg'] . ' , îæèäàåì: ' . ($pl['timeMain'] - time(
)) . ' ñåê., çàÿâêà: ' . $pl['zv'] . ', ïîåäèíîê: ' . $pl['battle'] . '';
echo '<hr>';
}
?>

View File

@ -1,11 +1,12 @@
<?php
error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors', 'Off');
setlocale(LC_CTYPE, "ru_RU.CP1251");
date_default_timezone_set('Europe/Moscow');
$c = [
'ver' => '1.8.3.7'
'ver' => '1.8.3.7',
];
/* Конфигурации игры */
$c['name'] = 'Бойцовский Клуб';
@ -48,45 +49,16 @@ $c['expstop'] = 2999999; //9; //
$c['expstopu'] = 2999999; //Опыт на котором останавливаемся
$c['noobgade'] = false; //нуб квест (пещера)
$c['bonusonline'] = true; //бонус за онлайн
$c['bonusonline_kof'] = 1; //êîýôèöåíò êð çà ëâë
$c['level_ransfer'] = 8; //С какого уровня разрешены передачи
$c['znahar'] = true; //бесплатный знахарь
$c['nolevel'] = false; //лимитирование уровней
$c['noitembuy'] = false; //Не требует ресурсы для покупки
$c['effz'] = 0; //Скольким секундам равен заряд
$c['money_haot'] = true; //кр за хаоты
$c['money_haot_proc'] = 0.10; //ñêîëüêî ïðîöåíòîâ îò ôóëëà âûäàåò â íàãðàäó
$c['crtoecr'] = 500; //Курс обмена кр на екр (если 0, то выключено)
$c['ecrtocr'] = 200; //Курс обмена екр на кр
$c['bonuslevel'] = true; //Бонус уровня
$c['bonussocial'] = false; //Бонус социальный
$c['exp_limit_many'] = false; //Ëèìèò îïûòà, åñëè áîëåå 5 áîåâ, òî 0 îïûòà äàñò
$c['exp_mega'] = false; //Ïîâûøåííûé ëèìèò îïûòà
$c['exp_mega_val'] = [
0 => 1000,
1 => 1000,
2 => 1000,
3 => 1000,
4 => 1000,
5 => 1000,
6 => 1000,
7 => 1500,
8 => 0,
9 => 0,
10 => 0,
11 => 0,
12 => 0,
13 => 0,
14 => 0,
15 => 0,
16 => 0,
17 => 0,
18 => 0,
19 => 0,
20 => 0,
21 => 0
]; //Ïîâûøåííûé ëèìèò îïûòà
$c['w'] = date('w');
$c['m'] = date('m');
@ -105,5 +77,20 @@ if (isset($_GET['version'])) {
// Для всех доработок, пока нет автозагрузки классов.
require_once 'class/Insallah/Config.php';
//Âìåñòî êðîíà äëÿ òóðíèðà.
if (\Insallah\Tournament::IS_ENABLED) (new \Insallah\Tournament())->startAllBattles();
// Ïîïðîáóåì â àâòîçàãðóçêó.
// Íèêîãäà íå çàðàáîòàåò ñ òàêèìè íàçâàíèÿìè êëàññîâ è ôàéëîâ!
// "Íà ïîòîì."
spl_autoload_register(function ($className) {
# 1 with namespaces
# 2 without
$fileName = [
__DIR__ . '/class/' . str_replace('\\', '/', $className . '.php'),
__DIR__ . '/class/' . $className . '.php'
];
foreach ($fileName as $file) {
if (file_exists($file)) {
require_once $file;
break;
}
}
});

11785
_incl_data/class/Battle.php Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,399 @@
<?php
class BotPriemLogic
{
private static $p = [];
public static function start($i, $id)
{
self::$p = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "' . $id . '" LIMIT 1'));
$test = self::testpriem(self::$p);
if (isset(self::$p['id']) && $test == 0) {
//Èñïîëüçóåì ïðèåì ïîä íîìåðîì $id
if ($id == 1) {
self::priem1($i);
} //Ïðèêðûòüñÿ 1|2|3|4|5|6|7|8|9|10|11|13|14|45|47|48|49|188|204|211|217|220|223|232|235|240|0|0|0|0|0|0|0|0|0|0|0|0|0|0
elseif ($id == 2) {
self::priem2($i);
} //Âëîìèòü
elseif ($id == 3) {
self::priem3($i);
} //Ñîáðàòü çóáû
elseif ($id == 4) {
self::priem4($i);
} //Ñèëüíûé óäàð
elseif ($id == 5) {
self::priem5($i);
} //Óòåðåòü ïîò
elseif ($id == 6) {
self::priem6($i);
} //Âîëÿ ê ïîáåäå
elseif ($id == 7) {
self::priem7($i);
} //Àêòèâíàÿ çàùèòà
elseif ($id == 8) {
self::priem8($i);
} //Òàíåö âåòðà
elseif ($id == 9) {
self::priem9($i);
} //Äèêàÿ óäà÷à
elseif ($id == 10) {
self::priem10($i);
} //Ïðåäâèäèíèå
elseif ($id == 11) {
self::priem11($i);
} //Óäà÷íûé óäàð
elseif ($id == 13) {
self::priem13($i);
} //Ñòîéêîñòü
elseif ($id == 14) {
self::priem14($i);
} //ßðîñòü
elseif ($id == 45) {
self::priem45($i);
} //Ïîëíàÿ çàùèòà
elseif ($id == 47) {
self::priem47($i);
} //Ñëåïàÿ óäà÷à
elseif ($id == 48) {
self::priem48($i);
} //Òàíåö ëåçâèé
elseif ($id == 49) {
self::priem49($i);
} //Âòîðîå äûõàíèå
elseif ($id == 188) {
self::priem188($i);
} //Æàæäà êðîâè
elseif ($id == 204) {
self::priem204($i);
} //Îáðå÷åííîñòü
elseif ($id == 211) {
self::priem211($i);
} //Àãðåññèâíàÿ çàùèòà
elseif ($id == 217) {
self::priem217($i);
} //Ðàçãàäàòü òàêòèêó
elseif ($id == 220) {
self::priem220($i);
} //Ñòàâêà íà îïåðåæåíèå
elseif ($id == 223) {
self::priem223($i);
} //Ðûâîê
elseif ($id == 232) {
self::priem232($i);
} //Âûæèòü
elseif ($id == 235) {
self::priem235($i);
} //Øîêèðóþùèé óäàð
elseif ($id == 240) {
self::priem240($i);
} //Õëåáíóòü êðîâè
elseif ($id >= 175 && $id <= 179) {
self::priem175($i);
}
//*********************************
}
return true;
}
private static function usePriem($id, $on = null)
{
$go_txt = '&usepriem=' . $id;
if ($on != '') {
$on = str_replace(' ', '%20', $on);
$go_txt .= '&useon=' . $on;
}
BotLogic::inuser_go_btl(BotLogic::$bot, $go_txt);
}
//Ñòàâêà íà îïåðåæåíèå
private static function priem220($i)
{
if (rand(0, 100) < 30) {
self::usePriem($i);
}
}
//Ðàçãàäàòü òàêòèêó
private static function priem217($i)
{
if (rand(0, 100) < 30) {
self::usePriem($i);
}
}
//Îáðå÷åííîñòü
private static function priem204($i)
{
if (rand(0, 100) < 30) {
self::usePriem($i);
}
}
//Âûæèòü
private static function priem232($i)
{
if (self::hp() <= 30 && rand(0, 100) < 50) {
self::usePriem($i);
}
}
//Æàæäà êðîâè
private static function priem188($i)
{
if (rand(0, 100) < 30) {
self::usePriem($i);
}
}
//Øîê óäàð
private static function priem235($i)
{
if (rand(0, 100) < 50) {
self::usePriem($i);
}
}
//Õëåáíóòü êðîâè
private static function priem240($i)
{
if (self::hp() <= 70) {
self::usePriem($i);
}
}
//Ñèëîâîå ïîëå
private static function priem175($i)
{
self::usePriem($i);
}
//Ïðèêðûòüñÿ
private static function priem1($i)
{
if (rand(0, 100) < 50) {
self::usePriem($i);
}
}
//Âëîìèòü
private static function priem2($i)
{
if (rand(0, 100) < 50) {
self::usePriem($i);
}
}
//Ñîáðàòü çóáû
private static function priem3($i)
{
if (self::hp() <= 70 && rand(0, 100) < 50) {
self::usePriem($i);
}
}
//Âîëÿ ê ïîáåäå
private static function priem6($i)
{
if (self::hp() <= 40 && rand(0, 100) < 50) {
self::usePriem($i);
}
}
//Òàíåö âåòðà
private static function priem8($i)
{
if (rand(0, 100) < 30) {
self::usePriem($i);
}
}
//Òàíåö ëåçâèé
private static function priem48($i)
{
if (rand(0, 100) < 70) {
self::usePriem($i);
}
}
//Äèêàÿ óäà÷à
private static function priem9($i)
{
if (rand(0, 100) < 30) {
self::usePriem($i);
}
}
//Ñëåïàÿ óäà÷à
private static function priem47($i)
{
if (rand(0, 100) < 50) {
self::usePriem($i);
}
}
//Ïðåäâèäåíüå
private static function priem10($i)
{
if (rand(0, 100) < 30) {
self::usePriem($i);
}
}
//Âòîðîå äûõàíèå
private static function priem49($i)
{
if (rand(0, 100) < 80 && self::hp() <= 60) {
self::usePriem($i);
}
}
//Ðûâîê
private static function priem223($i)
{
if (self::hp() <= 50 && rand(0, 100) < 50) {
self::usePriem($i);
}
}
//Óäà÷íûé óäàð
private static function priem11($i)
{
if (rand(0, 100) < 30) {
self::usePriem($i);
}
}
//Ñòîéêîñòü
private static function priem13($i)
{
if (rand(0, 100) < 50) {
self::usePriem($i);
}
}
//ßðîñòü
private static function priem14($i)
{
if (rand(0, 100) < 50) {
self::usePriem($i);
}
}
//Ñèëüíûé óäàð
private static function priem4($i)
{
if (rand(0, 100) < 60) {
self::usePriem($i);
}
}
//Óòåðåòü ïîò
private static function priem5($i)
{
if (self::hp() <= 95) {
self::usePriem($i);
}
}
//Àãðåññèâíàÿ çàùèòà
private static function priem211($i)
{
if (rand(0, 100) < 80) {
self::usePriem($i);
}
}
//Ïîëíàÿ çàùèòà
private static function priem45($i)
{
if (rand(0, 100) < 50) {
self::usePriem($i);
}
}
//Àêòèâíàÿ çàùèòà
private static function priem7($i)
{
if (rand(0, 100) < 30) {
self::usePriem($i);
}
}
private static function hp()
{
return round((BotLogic::$st['hpNow'] / BotLogic::$st['hpAll'] * 100), 2);
}
//Òåñò íà âîçìîæíîñòü èñïîëüçîâàíèÿ
private static function testpriem($pl)
{
global $u;
$notr = 0;
$tr = $u->lookStats($pl['tr']);
$d2 = $u->lookStats($pl['date2']);
$x = 1;
while ($x <= 7) {
if (BotLogic::$bot['tactic' . $x] < $pl['tt' . $x] && $x != 7 && $pl['tt' . $x] > 0) {
$notr++;
} elseif ($x == 7) {
if ($pl['tt' . $x] > 0 && BotLogic::$bot['tactic' . $x] <= 0) {
$notr++;
}
}
$x++;
}
if ($pl['xuse'] > 0) {
$xu = $u->testAction('`vars` = "use_priem_' . BotLogic::$bot['battle'] . '_' . BotLogic::$bot['id'] . '" AND `vals` = "' . $pl['id'] . '" LIMIT ' . $pl['xuse'] . '', 2);
if ($xu[0] >= $pl['xuse']) {
$notr++;
}
}
$x = 0;
$t = $u->items['tr'];
while ($x < count($t)) {
$n = $t[$x];
if (isset($tr['tr_' . $n])) {
if ($n == 'lvl') {
if ($tr['tr_' . $n] > BotLogic::$bot['level']) {
$notr++;
}
} elseif ($tr['tr_' . $n] > BotLogic::$st[$n]) {
$notr++;
}
}
$x++;
}
if (isset($tr['tr_mpNow']) && BotLogic::$st['mpNow'] < $tr['tr_mpNow']) {
$notr++;
}
if ($pl['trUser'] == 1) {
//òðåáóåò ÷òîáû ïîëüçîâàòåëü ñ êåì-òî ðàçìåíèâàëñÿ (ïðè îæèäàíèè ïðèåì ãàñíèò)
$ga = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_act` WHERE `battle` = "' . BotLogic::$bot['battle'] . '" AND `uid1` = "' . BotLogic::$bot['id'] . '" AND `uid2` = "' . BotLogic::$bot['enemy'] . '" LIMIT 1'));
if (isset($ga['id'])) {
$notr++;
}
}
//Åñëè ïðèåì óæå èñïîëüçîâàëè
if (BotLogic::$st['prsu'][$pl['id']] > 0) {
$notr++;
}
return $notr;
}
}

View File

@ -0,0 +1,63 @@
<?php
/** Ïîëó÷àåì íà âõîä ñòðîêó, à íà âûõîä ðåçóëüòàò ìàòåìàòè÷åñêîé îïåðàöèè â ñòðîêå. */
class CalculateFromString
{
const PATTERN = '/(?:\-?\d+(?:\.?\d+)?[\+\-\*\/])+\-?\d+(?:\.?\d+)?/';
const PARENTHESIS_DEPTH = 10;
public function calculate($input){
if(strpos($input, '+') != null || strpos($input, '-') != null || strpos($input, '/') != null || strpos($input, '*') != null){
// Remove white spaces and invalid math chars
$input = str_replace(',', '.', $input);
$input = str_replace(' ', '', $input);
$input = preg_replace('[^0-9\.\+\-\*\/\(\)]', '', $input);
// Calculate each of the parenthesis from the top
$i = 0;
while(strpos($input, '(') || strpos($input, ')')){
$input = preg_replace_callback('/\(([^\(\)]+)\)/', 'self::callback', $input);
$i++;
if($i > self::PARENTHESIS_DEPTH){
break;
}
}
// Calculate the result
if(preg_match(self::PATTERN, $input, $match)){
return $this->compute($match[0]);
}
// To handle the special case of expressions surrounded by global parenthesis like "(1+1)"
if(is_numeric($input)){
return $input;
}
return 0;
}
return $input;
}
private function compute($input){
$compute = create_function('', 'return '.$input.';');
return 0 + $compute();
}
private function callback($input){
if(is_numeric($input[1])){
return $input[1];
}
elseif(preg_match(self::PATTERN, $input[1], $match)){
return $this->compute($match[0]);
}
return 0;
}
}
$Cal = new CalculateFromString();
$xyz='(100 * 25000) + (250 * 25000) + ((500/100) * 25000)';
$result = $Cal->calculate($xyz);
echo $result;

85
_incl_data/class/Chat.php Normal file

File diff suppressed because one or more lines are too long

1398
_incl_data/class/Dialog.php Normal file

File diff suppressed because it is too large Load Diff

1813
_incl_data/class/Dungeon.php Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,609 @@
<?php
class DungeonEditor
{
public $bs, $info, $see, $error, $gs = 1, $map = [0 => [] //êàðòà
], $id_dng, $cord = ['x' => 0], $sg = [1 => [1 => 1, 2 => 2, 3 => 3, 4 => 4], 2 => [1 => 2, 2 => 3, 3 => 4, 4 => 1], 3 => [1 => 3, 2 => 4, 3 => 1, 4 => 2], 4 => [1 => 4, 2 => 1, 3 => 2, 4 => 3]];
public function start()
{
global $u, $c, $code, $id;
$this->info = ['id2' => $id, 'id' => 0, 'name' => 'Ðåäàêòèðîâàíèå Ïåùåðû', 'room' => 0, 'time_start' => time(), 'time_start' => 0, 'uid' => 0, 'type' => 0, 'bsid' => 0];
$this->id_dng = $this->info['id2'];
$this->gs = $u->info['psevdo_s'];
if ($this->gs < 1 || $this->gs > 4) {
$this->gs = 1;
}
if ($this->info['bsid'] > 0) {
$this->bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `city` = "' . $u->info['city'] . '" AND `id` = "' . $this->info['bsid'] . '" AND `time_start` = "' . $this->info['time_start'] . '" LIMIT 1'));
//Åñëè ÁÑ çàêîí÷åíà
if (isset($this->bs['id']) && $this->bs['users'] - $this->bs['users_finish'] < 2) {
$u->bsfinish($this->bs, false, null);
}
}
/* ãåíåðèðóåì âèä ïåðñîíàæà (òîëüêî êàðòà)
$this->gs = 1; //ñìîòðèì ïðÿìî
2; //ñìîòðèì ëåâî
3; //ñìîòðèì âíèç
4; //ñìîòðèì ïðàâî
( ( ( `y` >= '.$u->info['psevdo_y'].' && `y` <= '.($u->info['psevdo_y']+4).' ) && ( `x` >= '.($u->info['psevdo_x']-1).' && `x` <= '.($u->info['psevdo_x']+1).' ) ) || ( (`x` = '.($u->info['psevdo_x']+2).' || `x` = '.($u->info['psevdo_x']-2).') && ( `y` = '.($u->info['psevdo_y']+3).' || `y` = '.($u->info['psevdo_y']+4).' ) ) )
*/
$whr = [1 => ' ((`x` <= ' . ($u->info['psevdo_x'] + 2) . ' && `x` >= ' . ($u->info['psevdo_x'] - 2) . ') && (`y` >= ' . $u->info['psevdo_y'] . ' && `y` <= ' . ($u->info['psevdo_y'] + 4) . ')) ', //ïðÿìî
3 => ' ((`x` <= ' . ($u->info['psevdo_x'] + 2) . ' && `x` >= ' . ($u->info['psevdo_x'] - 2) . ') && (`y` <= ' . $u->info['psevdo_y'] . ' && `y` >= ' . ($u->info['psevdo_y'] - 4) . ')) ', //âíèç
2 => ' ((`x` <= ' . $u->info['psevdo_x'] . ' && `x` >= ' . ($u->info['psevdo_x'] - 4) . ') && (`y` <= ' . ($u->info['psevdo_y'] + 2) . ' && `y` >= ' . ($u->info['psevdo_y'] - 2) . ')) ', //ëåâî
4 => ' ((`x` >= ' . $u->info['psevdo_x'] . ' && `x` <= ' . ($u->info['psevdo_x'] + 4) . ') && (`y` <= ' . ($u->info['psevdo_y'] + 2) . ' && `y` >= ' . ($u->info['psevdo_y'] - 2) . ')) ' //ïðàâî
];
$i = 1;
$sp = mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . $this->id_dng . '" AND ' . $whr[$this->gs] . ' ORDER BY `y` ASC , `x` ASC LIMIT 25');
while ($pl = mysql_fetch_array($sp)) {
$this->map[0][$pl['y'] . '_' . $pl['x']] = $pl;
$i++;
}
$this->map['good'] = $i; //öåëûõ êëåòîê
$this->map[1] = $this->genMatix();
$this->lookDungeon();
}
public function usersDng()
{
global $u, $c;
$r = '';
/* îòîáðàæåíèå áîòîâ (áåñïîëåçíî â äàííîì ðåäàêòîðå) */
}
public function atack($id)
{
global $u, $c, $code;
/* íàïàäåíèå, êàêîå íàïàäåíèå ìîæåò áûòü â ðåäàêòîðå? :) Íà ñàìîãî ñåáÿ, ñî ñòóëîì? :) */
}
public function takeinv($id)
{
global $u, $c, $code;
/* Ýòî ðåäàêòîð, à íå ìàéíêðàôò, çäåñü íè÷åãî ñîáèðàòü íå íóæíî :) */
}
public function takeit($id)
{
global $u, $c, $code, $magic;
/*  ðåäàêòîðå íè÷åãî íå ïàäàåò ;) */
}
public function addItem($i)
{
//äîáàâëÿåì ïðåäìåò â ïåùåðó (âîçìîæíî âûïàë èç áîòà èëè èç ñóíäóêà)
/* À ÷òî åùå? Ïóëüò ê óïðàâëåíèþ Çåìëåé?! */
}
public function itemsMap()
{
global $u, $c, $code;
/* Äà íè÷åãî çäåñü íå ïàäàåò! Ãîâîðþ æå! */
}
public function testLike($x1, $y1, $x2, $y2)
{
//èç $x1,$y1 â $x2,$y2
//äîñòóïíà-ëè ýòà êëåòêà äëÿ äåéñòâèé
$r = 0;
$c1 = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "' . $x1 . '" AND `y` = "' . $y1 . '" AND `id_dng` = "' . $this->info['id2'] . '" LIMIT 1'));
$c2 = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "' . $x2 . '" AND `y` = "' . $y2 . '" AND `id_dng` = "' . $this->info['id2'] . '" LIMIT 1'));
if (isset($c1['id']) && isset($c2['id'])) {
if ($x1 == $x2 && $y1 == $y2) {
$r = 1;
} elseif (
$x1 == $x2 - 1 && $c1['go_1'] == 1 || //ïðàâî
$x1 == $x2 + 1 && $c1['go_2'] == 1 || //ëåâî
$y1 == $y2 - 1 && $c1['go_3'] == 1 || //âåðõ
$y1 == $y2 + 1 && $c1['go_4'] == 1 //íèç
)
{
$r = 1;
}
}
return $r;
}
public function genObjects()
{
global $u, $c, $code;
////i:{id,name,mapPoint,action,img,type},
//'count':1,0:{0:1234,1:'Ñóíäóê',2:5,3:'',4:'test.gif',5:0,6:position,7:width,8:heigh,9:left,10:top},
//psition 0 - ïî öåíòðó , 1- ñâåðõó, 2- ñëåâà, 3- ñíèçó, 4- ñïðàâà
$r = '';
$whr = [1 => ' (((`u`.`x` <= ' . ($u->info['psevdo_x'] + 2) . ' && `u`.`x` >= ' . ($u->info['psevdo_x'] - 2) . ') && (`u`.`y` >= ' . ($u->info['psevdo_y'] + 1) . ' && `u`.`y` <= ' . ($u->info['psevdo_y'] + 4) . ')) OR (`u`.`y` = ' . $u->info['psevdo_y'] . ' && `u`.`x` = ' . $u->info['psevdo_x'] . ')) ', //ïðÿìî
3 => ' (((`u`.`x` <= ' . ($u->info['psevdo_x'] + 2) . ' && `u`.`x` >= ' . ($u->info['psevdo_x'] - 2) . ') && (`u`.`y` <= ' . ($u->info['psevdo_y'] - 1) . ' && `u`.`y` >= ' . ($u->info['psevdo_y'] - 4) . ')) OR (`u`.`y` = ' . $u->info['psevdo_y'] . ' && `u`.`x` = ' . $u->info['psevdo_x'] . ')) ', //âíèç
2 => ' (((`u`.`x` <= ' . ($u->info['psevdo_x'] - 1) . ' && `u`.`x` >= ' . ($u->info['psevdo_x'] - 4) . ') && (`u`.`y` <= ' . ($u->info['psevdo_y'] + 2) . ' && `u`.`y` >= ' . ($u->info['psevdo_y'] - 2) . '))OR (`u`.`y` = ' . $u->info['psevdo_y'] . ' && `u`.`x` = ' . $u->info['psevdo_x'] . ')) ', //ëåâî
4 => ' (((`u`.`x` >= ' . ($u->info['psevdo_x'] + 1) . ' && `u`.`x` <= ' . ($u->info['psevdo_x'] + 4) . ') && (`u`.`y` <= ' . ($u->info['psevdo_y'] + 2) . ' && `u`.`y` >= ' . ($u->info['psevdo_y'] - 2) . ')) OR (`u`.`y` = ' . $u->info['psevdo_y'] . ' && `u`.`x` = ' . $u->info['psevdo_x'] . ')) ' //ïðàâî
];
$sp = mysql_query('SELECT `u`.* FROM `dungeon_obj` AS `u` WHERE `u`.`dn` = "0" AND `u`.`for_dn` = "' . $this->id_dng . '" AND ((`u`.`s` = "0" OR `u`.`s` = "' . $this->gs . '") OR `u`.`s2` = "' . $this->gs . '") AND ' . $whr[$this->gs] . ' LIMIT 76');
# die('SELECT `u`.* FROM `dungeon_obj` AS `u` WHERE `u`.`dn` = "0" AND `u`.`for_dn` = "'.$this->id_dng.'" AND ((`u`.`s` = "0" OR `u`.`s` = "'.$this->gs.'") OR `u`.`s2` = "'.$this->gs.'") AND '.$whr[$this->gs].' LIMIT 76');
$i = 0;
$pos = [];
while ($pl = mysql_fetch_array($sp)) {
if ($pl['fix_x_y'] == 0 || ($pl['fix_x_y'] == 1 && $pl['x'] == $u->info['psevdo_x']) || ($pl['fix_x_y'] == 2 && $pl['y'] == $u->info['psevdo_y']) || ($pl['fix_x_y'] == 3 && $pl['x'] == $u->info['psevdo_x'] && $pl['y'] == $u->info['psevdo_y'])) {
if (($pl['os1'] == 0 && $pl['os2'] == 0 && $pl['os3'] == 0 && $pl['os4'] == 0) || ($this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os1'] || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os2'] || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os3'] || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os4'])) {
$i++;
if (!isset($pos[$this->cord[$pl['y'] . '_' . $pl['x']]])) {
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]] = 0;
}
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]]++;
$r .= ',' . ($i - 1) . ':{\'x\':' . $pl['x'] . ',\'y\':' . $pl['y'] . ',0:' . $pl['id'] . ',1:\'' . $pl['name'] . '\',2:' . (0 + $this->cord[$pl['y'] . '_' . $pl['x']]) . ',3:\'action\',4:\'' . $pl['img'] . '\',5:' . $pl['type'] . ',6:0,7:' . $pl['w'] . ',8:' . $pl['h'] . ',9:' . $pl['left'] . ',10:' . $pl['top'] . ',11:' . $pl['date'] . ',12:' . $pl['type'] . ',13:' . $pl['type2'] . ',14:' . $pl['s'] . ',15:' . $pl['s2'] . ',16:' . $pl['os1'] . ',17:' . $pl['os2'] . ',18:' . $pl['os3'] . ',19:' . $pl['os4'] . ',20:' . $pl['fix_x_y'] . '}';
} elseif ($this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os1'] - 1 || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os2'] - 1 || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os3'] - 1 || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os4'] - 1) {
$dt2 = explode(',', ltrim(rtrim($pl['date'], '\}'), '\{'));
$da = [];
$is = 0;
while ($is < count($dt2)) {
$dt2[$is] = explode(':', $dt2[$is]);
$da[$dt2[$is][0]] = $dt2[$is][1];
$is++;
}
#if(isset($da['rl2']))$da['rl2'] = -round((int)$da['rl2'] * 0.70); // Ñëåâà
if (isset($da['rl2'])) $da['rl2'] = round((int)$da['rl2'] - 230); // Ñëåâà
if (isset($da['rl3'])) $da['rl3'] = round((int)$da['rl3'] + 160);
if (isset($da['rl4'])) $da['rl4'] = round((int)$da['rl4'] - 120);
$pl['date'] = str_replace('"', '', json_encode($da));
$i++;
if (!isset($pos[$this->cord[$pl['y'] . '_' . $pl['x']]])) {
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]] = 0;
}
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]]++;
$r .= ',' . ($i - 1) . ':{\'x\':' . $pl['x'] . ',\'y\':' . $pl['y'] . ',0:' . $pl['id'] . ',1:\'' . $pl['name'] . '\',2:' . (0 + $this->cord[$pl['y'] . '_' . $pl['x']]) . ',3:\'action\',4:\'' . $pl['img'] . '\',5:' . $pl['type'] . ',6:0,7:' . $pl['w'] . ',8:' . $pl['h'] . ',9:' . $pl['left'] . ',10:' . $pl['top'] . ',11:' . $pl['date'] . ',12:' . $pl['type'] . ',13:' . $pl['type2'] . ',14:' . $pl['s'] . ',15:' . $pl['s2'] . ',16:' . $pl['os1'] . ',17:' . $pl['os2'] . ',18:' . $pl['os3'] . ',19:' . $pl['os4'] . ',20:' . $pl['fix_x_y'] . '}';
} elseif ($this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os1'] + 1 || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os2'] + 1 || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os3'] + 1 || $this->cord[$pl['y'] . '_' . $pl['x']] == $pl['os4'] + 1) {
$dt2 = explode(',', ltrim(rtrim($pl['date'], '\}'), '\{'));
$da = [];
$is = 0;
while ($is < count($dt2)) {
$dt2[$is] = explode(':', $dt2[$is]);
$da[$dt2[$is][0]] = $dt2[$is][1];
$is++;
}
#if(isset($da['rl2']))$da['rl2'] = 355-round((int)$da['rl2'] * 0.30); // Ñïðàâà
if (isset($da['rl2'])) $da['rl2'] = round((int)$da['rl2'] + 230); // Ñïðàâà
if (isset($da['rl3'])) $da['rl3'] = round((int)$da['rl3'] - 160);
if (isset($da['rl4'])) $da['rl4'] = round((int)$da['rl4'] + 120);
$pl['date'] = str_replace('"', '', json_encode($da));
$i++;
if (!isset($pos[$this->cord[$pl['y'] . '_' . $pl['x']]])) {
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]] = 0;
}
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]]++;
$r .= ',' . ($i - 1) . ':{\'x\':' . $pl['x'] . ',\'y\':' . $pl['y'] . ',0:' . $pl['id'] . ',1:\'' . $pl['name'] . '\',2:' . (0 + $this->cord[$pl['y'] . '_' . $pl['x']]) . ',3:\'action\',4:\'' . $pl['img'] . '\',5:' . $pl['type'] . ',6:0,7:' . $pl['w'] . ',8:' . $pl['h'] . ',9:' . $pl['left'] . ',10:' . $pl['top'] . ',11:' . $pl['date'] . ',12:' . $pl['type'] . ',13:' . $pl['type2'] . ',14:' . $pl['s'] . ',15:' . $pl['s2'] . ',16:' . $pl['os1'] . ',17:' . $pl['os2'] . ',18:' . $pl['os3'] . ',19:' . $pl['os4'] . ',20:' . $pl['fix_x_y'] . '}';
}
}
}
return 'count:' . $i . $r;
}
public function genUsers()
{
global $u, $c, $code;
////i:{id,login,mapPoint,sex,obraz,type,users_p},
//'count':1,0:{0:1015,1:'Test1',2:5,3:0,4:'1',5:'user',6:1},
$r = '';
$whr = [1 => ' ((`u`.`x` <= ' . ($u->info['psevdo_x'] + 2) . ' && `u`.`x` >= ' . ($u->info['psevdo_x'] - 2) . ') && (`u`.`y` >= ' . $u->info['psevdo_y'] . ' && `u`.`y` <= ' . ($u->info['psevdo_y'] + 4) . ')) ', //ïðÿìî
3 => ' ((`u`.`x` <= ' . ($u->info['psevdo_x'] + 2) . ' && `u`.`x` >= ' . ($u->info['psevdo_x'] - 2) . ') && (`u`.`y` <= ' . $u->info['psevdo_y'] . ' && `u`.`y` >= ' . ($u->info['psevdo_y'] - 4) . ')) ', //âíèç
2 => ' ((`u`.`x` <= ' . $u->info['psevdo_x'] . ' && `u`.`x` >= ' . ($u->info['psevdo_x'] - 4) . ') && (`u`.`y` <= ' . ($u->info['psevdo_y'] + 2) . ' && `u`.`y` >= ' . ($u->info['psevdo_y'] - 2) . ')) ', //ëåâî
4 => ' ((`u`.`x` >= ' . $u->info['psevdo_x'] . ' && `u`.`x` <= ' . ($u->info['psevdo_x'] + 4) . ') && (`u`.`y` <= ' . ($u->info['psevdo_y'] + 2) . ' && `u`.`y` >= ' . ($u->info['psevdo_y'] - 2) . ')) ' //ïðàâî
];
$i = 0;
//îòîáðàæàåì áîòîâ
$sp = mysql_query('SELECT `u`.*,`st`.* FROM `dungeon_bots` AS `u` LEFT JOIN `test_bot` AS `st` ON (`u`.`id_bot` = `st`.`id`) WHERE ' . $whr[$this->gs] . ' AND `dn` = "0" AND `for_dn` = "' . $this->id_dng . '" AND `u`.`delete` = "0" LIMIT 50');
while ($pl = mysql_fetch_array($sp)) {
$i++;
if (!isset($pos[$this->cord[$pl['y'] . '_' . $pl['x']]])) {
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]] = 0;
}
$pos[$this->cord[$pl['y'] . '_' . $pl['x']]]++;
$dlg = 0;
if ($pl['dialog'] > 0) {
$dlg = $pl['dialog'];
}
$r .= ',' . ($i - 1) . ':{0:' . $pl['id2'] . ',1:\'' . $pl['login'] . '\',2:' . (0 + $this->cord[$pl['y'] . '_' . $pl['x']]) . ',3:' . $pl['sex'] . ',4:\'' . str_replace('.gif', '', $pl['obraz']) . '\',5:\'bot\',6:' . $pos[$this->cord[$pl['y'] . '_' . $pl['x']]] . ',7:' . $dlg . '}';
}
return 'count:' . $i . $r;
}
public function botAtack($bot, $uid, $bs)
{
global $u, $c, $code;
$user = mysql_fetch_array(mysql_query('SELECT `id`,`battle` FROM `users` WHERE `id` = "' . $uid['id'] . '" LIMIT 1'));
if ($user['battle'] > 0) {
$btli = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "' . $user['battle'] . '" AND `team_win` = "-1" LIMIT 1'));
}
if (!isset($btli['id'])) {
//Ñîçäàåì ïîåäèíîê
$btl_id = 0;
$expB = 0;
$btl = ['players' => '', 'timeout' => 180, 'type' => 0, 'invis' => 0, 'noinc' => 0, 'travmChance' => 0, 'typeBattle' => 0, 'addExp' => $expB, 'money' => 0];
mysql_query('INSERT INTO `battle` (`dungeon`,`dn_id`,`x`,`y`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
"' . $this->info['id2'] . '",
"' . $this->info['id'] . '",
"' . $bot['x'] . '",
"' . $bot['y'] . '",
"' . $u->info['city'] . '",
"' . time() . '",
"' . $btl['players'] . '",
"' . $btl['timeout'] . '",
"' . $btl['type'] . '",
"' . $btl['invis'] . '",
"' . $btl['noinc'] . '",
"' . $btl['travmChance'] . '",
"' . $btl['typeBattle'] . '",
"' . $btl['addExp'] . '",
"' . $btl['money'] . '")');
$btl_id = mysql_insert_id();
if ($btl_id > 0) {
//Äîáàâëÿåì áîòîâ
$sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "0" AND `dn` = "' . $this->info['id'] . '" AND `x` = "' . $bot['x'] . '" AND `y` = "' . $bot['y'] . '" LIMIT 50');
$j = 0;
$logins_bot = [];
while ($pl = mysql_fetch_array($sp)) {
mysql_query('UPDATE `dungeon_bots` SET `inBattle` = "' . $btl_id . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
$jui = 1;
while ($jui <= $pl['colvo']) {
$k = $u->addNewbot($pl['id_bot'], null, null, $logins_bot);
$logins_bot = $k['logins_bot'];
if ($k) {
$upd = mysql_query('UPDATE `users` SET `battle` = "' . $btl_id . '" WHERE `id` = "' . $k['id'] . '" LIMIT 1');
if ($upd) {
$upd = mysql_query('UPDATE `stats` SET `x`="' . $bot['x'] . '",`y`="' . $bot['y'] . '",`team` = "1" WHERE `id` = "' . $k['id'] . '" LIMIT 1');
if ($upd) {
$j++;
}
}
}
$jui++;
}
}
unset($logins_bot);
if ($j > 0) {
mysql_query('UPDATE `users` SET `battle` = "' . $btl_id . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
mysql_query('UPDATE `stats` SET `team` = "2" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
}
}
}
}
public function testGo($id)
{
global $u, $c, $code;
$go = 0;
if ($id == 1) {
//âïåðåä
$go = $this->sg[$this->gs][1];
} elseif ($id == 2) {
//íàçàä
$go = $this->sg[$this->gs][3];
} elseif ($id == 3) {
//íà ïðàâî
$go = $this->sg[$this->gs][4];
} elseif ($id == 4) {
//íà ëåâî
$go = $this->sg[$this->gs][2];
}
$thp = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "' . $u->info['psevdo_x'] . '" AND `y` = "' . $u->info['psevdo_y'] . '" AND `id_dng` = "' . $this->info['id2'] . '" LIMIT 1'));
$ng = [4 => 1, 2 => 2, 1 => 3, 3 => 4];
if (isset($thp['id']) && $thp['go_' . $ng[$go]] == 0) {
$go = 0;
}
$tgo = [0 => 0, 1 => 0];
if ($go == 1) {
$tgo[1] += 1;
} elseif ($go == 2) {
$tgo[0] -= 1;
} elseif ($go == 3) {
$tgo[1] -= 1;
} elseif ($go == 4) {
$tgo[0] += 1;
}
$tbot = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_bots` WHERE `x` = "' . ($u->info['psevdo_x'] + (int)$tgo[0]) . '" AND `y` = "' . ($u->info['psevdo_y'] + (int)$tgo[1]) . '" AND `dn` = "' . $this->info['id'] . '" AND `for_dn` = "0" AND `delete` = "0" LIMIT 1'));
if (isset($tbot['id2']) && $u->info['admin'] == 0) {
$go = 0;
}
$tmap = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "' . $u->info['psevdo_x'] . '" AND `y` = "' . $u->info['psevdo_y'] . '" AND `id_dng` = "' . $this->info['id2'] . '" LIMIT 1'));
//íàëè÷èå ïðåäìåòà
if ($tmap['tr_items'] != '') {
$ti = explode(',', $tmap['tr_items']);
$i = 0;
$trnit = '';
while ($i < count($ti)) {
$ti2 = explode('=', $ti[$i]);
if ($ti2[0] > 0 && $ti2[1] > 0) {
$num_rows = mysql_num_rows(mysql_query('SELECT * FROM `items_users` WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `inShop` = "0" AND `item_id` = "' . ((int)$ti2[0]) . '" LIMIT ' . ((int)$ti2[1]) . ''));
if ($num_rows < (int)$ti2[1]) {
$tgo = $ti2[2];
if ($tgo != '0000' && $tgo[$ng[$go] - 1] == 1) {
$go = 0;
$trm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . ((int)$ti2[0]) . '" LIMIT 1'));
$trnit .= '&quot;' . $trm['name'] . '&quot;, ';
}
}
}
$i++;
}
if ($trnit != '') {
$trnit = rtrim($trnit, ', ');
$this->error = 'Ó âàñ íåò ïîäõîäÿùåãî ïðåäìåòà. Òðåáóåòñÿ ' . $trnit;
}
}
$tmGo = $u->info['timeGo'] - time(); //ñêîëüêî ñåêóíä îñòàëîñü
if ($tmGo > 0) {
$go = 0;
$this->error = 'Íå òàê áûñòðî...';
}
if ($u->aves['now'] >= $u->aves['max']) {
$go = 0;
$this->error = 'Âû íå ìîæåòå ïåðåìåùàòüñÿ, ðþêçàê ïåðåïîëíåí ...';
}
if ($go > 0) {
if ($go == 1) {
$u->info['psevdo_y'] += 1;
} elseif ($go == 2) {
$u->info['psevdo_x'] -= 1;
} elseif ($go == 3) {
$u->info['psevdo_y'] -= 1;
} elseif ($go == 4) {
$u->info['psevdo_x'] += 1;
}
$u->info['timeGo'] = time() + $tmap['timeGO'];
$u->info['timeGoL'] = time();
mysql_query('UPDATE `stats` SET `x` = "' . $u->info['psevdo_x'] . '",`y` = "' . $u->info['psevdo_y'] . '",`timeGo` = "' . $u->info['timeGo'] . '",`timeGoL` = "' . $u->info['timeGoL'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
}
}
public function testGone($id)
{
global $u, $c, $code;
$go = 0;
if ($id == 1) {
//âïåðåä
$go = $this->sg[$this->gs][1];
} elseif ($id == 2) {
//íàçàä
$go = $this->sg[$this->gs][3];
} elseif ($id == 3) {
//íà ïðàâî
$go = $this->sg[$this->gs][4];
} elseif ($id == 4) {
//íà ëåâî
$go = $this->sg[$this->gs][2];
}
$thp = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_map` WHERE `x` = "' . $u->info['psevdo_x'] . '" AND `y` = "' . $u->info['psevdo_y'] . '" AND `id_dng` = "' . $this->info['id2'] . '" LIMIT 1'));
$ng = [4 => 1, 2 => 2, 1 => 3, 3 => 4];
if (isset($thp['id']) && $thp['go_' . $ng[$go]] == 0) {
$go = 0;
}
$tgo = [0 => 0, 1 => 0];
if ($go == 1) {
$tgo[1] += 1;
} elseif ($go == 2) {
$tgo[0] -= 1;
} elseif ($go == 3) {
$tgo[1] -= 1;
} elseif ($go == 4) {
$tgo[0] += 1;
}
$tbot = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_bots` WHERE `x` = "' . ($u->info['psevdo_x'] + (int)$tgo[0]) . '" AND `y` = "' . ($u->info['psevdo_y'] + (int)$tgo[1]) . '" AND `dn` = "' . $this->info['id'] . '" AND `for_dn` = "0" AND `delete` = "0" LIMIT 1'));
if (isset($tbot['id2']) && $u->info['admin'] == 0) {
$go = 0;
}
return $go;
}
public function testSt($id, $s)
{
$r = 0;
//çàìåíÿåì îòîáðàæåíèå ñòåí â çàâèñèìîñòè îò óãëà îáçîðà
$s = $this->sg[$this->gs][$s];
if (isset($this->map[1][$id]['id'])) {
$r = $this->map[1][$id]['st'][($s - 1)];
}
return $r;
}
public function lookDungeon()
{
global $u, $c, $code, $pd;
/* Ãåíåðèðóåì èçîáðàæåíèå êàðòû */
/* LEVEL 1 */
if ($this->testSt(2, 4) > 0 || $this->testSt(3, 2) > 0) {
$pd[28] = 1;
}
if ($this->testSt(1, 4) > 0 || $this->testSt(2, 2) > 0) {
$pd[27] = 1;
}
if ($this->testSt(2, 1) > 0 || $this->testSt(5, 3) > 0) {
$pd[26] = 1;
}
if ($this->testSt(3, 1) > 0 || $this->testSt(6, 3) > 0) {
$pd[25] = 1;
}
if ($this->testSt(1, 1) > 0 || $this->testSt(4, 3) > 0) {
$pd[24] = 1;
}
/* LEVEL 2 */
if ($this->testSt(5, 4) > 0 || $this->testSt(6, 2) > 0) {
$pd[23] = 1;
}
if ($this->testSt(4, 4) > 0 || $this->testSt(5, 2) > 0) {
$pd[22] = 1;
}
if ($this->testSt(5, 1) > 0 || $this->testSt(8, 3) > 0) {
$pd[21] = 1;
}
if ($this->testSt(6, 1) > 0 || $this->testSt(7, 3) > 0) {
$pd[20] = 1;
}
if ($this->testSt(4, 1) > 0 || $this->testSt(9, 3) > 0) {
$pd[19] = 1;
}
/* LEVEL 3 */
if ($this->testSt(8, 4) > 0 || $this->testSt(7, 2) > 0) {
$pd[18] = 1;
}
if ($this->testSt(9, 4) > 0 || $this->testSt(8, 2) > 0) {
$pd[17] = 1;
}
if ($this->testSt(8, 1) > 0 || $this->testSt(12, 3) > 0) {
$pd[16] = 1;
}
if ($this->testSt(7, 1) > 0 || $this->testSt(13, 3) > 0) {
$pd[15] = 1;
}
if ($this->testSt(9, 1) > 0 || $this->testSt(11, 3) > 0) {
$pd[14] = 1;
}
/* LEVEL 4 */
if ($this->testSt(12, 4) > 0 || $this->testSt(13, 2) > 0) {
$pd[13] = 1;
}
if ($this->testSt(12, 2) > 0 || $this->testSt(11, 4) > 0) {
$pd[12] = 1;
}
if ($this->testSt(13, 1) > 0 || $this->testSt(17, 3) > 0) {
$pd[11] = 1;
} //8
if ($this->testSt(11, 1) > 0 || $this->testSt(16, 3) > 0) {
$pd[10] = 1;
} //7
if ($this->testSt(12, 1) > 0 || $this->testSt(15, 3) > 0) {
$pd[9] = 1;
}
if ($this->testSt(14, 1) > 0 || $this->testSt(18, 3) > 0) {
$pd[6] = 1;
} //2
if ($this->testSt(10, 1) > 0 || $this->testSt(19, 3) > 0) {
$pd[5] = 1;
} //1
if ($this->testSt(16, 4) > 0 || $this->testSt(15, 2) > 0) {
$pd[4] = 1;
}
if ($this->testSt(15, 4) > 0 || $this->testSt(17, 2) > 0) {
$pd[3] = 1;
}
/* Ãåíåðèðóåì ïðåäìåòû íà êàðòå */
/* Ãåíåðèðóåì ïåðñîíàæåé è áîòîâ íà êàðòå */
}
public function getMatrix($y, $x)
{
global $u;
$this->cord['x']++;
$this->cord[($u->info['psevdo_y'] + $y) . '_' . ($u->info['psevdo_x'] + $x)] = $this->cord['x'];
return $this->map[0][($u->info['psevdo_y'] + $y) . '_' . ($u->info['psevdo_x'] + $x)];
}
public function genMatix()
{
$r = [];
if ($this->gs == 1) {
//1; //ñìîòðèì ïðÿìî
$r[1] = $this->getMatrix(0, -1);
$r[2] = $this->getMatrix(0, 0);
$r[3] = $this->getMatrix(0, 1);
$r[4] = $this->getMatrix(1, -1);
$r[5] = $this->getMatrix(1, 0);
$r[6] = $this->getMatrix(1, 1);
$r[7] = $this->getMatrix(2, 1);
$r[8] = $this->getMatrix(2, 0);
$r[9] = $this->getMatrix(2, -1);
$r[10] = $this->getMatrix(3, -2);
$r[11] = $this->getMatrix(3, -1);
$r[12] = $this->getMatrix(3, 0);
$r[13] = $this->getMatrix(3, 1);
$r[14] = $this->getMatrix(3, 2);
$r[15] = $this->getMatrix(4, 0);
$r[16] = $this->getMatrix(4, -1);
$r[17] = $this->getMatrix(4, 1);
$r[18] = $this->getMatrix(4, 2);
$r[19] = $this->getMatrix(4, -2);
} elseif ($this->gs == 2) {
//2; //ñìîòðèì ëåâî
$r[1] = $this->getMatrix(-1, 0);
$r[2] = $this->getMatrix(0, 0);
$r[3] = $this->getMatrix(1, 0);
$r[4] = $this->getMatrix(-1, -1);
$r[5] = $this->getMatrix(0, -1);
$r[6] = $this->getMatrix(1, -1);
$r[7] = $this->getMatrix(1, -2);
$r[8] = $this->getMatrix(0, -2);
$r[9] = $this->getMatrix(-1, -2);
$r[10] = $this->getMatrix(-2, -3);
$r[11] = $this->getMatrix(-1, -3);
$r[12] = $this->getMatrix(0, -3);
$r[13] = $this->getMatrix(1, -3);
$r[14] = $this->getMatrix(2, -3);
$r[15] = $this->getMatrix(0, -4);
$r[16] = $this->getMatrix(-1, -4);
$r[17] = $this->getMatrix(1, -4);
$r[18] = $this->getMatrix(2, -4);
$r[19] = $this->getMatrix(-2, -4);
} elseif ($this->gs == 3) {
//3; //ñìîòðèì âíèç
$r[1] = $this->getMatrix(0, 1);
$r[2] = $this->getMatrix(0, 0);
$r[3] = $this->getMatrix(0, -1);
$r[4] = $this->getMatrix(-1, 1);
$r[5] = $this->getMatrix(-1, 0);
$r[6] = $this->getMatrix(-1, -1);
$r[7] = $this->getMatrix(-2, -1);
$r[8] = $this->getMatrix(-2, 0);
$r[9] = $this->getMatrix(-2, 1);
$r[10] = $this->getMatrix(-3, 2);
$r[11] = $this->getMatrix(-3, 1);
$r[12] = $this->getMatrix(-3, 0);
$r[13] = $this->getMatrix(-3, -1);
$r[14] = $this->getMatrix(-3, -2);
$r[15] = $this->getMatrix(-4, 0);
$r[16] = $this->getMatrix(-4, 1);
$r[17] = $this->getMatrix(-4, -1);
$r[18] = $this->getMatrix(-4, -2);
$r[19] = $this->getMatrix(-4, 2);
} elseif ($this->gs == 4) {
//4; //ñìîòðèì ïðàâî
$r[1] = $this->getMatrix(1, 0);
$r[2] = $this->getMatrix(0, 0);
$r[3] = $this->getMatrix(-1, 0);
$r[4] = $this->getMatrix(1, 1);
$r[5] = $this->getMatrix(0, 1);
$r[6] = $this->getMatrix(-1, 1);
$r[7] = $this->getMatrix(-1, 2);
$r[8] = $this->getMatrix(0, 2);
$r[9] = $this->getMatrix(1, 2);
$r[10] = $this->getMatrix(2, 3);
$r[11] = $this->getMatrix(1, 3);
$r[12] = $this->getMatrix(0, 3);
$r[13] = $this->getMatrix(-1, 3);
$r[14] = $this->getMatrix(-2, 3);
$r[15] = $this->getMatrix(0, 4);
$r[16] = $this->getMatrix(1, 4);
$r[17] = $this->getMatrix(-1, 4);
$r[18] = $this->getMatrix(-2, 4);
$r[19] = $this->getMatrix(2, 4);
}
return $r;
}
}

View File

@ -1,7 +1,4 @@
<?php
if (!defined('GAME')) {
die();
}
class Filter
{
@ -14,15 +11,18 @@ class Filter
}
//
//Ñìàéëèêè
public $sm = ["laugh" => 1, "fingal" => 1, "eek" => 1, "smoke" => 1, "hi" => 1, "bye" => 1, "king" => 1, "king2" => 1, "boks2" => 1, "boks" => 1, "gent" => 1, "lady" => 1, "tongue" => 1, "smil" => 1, "rotate" => 1, "ponder" => 1, "bow" => 1, "angel" => 1, "angel2" => 1, "hello" => 1, "dont" => 1, "idea" => 1, "mol" => 1, "super" => 1, "beer" => 1, "drink" => 1, "baby" => 1, "tongue2" => 1, "sword" => 1, "agree" => 1, "loveya" => 1, "kiss" => 1, "kiss2" => 1, "kiss3" => 1, "kiss4" => 1, "rose" => 1, "love" => 1, "love2" => 1, "confused" => 1, "yes" => 1, "no" => 1, "shuffle" => 1, "nono" => 1, "maniac" => 1, "privet" => 1, "ok" => 1, "ninja" => 1, "pif" => 1, "smash" => 1, "alien" => 1, "pirate" => 1, "gun" => 1, "trup" => 1, "mdr" => 1, "sneeze" => 1, "mad" => 1, "friday" => 1, "cry" => 1, "grust" => 1, "rupor" => 1, "fie" => 1, "nnn" => 1, "row" => 1, "red" => 1, "lick" => 1, "help" => 1, "wink" => 1, "jeer" => 1, "tease" => 1, "nunu" => 1, "inv" => 1, "duel" => 1, "susel" => 1, "nun" => 1, "kruger" => 1, "flowers" => 1, "horse" => 1, "hug" => 1, "str" => 1, "alch" => 1, "pal" => 1, "mag" => 1, "sniper" => 1, "vamp" => 1, "doc" => 1, "doc2" => 1, "sharp" => 1, "naem" => 1, "naem2" => 1, "naem3" => 1, "invis" => 1, "chtoza" => 1, "beggar" => 1, "sorry" => 1, "sorry2" => 1,
"creator" => 1, "grace" => 1, "dustman" => 1, "carreat" => 1, "lordhaos" => 1, "ura" => 1, "elix" => 1, "dedmoroz" => 1, "snegur" => 1, "showng" => 1, "superng" => 1, "podz" => 1, "sten" => 1, "devil" => 1, "cat" => 1, "owl" => 1, "lightfly" => 1, "snowfight" => 1, "rocket" => 1, "ball" => 1, "smile" => 1, "fuck" => 1];
private $sm = ["laugh" => 1, "fingal" => 1, "eek" => 1, "smoke" => 1, "hi" => 1, "bye" => 1, "king" => 1, "king2" => 1, "boks2" => 1, "boks" => 1, "gent" => 1, "lady" => 1, "tongue" => 1, "smil" => 1, "rotate" => 1, "ponder" => 1, "bow" => 1, "angel" => 1, "angel2" => 1, "hello" => 1, "dont" => 1, "idea" => 1, "mol" => 1, "super" => 1, "beer" => 1, "drink" => 1, "baby" => 1, "tongue2" => 1, "sword" => 1, "agree" => 1, "loveya" => 1, "kiss" => 1, "kiss2" => 1, "kiss3" => 1, "kiss4" => 1, "rose" => 1, "love" => 1, "love2" => 1, "confused" => 1, "yes" => 1, "no" => 1, "shuffle" => 1, "nono" => 1, "maniac" => 1, "privet" => 1, "ok" => 1, "ninja" => 1, "pif" => 1, "smash" => 1, "alien" => 1, "pirate" => 1, "gun" => 1, "trup" => 1, "mdr" => 1, "sneeze" => 1, "mad" => 1, "friday" => 1, "cry" => 1, "grust" => 1, "rupor" => 1, "fie" => 1, "nnn" => 1, "row" => 1, "red" => 1, "lick" => 1, "help" => 1, "wink" => 1, "jeer" => 1, "tease" => 1, "nunu" => 1, "inv" => 1, "duel" => 1, "susel" => 1, "nun" => 1, "kruger" => 1, "flowers" => 1, "horse" => 1, "hug" => 1, "str" => 1, "alch" => 1, "pal" => 1, "mag" => 1, "sniper" => 1, "vamp" => 1, "doc" => 1, "doc2" => 1, "sharp" => 1, "naem" => 1, "naem2" => 1, "naem3" => 1, "invis" => 1, "chtoza" => 1, "beggar" => 1, "sorry" => 1, "sorry2" => 1, "creator" => 1, "grace" => 1, "dustman" => 1, "carreat" => 1, "lordhaos" => 1, "ura" => 1, "elix" => 1, "dedmoroz" => 1, "snegur" => 1, "showng" => 1, "superng" => 1, "podz" => 1, "sten" => 1, "devil" => 1, "cat" => 1, "owl" => 1, "lightfly" => 1, "snowfight" => 1, "rocket" => 1, "ball" => 1, "smile" => 1, "fuck" => 1];
public function e($t)
{
mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("#' . date('d.m.Y') . ' %' . date('H:i:s') . ': <b>' . mysql_real_escape_string($t) . '</b>","capitalcity","Èãðîìèð","6","1","-1")');
mysql_query(
'INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("#' . date('d.m.Y') . ' %' . date(
'H:i:s'
) . ': <b>' . mysql_real_escape_string($t) . '</b>","capitalcity","Èãðîìèð","6","1","-1")'
);
}
public function setOnline($online, $uid, $afk)
public function setOnline($online, $uid)
{
$add = 0;
@ -45,7 +45,9 @@ class Filter
$on['time_today'] += $add;
}
$add = $on['time_all'] + $add;
mysql_query('UPDATE `online` SET `mainTime` = "' . $mt . '",`time_today` = "' . $on['time_today'] . '",`lastUp` = "' . $lst . '",`time_all` = "' . $add . '" WHERE `id` = "' . $on['id'] . '" LIMIT 1');
mysql_query(
'UPDATE `online` SET `mainTime` = "' . $mt . '",`time_today` = "' . $on['time_today'] . '",`lastUp` = "' . $lst . '",`time_all` = "' . $add . '" WHERE `id` = "' . $on['id'] . '" LIMIT 1'
);
}
}
}
@ -93,8 +95,7 @@ class Filter
$spam = mysql_fetch_array(mysql_query('SELECT * FROM `spam_word` WHERE `id` = 1 LIMIT 1'));
$spam = $spam['data'];
//
$testEN = preg_replace('/[^a-z]*/i', '', $txt);
$testEN = preg_replace('/[^A-Z]*/i', '', $txt);
$testEN = preg_replace('/[^A-z]*/i', '', $txt);
$testEN2 = $txt;
$testEN2 = str_replace('&quot;', '', $testEN2);
@ -116,10 +117,8 @@ class Filter
$testEN2 = str_replace('ÿ', '9', $testEN2);
$testEN2 = str_replace('()', 'o', $testEN2);
$testEN2 = str_replace('0', 'o', $testEN2);
$testEN2 = preg_replace('/[^a-z]*/i', '', $testEN2);
$testEN2 = preg_replace('/[^A-Z]*/i', '', $testEN2);
$testRU = preg_replace('/[^à-ÿ]*/i', '', $txt);
$testRU = preg_replace('/[^À-ß]*/i', '', $txt);
$testEN2 = preg_replace('/[^A-z]*/i', '', $testEN2);
$testRU = preg_replace('/[^À-ÿ]*/i', '', $txt);
$testRU2 = $txt;
$testRU2 = str_replace('a', 'à', $testRU2);
@ -143,15 +142,9 @@ class Filter
$i = 0;
$spe = explode('|', $spam);
while ($i <= count($spe)) {
if (
isset($spe[$i]) &&
$spe[$i] != '' &&
$spe[$i] != 'new-combats.com' &&
(
stristr($testEN, $spe[$i]) ||
stristr($testRU, $spe[$i])
)
) {
if (isset($spe[$i]) && $spe[$i] != '' && $spe[$i] != 'new-combats.com' && (stristr(
$testEN, $spe[$i]
) || stristr($testRU, $spe[$i]))) {
$nospam .= '%' . $spe[$i];
}
$i++;
@ -164,5 +157,3 @@ class Filter
trigger_error('Äóáëèðîâàíèå íå äîïóñêàåòñÿ.', E_USER_ERROR);
}
}
$filter = new Filter();

View File

@ -0,0 +1,245 @@
<?php
/**@deprecated âðîäå íèãäå íå âûçûâàåòñÿ, íèêåì íå èñïîëüçóåòñÿ */
class GameDealer
{
//Êîíôèãóðàöèè
private $c = [
'db_name' => 'pay_operations', //Òàáëèöà â êîòîðóþ çàíîñÿòñÿ äàííûå
'db_host' => 'localhost',
'db_user' => 'newcom1_abk',
'db_pass' => '4nWYsIM[c?}P',
'db_base' => 'newcom1_abk', /* Íàñòðîéêè ïëàòåæåé */
'ip_list' => ['127,0,0,1,188.166.34.68,136.243.38.147,136.243.38.149,136.243.38.150,136.243.38.151,136.243.38.189,88.198.88.98'], //Óêàçûâàòü ÷åðåç çàïÿòóþ (Ðàçðåøåííûå IP)
'key' => 'qtzl0igb', //gamedealer key
'id' => '65643' //ID ïðîåêòà
], $BACK = []; //Ðåçóëüòàò êîòîðûé âîçâðàùàåì â êîíöå
//Êîäèðóåì èç ÞÒÔ-8 â Êèðèëèöó
public function in($text)
{
return iconv("UTF-8", "cp1251", $text);
}
//Êîäèðóåì èç Êèðèëèöó â ÞÒÔ-8
public function out($text)
{
return iconv("cp1251", "UTF-8", $text);
}
//Äîáàâëÿåì äàííûå â áàçó äàííûõ
public function add($type, $value, $money)
{
mysql_query('INSERT INTO `' . $this->c['db_name'] . '` (`time`,`type`,`ip`,`value`,`money`,`project`) VALUES ("' . time() . '","' . mysql_real_escape_string($type) . '","' . $_SERVER['HTTP_X_REAL_IP'] . '","' . mysql_real_escape_string($value) . '","' . mysql_real_escape_string($money) . '","' . mysql_real_escape_string($this->id) . '")');
}
//Ïîäêëþ÷àåìñÿ ê áàçå äàííûõ
public function connect_db()
{
$db = mysql_connect($this->c['db_host'], $this->c['db_user'], $this->c['db_pass']) or die('Îøèáêà ïîäêëþ÷åíèÿ ê MySQL ñåðâåðó!');
mysql_select_db($this->c['db_base'], $db) or die('Îøèáêà ïîäêëþ÷åíèÿ ê áàçå äàííûõ!');
mysql_query('SET NAMES cp1251');
}
public function output($a, $v = null)
{
$r = '';
$i = 0;
while ($i < count($a)) {
$rn = '';
$tb = '';
if ($v != null) {
$rn = "\r\n";
$tb = " ";
}
$r .= $rn . '<' . $a[$i][0] . '>';
if (!is_array($a[$i][1])) {
$rn = '';
$tb = '';
$r .= $rn . $tb . ($this->out($a[$i][1]));
} else {
if ($i > 0) {
$r .= $rn;
}
$r .= $tb . ($this->output($a[$i][1], 1));
}
$r .= $rn . '</' . $a[$i][0] . '>';
$i++;
}
return $r;
}
//Ãåíåðèðóåì XML-ôàéë
public function backInformation()
{
header('Content-Type: text/html/force-download');
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo $this->output($this->BACK, 1);
}
//Ïðîâåðêà ñóùåñòâîâàíèÿ ïåðñîíàæà
public function test_accaunt($nick)
{
$r = false;
$nick = mysql_fetch_array(mysql_query('SELECT `id` FROM `bank` WHERE `id` = "' . mysql_real_escape_string($nick) . '" LIMIT 1'));
if (isset($nick['id'])) {
$r = true;
}
return $r;
}
//Ïîëó÷àåò ñ÷åò â áàíêå ïî ëîãèíó
public function getBank($nick)
{
$nick = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "' . mysql_real_escape_string($nick) . '" LIMIT 1'));
$nick = mysql_fetch_array(mysql_query('SELECT `id` FROM `bank` WHERE `uid` = "' . mysql_real_escape_string($nick['id']) . '" LIMIT 1'));
return $nick['id'];
}
//Ïîèñê ëîãèíà
public function bank_user($nick)
{
$nick = mysql_fetch_array(mysql_query('SELECT `id`,`uid FROM `bank` WHERE `id` = "' . mysql_real_escape_string($nick) . '" LIMIT 1'));
$nick = mysql_fetch_array(mysql_query('SELECT `id`,`login` FROM `users` WHERE `login` = "' . mysql_real_escape_string($nick['uid']) . '" LIMIT 1'));
return $nick['login'];
}
//Íà÷èíàåì îáðàáîòêó çàïðîñîâ
public function start_session()
{
$ip = '';
$ip = $_SERVER['HTTP_X_REAL_IP'];
//Ïîäêëþ÷àåìñÿ ê ÁÄ
$this->connect_db();
//Ïîëó÷àåì äàííûå çàïðîñà
//$xml = file_get_contents('php://input');
//Ïàðñèíã XML çàïðîñà
if (function_exists('simplexml_load_string')) {
$xml = simplexml_load_string($xml);
} else {
$this->BACK = [['gdanswer', [['status', '-1'], ['desc', 'Íå óäàëîñü ïðîèçâåñòè îáðàáîòêó çàïðîñà']]]];
die($this->backInformation());
}
$this->id = $xml->projectid;
if (!in_array($ip, $this->c['ip_list'])) {
$this->BACK = [['gdanswer', [['status', '-1'], ['desc', 'Íåò äîñòóïà ñ äàííîãî IP']]]];
die($this->backInformation());
}
//Îáðàáîòêà çàïðîñîâ
if ($xml->method == 'check_balance') {
//<sign>MD5(method+MD5(gdKey))</sign>
$sign = md5($xml->method . md5($this->c['key']));
if ($sign == $xml->sign) {
//Áàëàíñ äèëåðà
$balance = 1000000;
$this->BACK = [['gdanswer', [['status', '1'], ['desc', 'Áàëàíñ äèëåðà: ' . $balance], ['balance', $balance]]]];
$this->add('4', 'check:' . $xml->nick . ':1' . $r, 0);
}
} elseif ($xml->method == 'check') {
/*
nick - ëîãèí ïåðñîíàæà <sign>MD5(nick+method+MD5(gdKey))</sign> */
$sign = md5($xml->nick . $xml->method . md5($this->c['key']));
if ($sign == $xml->sign) {
$xml->nick = $this->in($xml->nick);
if ($this->test_accaunt($xml->nick) == true) {
//Ïåðñîíàæ íàéäåí è çà÷èñëÿåì åìó èãðîâóþ âàëþòó
$this->BACK = [['gdanswer', [['status', '1'], ['desc', 'Áàíêîâñêèé ñ÷åò íàéäåí']]]];
$this->add('3', 'check:' . $xml->nick . ':1' . $r, 0);
} else {
//Ïåðñîíàæ íå íàéäåí
$this->BACK = [['gdanswer', [['status', '-1'], ['desc', 'Ïëàòåæ íå îáðàáîòàí. Áàíêîâñêèé ñ÷åò íå íàéäåí.']]]];
$this->add('-1', 'Ïåðñîíàæ íå íàéäåí:pay:' . $xml->nick . ':0', 0);
}
}
} elseif ($xml->method == 'pay') {
/* Ïðîâîäèì ïëàòåæ
nick - ëîãèí àêêàóíòà , projectid - id ïðîåêòà , sign , amount - äåíüãè , payid - id ïëàòåæà */
$sign = md5($xml->nick . $xml->projectid . $xml->amount . $xml->payid . $xml->method . md5($this->c['key']));
if ($sign == $xml->sign) {
$xml->nick = $this->in($xml->nick);
if ($this->test_accaunt($xml->nick)) {
//Ïåðñîíàæ íàéäåí è çà÷èñëÿåì åìó èãðîâóþ âàëþòó
$bank = $this->test_accaunt($xml->nick);
if ($bank > 0) {
mysql_query('UPDATE `bank` SET `money2` = `money2` + ' . mysql_real_escape_string($xml->amount) . ' WHERE `id` = "' . mysql_real_escape_string($xml->nick) . '" LIMIT 1');
$this->BACK = [['gdanswer', [['status', '1'], ['desc', 'Ïëàòåæ ïðîøåë óñïåøíî'], ['id', $this->c['id']]]]];
$this->add('2', 'pay:' . $xml->nick . ':' . $xml->projectid . ':' . $xml->sign . ':' . $xml->amount . ':' . $xml->payid . ':' . $bank['id'], $xml->amount);
$user = mysql_fetch_array(mysql_query('SELECT `id`,`uid` FROM `bank` WHERE `id` = "' . mysql_real_escape_string($xml->nick) . '" LIMIT 1'));
$user = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`city`,`sex`,`room` FROM `users` WHERE `id` = "' . mysql_real_escape_string($user['uid']) . '" LIMIT 1'));
mysql_query('UPDATE `users` SET `catch` = `catch` + ' . mysql_real_escape_string(floor($xml->amount)) . ' WHERE `id` = "' . mysql_real_escape_string($xml->nick) . '" LIMIT 1');
$r = '<span class=date>' . date('d.m.Y H:i') . '</span> Àëõèìèê <img src=https://img.new-combats.com/i/align/align50.gif width=12 height=15 /><u><b>Enchanter</b> / Àâòîìàòè÷åñêàÿ îïëàòà</u> ñîîáùàåò: ';
if ($user['sex'] == 1) {
$r .= 'Óâàæàåìàÿ';
} else {
$r .= 'Óâàæàåìûé';
}
$r .= ' <b>' . $user['login'] . '</b>, íà Âàø áàíêîâñêèé ñ÷åò ¹' . $bank . ' çà÷èñëåíî ' . $xml->amount . ' Ekr. Áëàãîäàðèì Âàñ çà ïîêóïêó!';
mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $user['city'] . "','" . $user['room'] . "','','" . $user['login'] . "','" . $r . "','-1','5','0')");
} else {
$this->BACK = [['gdanswer', [['status', '-1'], ['desc', 'Ó ïîëüçîâàòåëÿ îòñóòñòâóåò áàíê'], ['id', $this->c['id']]]]];
$this->add('-1', 'Ó ïåðñîíàæà îòñóòñòâóåò áàíê:pay:' . $xml->nick . ':' . $xml->projectid . ':' . $xml->sign . ':' . $xml->amount . ':' . $xml->payid . ':' . $bank['id'], $xml->amount);
}
} else {
//Ïåðñîíàæ íå íàéäåí
$this->BACK = [['gdanswer', [['status', '-1'], ['desc', 'Ïëàòåæ íå îáðàáîòàí. Ïåðñîíàæ íå íàéäåí.']]]];
$this->add('-1', 'Ïåðñîíàæ íå íàéäåí:pay:' . $xml->nick . ':0', 0);
}
} else {
//Îøèáêà ñèãíàòóðû
$this->BACK = [['gdanswer', [['status', '-1'], ['desc', 'Îøèáêà ñèãíàòóðû']]]];
$this->add('-1', 'Îøèáêà ñèãíàòóðû:pay:' . $xml->nick . ':0', 0);
}
} elseif ($xml->method == 'check_login') {
/* Ïðîâåðêà àêêàóíòà
nick - ëîãèí àêêàóíòà , projectid - id ïðîåêòà , sign */
$sign = md5($xml->nick . $xml->method . md5($this->c['key']));
if ($sign == $xml->sign) {
$xml->nick = $this->in($xml->nick);
if ($this->test_accaunt($xml->nick)) {
//Ïåðñîíàæ íàéäåí
$this->BACK = [['gdanswer', [['status', '1'], ['desc', 'Ñ÷åò íàéäåí'], ['addinfo', $this->bank_user($xml->nick)]]]];
$this->add('1', 'check_login:' . $xml->nick . ':1' . $r, 0);
} else {
//Ïåðñîíàæ íå íàéäåí
$this->BACK = [['gdanswer', [['status', '-1'], ['desc', 'Ñ÷åò íå íàéäåí']]]];
$this->add('-1', 'Ïåðñîíàæ íå íàéäåí:check_login:' . $xml->nick . ':0', 0);
}
} else {
//Îøèáêà ñèãíàòóðû
$this->BACK = [['gdanswer', [['status', '-1'], ['desc', 'Îøèáêà ñèãíàòóðû']]]];
$this->add('-1', 'Îøèáêà ñèãíàòóðû:pay:' . $xml->nick . ':0', 0);
}
} else {
$this->BACK = [['gdanswer', [['status', '-1'], ['desc', 'Íåèçâåñòíûé òèï çàïðîñà']]]];
$this->add('-1', 'Íåèçâåñòíûé òèï çàïðîñà:error_method:gamedealer', 0);
}
//Âîçâðàùàåì ðåçóëüòàò
$this->backInformation();
}
}
$pay = new GameDealer;
$pay->start_session();

View File

@ -93,7 +93,7 @@ class Achievements
],
];
public function __construct(\user $user)
public function __construct(\User $user)
{
$this->user = $user;
$this->info = Db::getRow('select * from users_achiv where id = ?', [$user->info['id']]);

View File

@ -0,0 +1,16 @@
<?php
use Insallah\Tournament;
require_once 'Core/Db.php';
require_once 'Core/Math.php';
require_once 'Core/Table.php';
require_once 'Runes/Runes.php';
require_once 'Tournament/Tournament.php';
require_once 'Tournament/TournamentModel.php';
require_once 'Achievements.php';
//Âìåñòî êðîíà äëÿ òóðíèðà.
if (Tournament::IS_ENABLED) {
(new Tournament())->startAllBattles();
}

View File

@ -3,6 +3,7 @@
namespace Insallah;
use Exception;
use http\Message;
use PDO;
use PDOException;
use PDOStatement;
@ -35,17 +36,18 @@ class Db
* DB constructor.
* @throws Exception
*/
public function __construct(){
public function __construct()
{
if (self::$instance === null) {
try {
self::$db = new PDO(
'mysql:host='.self::DB_HOST.';dbname='.self::DB_NAME,
'mysql:host=' . self::DB_HOST . ';dbname=' . self::DB_PREFIX . self::DB_NAME,
self::DB_USER,
self::DB_PASSWORD,
$options = [
[
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES ".self::CHARSET
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES " . self::CHARSET,
]
);
} catch (PDOException $e) {
@ -59,7 +61,8 @@ class Db
* @param $stmt
* @return PDOStatement
*/
public static function query($stmt) {
public static function query($stmt)
{
return self::$db->query($stmt);
}
@ -67,7 +70,8 @@ class Db
* @param $stmt
* @return PDOStatement
*/
public static function prepare($stmt) {
public static function prepare($stmt)
{
return self::$db->prepare($stmt);
}
@ -75,14 +79,16 @@ class Db
* @param $query
* @return int
*/
static public function exec($query) {
static public function exec($query)
{
return self::$db->exec($query);
}
/**
* @return string
*/
static public function lastInsertId() {
static public function lastInsertId()
{
return self::$db->lastInsertId();
}
@ -92,7 +98,8 @@ class Db
* @return PDOStatement
* @throws Exception
*/
public static function run($query, $args = []) {
public static function run($query, $args = [])
{
try {
if (!$args) {
return self::query($query);
@ -109,8 +116,10 @@ class Db
* @param $query
* @param array $args
* @return mixed
* @throws Exception
*/
public static function getRow($query, $args = []) {
public static function getRow($query, $args = [])
{
return self::run($query, $args)->fetch();
}
@ -118,8 +127,10 @@ class Db
* @param $query
* @param array $args
* @return array
* @throws Exception
*/
public static function getRows($query, $args = []) {
public static function getRows($query, $args = [])
{
return self::run($query, $args)->fetchAll();
}
@ -127,8 +138,10 @@ class Db
* @param $query
* @param array $args
* @return mixed
* @throws Exception
*/
public static function getValue($query, $args = []) {
public static function getValue($query, $args = [])
{
$result = self::getRow($query, $args);
if (!empty($result)) {
$result = array_shift($result);
@ -140,11 +153,16 @@ class Db
* @param $query
* @param array $args
* @return array
* @throws Exception
*/
public static function getColumn($query, $args = []) {
public static function getColumn($query, $args = [])
{
return self::run($query, $args)->fetchAll(PDO::FETCH_COLUMN);
}
/**
* @throws Exception
*/
public static function sql($query, $args = [])
{
self::run($query, $args);

View File

@ -21,7 +21,12 @@ class Math
{
return [
'min' => $number * ((100 - 20) / 100),
'max' => $number * ((100 + 20) / 100)
'max' => $number * ((100 + 20) / 100),
];
}
public static function addPercent($num, $percent)
{
return $num + (($percent / 100) * $num);
}
}

View File

@ -207,6 +207,11 @@ class TournamentModel
battle_users.battle = last_battle.id and
battle_users.team != last_battle.team_win and
battle_users.uid in (select uid from tournaments_users where death_time = 0)';
$query2 = 'select bu.uid from battle b
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);
return $row['uid'];
@ -222,9 +227,9 @@ class TournamentModel
public static function removeFighter($uid, $winner = false)
{
if (!$uid) return;
$winner_timer_add = $winner? 500 : 0; # Ïîñëåäíûé ÄÎËÆÅÍ áûòü ïîñëåäíèì.
//$winner_timer_add = $winner? 500 : 0; # Ïîñëåäíûé ÄÎËÆÅÍ áûòü ïîñëåäíèì.
$db = new Db();
$db::sql('update tournaments_users set death_time = unix_timestamp() + ? where death_time = 0 and uid = ?', [$winner_timer_add, $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]);

View File

@ -1,11 +1,4 @@
<?php
if (!defined('GAME')) {
die();
}
ignore_user_abort(true);
if (isset($_POST['useitemon'])) {
$_GET['login'] = $_POST['useitemon'];
}
class Magic
{
@ -14,6 +7,13 @@ class Magic
public $c_magic = [4174, 4175, 4176, 4177, 4178, 4179, 4180];
public $e_magic = [4185, 4186, 4187];
public function __construct() {
ignore_user_abort(true);
if (isset($_POST['useitemon'])) {
$_GET['login'] = $_POST['useitemon'];
}
}
public function inBattleLog($txt, $usr = null)
{
global $u;
@ -30,26 +30,23 @@ class Magic
//Использование предмета
public function useItems($id)
{
global $u, $c, $code, $btl, $e_magic, $c_magic;
global $u, $btl;
$itm = mysql_fetch_array(mysql_query('SELECT `iu`.`id` AS `iuid`,`im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid` = "' . $u->info['id'] . '" AND `iu`.`inShop`="0" AND `iu`.`delete`="0" AND `iu`.`id` = "' . mysql_real_escape_string((int)$id) . '" LIMIT 1'));
$bs_is = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `id` = "' . $u->info['inTurnir'] . '" LIMIT 1'));
if (isset($itm['id'])) {
if ($itm['group'] == 1) {
//Группа предметов
if ($u->itemsX($itm['id']) > 1) {
if ($itm['group'] == 1 && $u->itemsX($itm['id']) > 1) {
//вытаскиваем предмет из группы
$u->unstack($itm['id'], 1);
}
}
$st = $u->lookStats($itm['data']);
if (isset($st['tr_lvl']) && $st['tr_lvl'] > $u->info['level']) {
$u->error = 'Вы слишком малы чтобы использовать данный предмет ';
$err = 'Вы слишком малы чтобы использовать данный предмет';
return $err;
return 'Вы слишком малы чтобы использовать данный предмет';
}
if ($itm['magic_chance'] > 0 && $itm['magic_chance'] < 100) {
@ -58,14 +55,14 @@ class Magic
$itm['magic_chance'] = 99;
}
}
if (isset($bs_is['id'])) {
if (in_array($itm['item_id'], $e_magic) || in_array($itm['item_id'], $c_magic)) {
if (isset($bs_is['id']) && (in_array($itm['item_id'], $this->e_magic) || in_array(
$itm['item_id'], $this->c_magic
))) {
$itm['magic_chance'] += $bs_is['users'];
if ($itm['magic_chance'] >= 99) {
$itm['magic_chance'] = 99;
}
}
}
if ($itm['iznosNOW'] >= $itm['iznosMAX']) {
$u->error = 'Не осталось зарядов...';
@ -1993,7 +1990,3 @@ class Magic
return $good;
}
}
$magic = new Magic;
?>

File diff suppressed because one or more lines are too long

2848
_incl_data/class/Priems.php Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,8 @@
<?
if (!defined('GAME')) {
die();
}
<?php
class quests
class Quests
{
public $free_x = 28, $data = [];
private $free_x = 28;
/* Ïðîâåðêà äîñòóïíîñòè êâåñòà */
public function testGood($pl)
@ -577,10 +574,6 @@ class quests
return $r;
}
/** Íåèçâåñòíî ïî÷åìó ëîìàåò ïëàâêó ðóí.
* PHP Fatal error: Call to a member function testquest() on a non-object
* @return void
*/
public function testquest()
{
global $u;
@ -885,7 +878,7 @@ class quests
return $r;
}
public function winQuest($pl)
private function winQuest($pl)
{
global $u, $c, $magic;
@ -1015,5 +1008,3 @@ class quests
return $dr;
}
}
$q = new quests;

View File

@ -0,0 +1,31 @@
<?php
use Insallah\Db;
class Season
{
public static $yy = [
1 => [1, '01', 'ίνβΰπό', 'ίνβΰπόρκθι'],
2 => [2, '02', 'Τεβπΰλό', 'Τεβπΰλόρκθι'],
3 => [3, '03', 'Μΰπς', 'Μΰπςξβρκθι'],
4 => [4, '04', 'ΐοπελό', 'ΐοπελόρκθι'],
5 => [5, '05', 'Μΰι', 'Μΰιρκθι'],
6 => [6, '06', 'Θώνό', 'Θώνόρκθι'],
7 => [7, '07', 'Θώλό', 'Θώλόρκθι'],
8 => [8, '08', 'ΐβγσρς', 'ΐβγσρςξβρκθι'],
9 => [9, '09', 'Ρενς<CEBD>από', 'Ρενς<CEBD>απόρκθι'],
10 => [10, '10', 'Ξκς<CEBA>από', 'Ξκς<CEBA>απόρκθι'],
11 => [11, '11', 'Νξ<CE9D>από', 'Νξ<CE9D>απόρκθι'],
12 => [12, '12', 'Δεκΰαπό', 'Δεκΰαπόρκθι'],
];
public static $date = [];
public static $m = [];
public static function data($val)
{
self::$m = Db::getRow('select * from sss_m where id = ?', [$val]);
if (self::$m['s'] != self::$date['m']) {
self::$m = [];
}
}
}

View File

@ -0,0 +1,170 @@
<?php
class Telegram
{
private static $instance;
/**Singletone*/
public static function start()
{
if (!isset(self::$instance)) {
self::$instance = new self();
}
return self::$instance;
}
private function send($to, $from, $text, $fromType)
{
mysql_query('START TRANSACTION');
$ins = mysql_query("INSERT INTO `telegram` (`uid`,`from`,`fromType`,`text`,`time`) VALUES ('" . $to . "','" . $from . "','" . $fromType . "','" . mysql_real_escape_string(AddSlashes(HtmlSpecialChars($text, null, 'cp1251'))) . "','" . time() . "')");
mysql_query('COMMIT');
if ($ins) {
return mysql_insert_id();
}
}
public function readMsg($id, $uid)
{
$msg = mysql_fetch_array(mysql_query('SELECT * FROM `telegram` WHERE `id`="' . $id . '" AND `uid`="' . $uid . '" LIMIT 1 FOR UPDATE'));
if (isset($msg['id'])) {
mysql_query('START TRANSACTION');
$upd = mysql_query('UPDATE `telegram` SET `read`="1" WHERE `id` = "' . $id . '" AND `uid`="' . $uid . '" LIMIT 1');
mysql_query('COMMIT');
if ($upd && $msg['lock'] == 0) {
echo '<script>readGood(' . $id . ',"https://img.new-combats.com/i/misc/read.gif"); nobtext(' . $id . ');</script>';
}
}
}
public function lockMsg($id, $uid)
{
$msg = mysql_fetch_array(mysql_query('SELECT * FROM `telegram` WHERE `id`="' . $id . '" AND `uid`="' . $uid . '" LIMIT 1 FOR UPDATE'));
if (isset($msg['id'])) {
$lock = [0 => 1, 1 => 0];
mysql_query('START TRANSACTION');
$upd = mysql_query('UPDATE `telegram` SET `read`="1",`lock`="' . $lock[$msg['lock']] . '" WHERE `id` = "' . $id . '" AND `uid`="' . $uid . '" LIMIT 1');
mysql_query('COMMIT');
if ($upd) {
if ($lock[$msg['lock']] == 1) {
echo '<script>readGood(' . $id . ',"https://img.new-combats.com/i/lock_message.gif"); nobtext(' . $id . ');</script>';
} else {
echo '<script>readGood(' . $id . ',"https://img.new-combats.com/i/misc/read.gif");</script>';
}
}
}
}
public function deleteMsgAll($uid, $pg)
{
mysql_query('START TRANSACTION');
$upd = mysql_query('UPDATE `telegram` SET `delete`="1" WHERE `uid`="' . $uid . '" AND `read`="1" AND `lock`="0" AND `delete`="0"');
mysql_query('COMMIT');
if ($upd) {
echo '<script> getPage(' . $pg . ');</script>';
}
}
public function deleteMsg($id, $uid, $pg)
{
$msg = mysql_fetch_array(mysql_query('SELECT * FROM `telegram` WHERE `id`="' . $id . '" AND `uid`="' . $uid . '" LIMIT 1 FOR UPDATE'));
if (isset($msg['id'])) {
mysql_query('START TRANSACTION');
$upd = mysql_query('UPDATE `telegram` SET `delete`="1" WHERE `id` = "' . $id . '" AND `uid`="' . $uid . '" LIMIT 1');
mysql_query('COMMIT');
if ($upd && $msg['delete'] == 0 && $msg['lock'] == 0) {
echo '<script> getPage(' . $pg . ');</script>';
}
}
}
private function addMsgTable($id, $from, $fromType, $ttl, $time, $lock, $read, $pg)
{
$i1 = '<img id="msgImg' . $id . '" src="https://img.new-combats.com/i/misc/unread.gif">';
if ($read == 1) {
$i1 = '<img id="msgImg' . $id . '" src="https://img.new-combats.com/i/misc/read.gif">';
}
if ($lock == 1) {
$i1 = '<img id="msgImg' . $id . '" src="https://img.new-combats.com/i/lock_message.gif">';
}
if ($fromType == 1) {
$from = '<a href="info/login=' . $from . '" target="_blank" title="Èíô. î ' . $from . '">' . $from . '</a>';
} elseif ($read == 0) {
$from = '<b id="tablePostTxtB' . $id . '">' . $from . '</b>';
}
echo '<table id="tablePost' . $id . '" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30" class="underLine2"><div align="center">' . $i1 . '</div></td>
<td width="200" id="tablePostTxt' . $id . '" class="underLine2">' . $from . '</td>
<td width="290" class="underLine2"><a onClick="openPost(' . $id . '); return false;" href="#read' . $id . '" title="Ïðî÷èòàòü ñîîáùåíèå">' . substr($ttl, 0, 30) . '...</a></td>
<td width="120" class="underLine2">' . date('d.m.y H:i', $time) . '</td>
<td width="30" class="underLine2"><div align="center"><IMG style="cursor:pointer;" onClick="lockPost(' . $id . ');" title="Áëîêèðîâêà ñîîáùåíèÿ" src="https://img.new-combats.com/i/locked.gif"></div></td>
<td width="30" class="underLine2"><div align="center"><IMG style="cursor:pointer;" onClick="deletePost(' . $id . ',' . $pg . ');" title="Óäàëèòü ñîîáùåíèå" src="https://img.new-combats.com/i/clear.gif" width="11" height="11"></div></td>
</tr>
</table>
<div id="readMSG' . $id . '" style="display:none;" class="unreadMSG">' . $ttl . '</div>';
}
public function seeMsg($uid, $page, $maxPages)
{
$page = ceil($page);
echo '<div id="jx" style="display:none;"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30" class="underLine"><div align="center"></div></td>
<td width="200" class="underLine"><b>Îò êîãî</b></td>
<td width="290" class="underLine"><b>Çàãîëîâîê ñîîáùåíèÿ</b></td>
<td width="120" class="underLine"><b>Êîãäà</b></td>
<td width="30" class="underLine"><div align="center"><IMG alt="Áëîêèðîâêà ñîîáùåíèé" src="https://img.new-combats.com/i/lock_message.gif"></div></td>
<td width="30" class="underLine"><div align="center"><IMG style="cursor:pointer;" onClick="deletePostAll(' . $page . ');" alt="Óäàëèòü âñå ïðî÷èòàííûå ñîîáùåíèÿ" src="https://img.new-combats.com/i/clear.gif" width="11" height="11"></div></td>
</tr>
</table>';
$i = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `telegram` WHERE `uid`="' . $uid . '" AND `delete`="0"'));
$pg = ceil($i[0] / $maxPages);
if ($page < 0) {
$page = 0;
} elseif ($page > $pg) {
$page = $pg;
}
if ($i[0] > 0) {
$sp = mysql_query('SELECT * FROM `telegram` WHERE `uid`="' . $uid . '" AND `delete`="0" ORDER BY `id` DESC LIMIT ' . (($page - 1) * $maxPages) . ' , ' . $maxPages . '');
while ($pl = mysql_fetch_array($sp)) {
$this->addMsgTable($pl['id'], $pl['from'], $pl['fromType'], $pl['text'], $pl['time'], $pl['lock'], $pl['read'], $page);
}
}
if ($i[0] == 0) {
echo '<div class="noMsg" align="center">Ñîîáùåíèé íåò</div>';
} elseif ($i[0] > $maxPages) {
$pages = '';
$i = 1;
while ($i <= $pg) {
$cls = '';
if ($page == $i) {
$cls = 'style="color:#6f0000; font-size:14px;"';
}
$pages .= '&nbsp;<a ' . $cls . ' onClick="getPage(' . $i . '); return false;" href="#page' . $i . '">' . $i . '</a>';
$i++;
}
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30"><div align="center"></div></td>
<td width="200">Ñòðàíèöû: ' . $pages . '</td>
<td width="240"></td>
<td width="170"></td>
<td width="30"></td>
<td width="30"></td>
</tr>
</table>';
}
}
public function __clone()
{
trigger_error('Äóáëèðîâàíèå íå äîïóñêàåòñÿ.', E_USER_ERROR);
}
}

View File

@ -0,0 +1,491 @@
<?php
if (!defined('GAME')) {
die();
}
class Tournir
{
private $u;
private $info;
private $user;
private $name = [0 => 'Âûæèòü ëþáîé öåíîé', 1 => 'Êàæäûé ñàì çà ñåáÿ', 2 => 'Çàõâàò êëþ÷à',];
public function __construct()
{
$this->u = User::start();
$this->start();
$this->locationSee();
}
private function start()
{
$this->info = mysql_fetch_array(mysql_query('SELECT * FROM `turnirs` WHERE `id` = "' . $this->u->info['inTurnirnew'] . '" LIMIT 1'));
$this->user = mysql_fetch_array(mysql_query('SELECT * FROM `users_turnirs` WHERE `turnir` = "' . $this->u->info['inTurnirnew'] . '" AND `bot` = "' . $this->u->info['id'] . '" LIMIT 1'));
}
private function startTurnir()
{
$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) {
if ($this->info['status'] == 3) {
$this->finishTurnir();
}
} else {
mysql_query('UPDATE `turnirs` SET `status` = "3" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
//Ñîçäàíèå ïîåäèíêà
mysql_query('INSERT INTO `battle` (`city`,`time_start`,`timeout`,`type`,`turnir`) VALUES ("' . $this->u->info['city'] . '","' . time() . '","60","1","' . $this->info['id'] . '")');
$uri = mysql_insert_id();
//Çàêèäûâàåì ïåðñîíàæåé â ïîåäèíîê
mysql_query('UPDATE `users` SET `battle` = "' . $uri . '" WHERE `inUser` = "0" AND `inTurnirnew` = "' . $this->info['id'] . '"');
//Îáîçíà÷àåì çàâåðøåíèå òóðíèðà ïðè âûõîäå
die('Ïåðåéòèäå â ðàçäåë "ïîåäèíêè"...');
}
}
private function finishTurnir()
{
$this->info = mysql_fetch_array(mysql_query('SELECT * FROM `turnirs` WHERE `id` = "' . $this->u->info['inTurnirnew'] . '" LIMIT 1'));
if ($this->info['status'] == 3) {
$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_expn'] = 3000;
$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>, ';
$r = 'Òóðíèð çàâåðøåí. Âû ÿâëÿåòåñü ïîáåäèòåëåì òóðíèðà, ïîëó÷åíî îïûòà: <b>' . $inf['add_expn'] . '</b>.';
mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','" . $inf['room'] . "','','" . $inf['login'] . "','" . $r . "','" . time() . "','6','0')");
} 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'])) . ').';
}
$r = '<font color=black><b>Òóðíèð çàâåðøåí.</b></font> ' . $win;
mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','" . $r . "','" . time() . "','6','0')");
}
}
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'] . ',';
//$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>
<?
$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="https://img.new-combats.com/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

@ -0,0 +1,174 @@
<?php
/**
* Åäèíàÿ ôóíêöèÿ äëÿ çàëèâêè ôàéëîâ íà ñåðâåð.
*
* @version 1
* @author Ivor Barhansky <me@lopar.space>
*/
class Uploader
{
private $width = ['min' => 0, 'max' => 0];
private $height = ['min' => 0, 'max' => 0];
private $maxFileSizeMb;
private $savePath;
private $extensions = 'jpg|png|jpeg|gif';
private $extMatches = [];
private $FILE;
private $cnm = null;
public static $error;
public function __construct($name, $cnm = null)
{
$this->FILE = $_FILES;
if (!$this->FILE[$name]) {
return;
}
$this->cnm = $cnm;
}
/**
* @param int $max
* @param int $min
* @return void
*/
public function setWidth($max, $min = null)
{
$this->width['min'] = is_null($min) ? $max : $min;
$this->width['max'] = $max;
}
/**
* @param int $max
* @param int $min
* @return void
*/
public function setHeight($max, $min = null)
{
$this->height['min'] = is_null($min) ? $max : $min;
$this->height['max'] = $max;
}
/**
* @param $megabytes
* @return void
*/
public function setMaxFileSize($megabytes)
{
$this->maxFileSizeMb = $megabytes * (1024 * 1024);
}
/**
* @param string $path ïóòü îò êîðíÿ äî êîíå÷íîé ïàïêè áåç îòêðûâàþùåãî ñëåøà.
* @return void
*/
public function setSavePath($path)
{
$this->savePath = __DIR__ . '/' . $path;
}
/**
* @param string|array $ext
* @return void
*/
public function setExtentions($ext)
{
if (is_array($ext)) {
$arr = $ext;
} else {
$arr[] = $ext;
}
if (!$arr) {
return;
}
$this->extensions = implode('|', $arr);
}
/**
* @param int $width
* @param int $height
* @return void
*/
public function setDimensions($width, $height)
{
$this->setWidth($width);
$this->setHeight($height);
}
private function hasNormalDimensions()
{
list($width, $height) = getimagesize($this->FILE['tmp_name']);
if (
$width < $this->width['min'] ||
$width > $this->width['max'] ||
$height < $this->height['min'] ||
$height > $this->height['max']
) {
self::$error = "Òðåáîâàíèÿ ê ðàçìåðó [{$this->width['max']}x{$this->height['max']}] íå ñîáëþäåíû.";
if ($this->width['min'] !== $this->width['max'] || $this->height['min'] !== $this->height['max']) {
self::$error .= " Ìèíèìóì [{$this->width['min']}x{$this->height['min']}].";
}
self::$error .= " <span style='color:red;'>[{$width}x$height]</span>";
return false;
}
return true;
}
private function hasNormalFileSize()
{
if (!$this->maxFileSizeMb) {
$this->setMaxFileSize(2);
}
if ($this->FILE['size'] > $this->maxFileSizeMb || $this->FILE['size'] <=0) {
self::$error = 'Íåâåðíûé ðàçìåð ôàéëà. Ìàêñèìàëüíûé ðàçìåð ôàéëà ' . $this->maxFileSizeMb . ' ÌÁ';
return false;
}
return true;
}
private function hasNormalType()
{
if (
!preg_match('/\.(' . $this->extensions . ')$/i', $this->FILE['name'], $this->extMatches) ||
!preg_match('/image/i', $this->FILE['type'])
) {
self::$error = 'Íåâåðíûé òèï ôàéëà. Äîïóñòèìûå òèïû : ' . $this->extensions;
return false;
}
return true;
}
private function hasNormalFilePath()
{
if (!$this->savePath || !is_dir($this->savePath)) {
self::$error = 'Îøèáêà çàãðóçêè: íåò òàêîé ïàïêè.';
return false;
}
return true;
}
private function upload()
{
$this->extMatches[1] = strtolower($this->extMatches[1]);
$fn = uniqid('f_', true) . '.' . $this->extMatches[1];
$fn2 = uniqid('f_', true) . '.gif';
if ($this->cnm) {
$fn = $this->cnm;
$fn2 = $this->cnm;
}
if (!move_uploaded_file($this->FILE['tmp_name'], $this->savePath . $fn)) {
self::$error = 'Îøèáêà çàãðóçêè ôàéëà';
return false;
}
return [$fn2, $fn, $this->savePath . $fn];
}
function saveimg()
{
return $this->hasNormalFilePath() &&
$this->hasNormalDimensions() &&
$this->hasNormalFileSize() &&
$this->hasNormalType() ? $this->upload() : false;
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,28 @@
<?php
class UserRegister
{
public function __construct()
{
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
define('IP', $ip);
if ($_SERVER['HTTP_REFERER'] == 'https://new-combats.com/' && $_COOKIE['acomb1'] != '2') {
setcookie('acomb1', '1', time() + 60 * 60 * 24 * 3);
}
}
public function en_ru($txt)
{
$en = preg_match("/^(([0-9A-z _-])+)$/i", $txt);
$ru = preg_match("/^(([0-9À-ÿ _-])+)$/i", $txt);
return ($ru && $en) || (!$ru && !$en);
}
}

View File

@ -0,0 +1,36 @@
<?php
use Insallah\Db;
class UserStats
{
/**
* Ñîáèðàåò ñóììû âñåõ áîíóñîâ ñ îäåòûõ ïðåäìåòîâ è àêòèâíûõ ýôåêòîâ.
* @param $userId
* @param bool $showAll
* @return array
*/
public static function getAllBonuses($userId, $showAll = false)
{
require_once '_incl_data/class/Insallah/Core/Db.php';
$db = new Db();
$q = 'select data from items_users where uid = ? and inOdet > 0 and `delete` = 0
union all select data from eff_users where uid = ? and `delete` = 0';
$iData = $db::getColumn($q, [$userId, $userId]);
$params = [];
$params2 = json_decode(str_replace(['=', '|'], ['":', ',"'], '{"' . $iData . '}'), true);
foreach ($iData as $datum) {
foreach (explode('|', $datum) as $inner) {
list($a, $b) = explode('=', $inner);
if (strpos($a, 'add') !== false || strpos($a, 'sv') !== false || $showAll) {
if (isset($params[$a])) {
$params[$a] += $b;
} else {
$params[$a] = $b;
}
}
}
}
return $params;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,189 +0,0 @@
<?
if(!defined('GAME'))
{
die();
}
class Chat {
var $smilesWorld = array(
'laugh' => array(0 => 'смеется',1 => 'посмеялся над [*%l*]'),
'fingal' => array(0 => 'трет фингал',1 => 'щупает фингал у [*%l*]'),
'eek' => array(0 => 'ошарашен',1 => 'ошарашен действиями [*%l*]'),
'smoke' => array(0 => 'закуривает',1 => 'предлагает [*%l*] пойти покурить'),
'hi' => array(0 => 'приветствует всех вокруг',1 => 'приветствует [*%l*]'),
'bye' => array(0 => 'прощается со всеми и уходит',1 => 'прощается с [*%l*]'),
'king' => array(0 => 'коронует себя :-)',1 => 'объявляет [*%l*] своим королем!'),
'king2' => array(0 => 'коронует себя :-)',1 => 'объявляет [*%l*] своей королевой!'),
'boks2' => array(0 => 'вызывает всех на поединок',1 => 'предлагает [*%l*] дружеский матч'),
'boks' => array(0 => 'обещает побить любого, кто примет вызов!',1 => 'намекает [*%l*] на поединок'),
'gent' => array(0 => 'предлагает считать себя благородным сэром',1 => 'считает [*%l*] джельтельменом'),
'lady' => array(0 => 'предлагает считать себя благородной леди',1 => 'считает, что [*%l*] настоящая Леди'),
'tongue' => array(0 => 'показывает окружающим язык',1 => 'показывает язык [*%l*]'),
'smil' => array(0 => 'болтает без умолку',1 => 'считает, что [*%l*] говорит откровенную ерунду!'),
'ponder' => array(0 => 'кое-что усиленно обдумывает',1 => 'обещает обмозговать предложение [*%l*]'),
'bow' => array(0 => 'сохраняя достоинство, кивает окружающим',1 => 'сохраняя достоинство кивает [*%l*]'),
'angel' => array(0 => 'считает себя Ангелом',1 => 'считает [*%l*] своим Ангелом'),
'angel2' => array(0 => 'грезит об Ангелах',1 => 'думает что [*%l*] Ангел'),
'hello' => array(0 => 'желает здравствовать окружающим',1 => 'желает здравствовать [*%l*]'),
'dont' => array(0 => 'рекомендует окружающим не делать этого',1 => 'рекомендует [*%l*] не делать этого'),
'idea' => array(0 => 'озарен свежей идеей!',1 => 'предлагает [*%l*] обсудить пару идей'),
'mol' => array(0 => 'преклоняется перед окружающими',1 => 'преклоняется перед [*%l*]'),
'super' => array(0 => 'считает, что мир хорош, все дамы - Леди, а Солнце - шар дающий свет!',1 => 'фанатеет от [*%l*]'),
'beer' => array(0 => 'вспоминает про припрятаный в заначке эликсир...',1 => 'готов поделиться с [*%l*] припрятанным эликсиром!'),
'drink' => array(0 => 'считает, что пора пить различные эликсиры',1 => 'предлагает [*%l*] пойти пропустить по стаканчику эликсира'),
'baby' => array(0 => 'изображает малыша',1 => ' считает, что [*%l*] еще мал и неопытен для обоснованной критики'),
'tongue2' => array(0 => ' показывает всяким врединам язык',1 => 'показывает [*%l*] язык, проявляя недовольство'),
'sword' => array(0 => 'готов сразиться в честном поединке',1 => 'вызывает [*%l*] на честный поединок!'),
'agree' => array(0 => 'пожимает руку собеседникам',1 => 'пожимает руку [*%l*]'),
'loveya' => array(0 => 'преисполнен чувства любви',1 => 'преисполнен чувства любви к [*%l*]'),
'kiss' => array(0 => 'целует всех',1 => 'целует [*%l*]'),
'kiss2' => array(0 => 'хочет нежно поцеловать кого-то...',1 => 'нежно целует [*%l*]'),
'kiss3' => array(0 => 'кое-кого целует...',1 => 'нежно целует [*%l*]'),
'kiss4' => array(0 => 'кое-кого целует...',1 => 'хочет уединиться с [*%l*] и целоваться...'),
'rose' => array(0 => 'хочет кому-то подарить розу, но стесняется...',1 => 'дарит [*%l*] ароматную розу...'),
'love' => array(0 => 'думает только о любви...',1 => 'думает, что [loginfrom] + [*%l*]= любовь!'),
'love2' => array(0 => 'мечтает о свадьбе...',1 => 'мечтает о свадьбе с [*%l*]'),
'confused' => array(0 => 'в недоумении...',1 => 'недоумевает от [*%l*]'),
'yes' => array(0 => 'кивает в знак согласия',1 => 'кивает [*%l*] в знак согласия'),
'no' => array(0 => 'мотает головой в знак протеста',1 => 'мотает головой [*%l*] в знак протеста'),
'shuffle' => array(0 => 'в смущении от таких обстоятельств',1 => 'в смущении от [*%l*]'),
'nono' => array(0 => 'выражает категорическое несогласие!',1 => 'выражает категорическое несогласение с [*%l*]'),
'maniac' => array(0 => 'знает точно наперед - сегодня кто-нибудь умрет...',1 => 'считает, что [*%l*] пора бы уже стать жертвой маньяка...'),
'privet' => array(0 => 'почтительно приветствует окружающих',1 => 'почтительно приветствует [*%l*]'),
'ok' => array(0 => 'считает, что это замечательная идея',1 => 'считает, что [*%l*] движется в правильном направлении'),
'ninja' => array(0 => 'угрожает окружающим тайным мастерством!',1 => 'угрожает [*%l*] мастерством древних'),
'pif' => array(0 => 'ищет подходящую мишень',1 => 'думает, что сложно промахнуться по [*%l*]'),
'smash' => array(0 => 'собирается крушить и ломать',1 => 'хочет сломать пару-тройку костей у [*%l*]'),
'alien' => array(0 => 'считает, что мир захватили мутанты!',1 => ' считает, что [*%l*] еще тот мутант!'),
'pirate' => array(0 => 'подумывает, кого бы ограбить!...',1 => 'считает, что лучшей жертвы чем [*%l*], не найти!'),
'gun' => array(0 => 'хочет повысить кое-кому уровень железа в организме... :gun:',1 => 'считает, что у [*%l*] маловато железа в организме! :gun:'),
'trup' => array(0 => 'падает замертво',1 => 'считает, что [*%l*], живет слишком долго, и пора бы это исправить!'),
'mdr' => array(0 => 'считает, что у него есть отличный способ решения разногласий... :mdr:',1 => 'предлагает [*%l*] культурно отдохнуть :mdr:'),
'sneeze' => array(0 => 'громко чихает',1 => 'чихает на [*%l*], обрызгивая его слюнями с ног до головы!'),
'mad' => array(0 => 'просто в бешенстве!!!',1 => 'в бешенстве от [*%l*]!!!'),
'friday' => array(0 => 'культурно отдыхает...',1 => 'предлагает [*%l*] культурно отдохнуть'),
'cry' => array(0 => 'безудержно рыдает',1 => 'рыдает на плече у [*%l*]'),
'grust' => array(0 => 'грустит...',1 => 'грустит о [*%l*]'),
'rupor' => array(0 => 'пытается докричаться до окружающих',1 => 'пытается докричаться до [*%l*]'),
'fie' => array(0 => 'умоляет: НЕТ, только не ЭТО!!!',1 => 'умоляет [*%l*] о пощаде!'),
'nnn' => array(0 => 'ничего не видит, не слышит, и никому не скажет...',1 => 'ничего не видел, не слышал и не помнит о [*%l*]'),
'row' => array(0 => 'находится в бешенстве и ищет с кем бы пообщаться...',1 => 'собирается выяснить отношения с [*%l*]'),
'red' => array(0 => 'смущаясь краснеет...',1 => 'краснеет от [*%l*]'),
'lick' => array(0 => 'облизнулся, в предвкушении',1 => 'облизывается при виде [*%l*]'),
'help' => array(0 => 'нуждается в срочной помощи!',1 => 'просит помощи у [*%l*]'),
'wink' => array(0 => 'подмигивает окружающим',1 => 'подмигивает [*%l*]'),
'jeer' => array(0 => 'посмеивается над ситуацией...',1 => 'посмеивается над [*%l*]'),
'tease' => array(0 => 'дразнится',1 => 'дразнит [*%l*]'),
'nunu' => array(0 => 'недоволен окружающими...',1 => 'недоволен [*%l*]'),
'inv' => array(0 => 'хочет найти свои зубы...',1 => 'жалуется [*%l*] на трудности жизни инвалида...'),
'duel' => array(0 => 'собирается проткнуть кое-кого...',1 => 'вызывает [*%l*] на дуэль!'),
'susel' => array(0 => 'Напевая: &quot;эээххх ухнеееемм, да ещеее ууухнеем..&quot; высматривает в толпе подходящий пондер...',1 => 'предлагает [*%l*] отхватить прямо по пондеру!'),
'nun' => array(0 => 'угрожает окружающим палочками для риса',1 => 'показывает [*%l*] как надо пользоваться палочками для риса'),
'kruger' => array(0 => 'ненавязчиво объясняет окружающим кого тут надо бояться :kruger:',1 => 'демонстрирует [*%l*] нестриженные когти'),
'flowers' => array(0 => 'учится выхватывать букет Ромашек-21 из-за спины одним движением',1 => 'целует [*%l*] и дарит букет ромашек'),
'horse' => array(0 => 'патрулирует границы Бойцовского Клуба',1 => 'предлагает [*%l*] порубать всех врагов в капусту! :horse:'),
'hug' => array(0 => 'готов обнять всех в комнате!',1 => 'крепко обнимает [*%l*]'),
'str' => array(0 => 'в ужасе покрывается ледяным потом!',1 => 'в ужасе прячется от [*%l*]'),
'alch' => array(0 => 'напоминает окружающим о вечных ценностях :alch:',1 => 'предлагает [*%l*] приобщиться к вечным ценностям :alch:'),
'pal' => array(0 => ' напоминает, что из под робы выпирает крест, а не что-то там! :-)',1 => 'требует от [*%l*] предъявить документы в развернутом виде!'),
'mag' => array(0 => 'читает заклинания. Вслух. По слогам.',1 => 'произносит страшное колдунство на [*%l*]'),
'sniper' => array(0 => 'изображает из себя Вильгельма Теля',1 => 'предлагает [*%l*] поиграть в Вильгельма Теля'),
'fuck' => array(0 => 'повторяет позы камасутры',1 => 'предлагает [*%l*] повторить позы камасутры вместе'),
'rotate' => array(0 => 'катается от смеха по полу',1 => 'катается по полу от смеха над [*%l*]')
);
public function expworld($txt,$vl)
{
$words = explode(' ',$txt); $j = 0; $i = -1;
while($i < count($words))
{
$i++;
if(isset($words[$i]))
{
if(strlen($words[$i]) > $vl){ $words[$i] = substr($words[$i],0,$vl).' '.substr($words[$i],$vl); $i = 0; $j++; $txt = implode(' ', $words); $words = explode(' ',$txt); }
}
}
$txt = implode(' ',$words);
return $txt;
}
public function str_count($str,$col)
{
if (strlen($str) > $col)
{
$str = substr($str,0,$col);
}
return ($str);
}
public function smileText($text,$tol,$room,$city)
{
$retxt = ''; $j = 0;
$txt = str_replace('/','&frasl;',$text).' ';
if(preg_match("/&frasl;(.*?) /", $txt, $retxt))
{
if(isset($this->smilesWorld[$retxt[1]]))
{
if($tol == '')
{
$tol = str_replace('&frasl;'.$retxt[1].' ','',$txt);
$tol = trim($tol,' ');
}
if($tol == '')
{
$txt = ''.$this->smilesWorld[$retxt[1]][0].'';
}else{
$mbl = mysql_fetch_array(mysql_query('SELECT `online`,`id`,`login`,`room`,`city` FROM `users` WHERE `room`="'.$room.'" AND `online` > '.(time()-520).' AND `city` = "'.$city.'" AND `login`="'.mysql_real_escape_string($tol).'" LIMIT 1'));
if(isset($mbl['id']))
{
$txt = ''.$this->smilesWorld[$retxt[1]][1].'';
$txt = str_replace('[*%l*]','[login:'.$tol.']',$txt);
}else{
$txt = 'USER IS FALSE';
}
}
$j = 1;
}
}
if($j == 1)
{
$text = $txt;
}else{
$text = false;
}
return $text;
}
public function send($color,$room,$city,$from,$to,$text,$time,$type,$toChat,$spam,$sound,$new = 0)
{
//mysql_query('LOCK TABLES chat WRITE');
mysql_query("INSERT INTO `chat` (`new`,`sound`,`color`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`spam`) VALUES ('".$new."','".$sound."','".$color."','".$city."','".$room."','".$from."','".$to."','".$text."','".$time."','".$type."','".$toChat."','".$spam."')");
//mysql_query('UNLOCK TABLES');
$msg_id = mysql_insert_id();
return $msg_id;
}
public function jsmsg($id,$time,$to,$from,$type,$ch,$e,$see,$js = 0,$cl = '#000000',$typeTime = NULL)
{
$tm = date('H:i',$time);
if($typeTime==1)
{
$tm = date('d.m.Y H:i',$time);
}
$rt = 'top.addMessage(\''.$id.'\',\''.$tm.'\',\''.$to.' \',\''.$from.'\',\''.$type.'\',\''.$ch.'\'," '.$e.' ",\''.$see.'\',\''.$cl.'\');';
if($js==1)
{
$rt = '<script>'.$rt.'</script>';
}
return $rt;
}
}
$chat = new Chat();
?>

View File

@ -1,28 +1,38 @@
<?php
if(!defined('GAME'))
{
if (!defined('GAME')) {
die();
}
$db = [
's' => 'localhost', // server
'd' => 'newcom1_abk', // database
'u' => 'newcom1_abk', // user
'p' => '4nWYsIM[c?}P' // password
];
$dsn = 'mysql:host=' . $db['s'] . ';dbname=' . $db['d'];
if (function_exists('date_default_timezone_set')) {
date_default_timezone_set('Europe/Moscow');
}
$dbgo = mysql_pconnect('localhost','newcom1_abk','4nWYsIM[c?}P');
mysql_select_db('newcom1_abk',$dbgo);
$dbgo = mysql_pconnect($db['s'], $db['u'], $db['p']);
mysql_select_db($db['d'], $dbgo);
mysql_query('SET NAMES cp1251');
if (!function_exists('GetRealIp')) {
function GetRealIpTest(){
if (!empty($_SERVER['HTTP_CLIENT_IP']))
function GetRealIpTest()
{
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
return $_SERVER['HTTP_CLIENT_IP'];
else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
return $_SERVER['HTTP_X_FORWARDED_FOR'];
}
return $_SERVER['REMOTE_ADDR'];
}
$ipban = GetRealIpTest();
} else {
$ipban = GetRealIp();
}
$pdo = new PDO('mysql:host=localhost;dbname=newcom1_abk', 'newcom1_abk', '4nWYsIM[c?}P');
$pdo = new PDO($dsn, $db['u'], $db['p'], [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES cp1251"]);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,405 +0,0 @@
<?
if(!defined('GAME'))
{
die('/index.php');
}
function GetRealIp()
{
if (!empty($_SERVER['HTTP_CLIENT_IP']))
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
return $ip;
}
define('IP',GetRealIp());
if($_SERVER['HTTP_REFERER'] == 'https://new-combats.com/' && $_COOKIE['acomb1'] != '2') {
setcookie('acomb1','1',time()+60*60*24*3);
}
/*
if(IP != '') {
die('Ðåãèñòðàöèÿ âðåìåííî îòêëþ÷åíà. Èäåò âîññòàíîâëåíèå ïåðñîíàæåé.');
}
*/
class register
{
public function testLogin($v)
{
}
public 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;
}
public function testStep()
{
global $c,$reg,$error,$filter,$chat,$reg_d,$noup,$youip;
$stp = 1;
if(isset($_POST['step']) && isset($reg['id']))
{
$upd = '';
$lr = mysql_fetch_array(mysql_query('SELECT `id`,`ipreg` FROM `users` WHERE `cityreg`="capitalcity" AND `timereg`>"'.(time()-60*60*1).'" AND `ipreg` = "'.mysql_real_escape_string(IP).'" LIMIT 1'));
if(isset($_COOKIE['reg_capitalcity']) || (int)$_COOKIE['reg_capitalcity']>time() || isset($lr['id']))
{
$error .= 'Íåäàâíî ñ âàøåãî IP óæå ðåãèñòðèðîâàëñÿ ïåðñîíàæ. Ñ îäíîãî IP àäðåñà ðàçðåøåíà ðåãèñòðàöèÿ ïåðñîíàæåé íå ÷àùå, ÷åì ðàç â ÷àñ. Ïîïðîáóéòå ïîçæå.<br>'; $_POST['step'] = 1;
}
if($error=='')
{
$reg_bonus = false;
/*if(isset($_POST['register_code']))
{
$cd = mysql_fetch_array(mysql_query('SELECT * FROM `register_code` WHERE `code` = "'.mysql_real_escape_string($_POST['register_code']).'" AND `time_finish` = "0" AND `use` = "0" LIMIT 1'));
if(isset($cd['id']) && $cd['use']==0)
{
$reg_bonus = true;
$upd = mysql_query('UPDATE `register_code` SET `use` = "'.$reg['id'].'",`time_start`="'.time().'" WHERE `id` = "'.$cd['id'].'" LIMIT 1');
if($upd && $reg['id']>0)
{
$uz = mysql_fetch_array(mysql_query('SELECT `id`,`login` FROM `users` WHERE `id` = "'.mysql_real_escape_string($cd['uid']).'" LIMIT 1'));
if(!isset($uz['id']))
{
$uz['login'] = '<i>Íåâèäèìêà</i>';
}
$error .= 'Âû óñïåøíî àêòèâèðîâàëè ïðèãëàøåíèå îò '.$uz['login'].'. Òåïåðü âû ìîæåòå çàðåãèñòðèðîâàòüñÿ. Êîä äåéñòâóåò òîëüêî íà ýòó ðåãèñòðàöèþ.<br>';
mysql_query("UPDATE `items_users` SET `data`='info=Êîä ïðèãëàøåíèÿ: <b>".$cd['code']."</b><br>Ïðè óòåðè ïðèãëàøåíèÿ ðåãèñòðàöèÿ ïî äàííîìó êîäó áóäåò çàïðåùåíà.<br><div style=\"color:brown;\">Êòî-òî ðåãåñòðèðóåòñÿ ïî âàøåìó ïðèãëàøåíèþ. Äàòà: ".date('d.n.Y H:i',time())."</div>' WHERE `secret_id` = '".$cd['code']."' LIMIT 1");
$cd['use'] = $reg['id'];
if($cd['time_create']<time()-60*60)
{
$error .= 'Ðåãèñòðàöèîííûé êîä ïðîñðî÷åí.<br>';
$reg_bonus = false;
}
}else{
$error .= 'Îøèáêà ïîäòâåðæäåíèÿ. Ïîïðîáóéòå ïîçæå...';
}
}else{
$error .= 'Ðåãèñòðàöèîííûé êîä áûë èñïîëüçîâàí ðàíåå, ëèáî íå ñóùåñòâóåò.<br>';
}
}
$cd = mysql_fetch_array(mysql_query('SELECT * FROM `register_code` WHERE `use` = "'.$reg['id'].'" AND `time_finish` = "0" LIMIT 1'));
if(!isset($cd['id']))
{
$reg_bonus = false;
$error .= 'Ïðåäìåò íå íàéäåí. (ïðèãëàøåíèå â èíâåíòàðå ïîëüçîâàòåëÿ)<br>';
}else{
$reg_bonus = true;
$cdi = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `secret_id` = "'.$cd['code'].'" AND `delete` = "0" AND `inShop` = "0" LIMIT 1'));
if(!isset($cdi['id']))
{
$reg_bonus = false;
$error .= 'Ïðåäìåò íå íàéäåí.';
}
}
//$reg_bonus = true;
//ðåãèñòðàöèÿ òðåáóåò ïðèãëàøåíèÿ
if($reg_bonus==false)
{
$error .= '<form action="register.php" method="post">Ðåãèñòðàöèÿ òîëüêî ïî ïðèãëàøåíèþ. Ââåäèòå êîä ïðèãëàøåíèÿ:<br><input name="register_code" type="text" style="width:200px;"> <input type="submit" value="Ââåñòè êîä"></form>'; $_POST['step'] = 1;
}
*/
}
$reg_bonus = true;
if($_POST['step']>1)
{
//Çàïðåùåííûå ëîãèíû
$nologin = array(0=>'àíãåë',1=>'angel',2=>'àäìèíèñòðàöèÿ',3=>'administration',4=>'Êîììåíòàòîð',5=>'Ìèðîçäàòåëü',6=>'Ìóñîðùèê',7=>'Ïàäàëüùèê',8=>'Ïîâåëèòåëü',9=>'Àðõèâàðèóñ',10=>'Ïåðåñìåøíèê',11=>'Âîëûíùèê',12=>'Ëîðä Ðàçðóøèòåëü',13=>'Ìèëîñåðäèå',14=>'Ñïðàâåäëèâîñòü',15=>'Èñêóøåíèå',16=>'Âîçíåñåíèå');
$blacklist = "!@#$%^&*()\+¨¸|/'`\"";
$sr = '_-éöóêåíãøùçõúôûâàïðîëäæýÿ÷ñìèòüáþ¸1234567890';
$i = 0;
while($i<count($nologin))
{
if(preg_match("/".$nologin[$i]."/i",$filter->mystr($reg_d[0])))
{
$error .= 'Âûáåðèòå, ïîæàëóéñòà, äðóãîé íèê.<br>'; $_POST['step'] = 1; $i = count($nologin);
}
$i++;
}
$reg_d[0] = str_replace(' ',' ',$reg_d[0]);
//Ëîãèí îò 4 äî 20 ñèìâîëîâ
if(strlen($reg_d[0])>20)
{
$error .= 'Ëîãèí äîëæåí ñîäåðæàòü íå áîëåå 20 ñèìâîëîâ.<br>'; $_POST['step'] = 1;
}
if(strlen($reg_d[0])<4)
{
$error .= 'Ëîãèí äîëæåí ñîäåðæàòü íå ìåíåå 4 ñèìâîëîâ.<br>'; $_POST['step'] = 1;
}
//Îäèí àëôàâèò
$er = $this->en_ru($reg_d[0]);
if($er==true)
{
$error .= 'Â ëîãèíå ðàçðåøåíî èñïîëüçîâàòü òîëüêî áóêâû îäíîãî àëôàâèòà ðóññêîãî èëè àíãëèéñêîãî. Íåëüçÿ ñìåøèâàòü.<br>'; $_POST['step'] = 1;
}
//Çàïðåùåííûé ñèìâîëû
if(strpos($sr,$reg_d[0]))
{
$error .= 'Ëîãèí ñîäåðæèò çàïðåùåííûå ñèìâîëû.<br>'; $_POST['step'] = 1;
}
//Ïåðñîíàæè â áàçå
$log = mysql_fetch_array(mysql_query('SELECT `id` from `users` where `login`="'.mysql_real_escape_string($reg_d[0]).'" LIMIT 1'));
$log2 = mysql_fetch_array(mysql_query('SELECT `id` from `lastNames` where `login`="'.mysql_real_escape_string($reg_d[0]).'" LIMIT 1'));
if(isset($log['id']) || isset($log2['id']))
{
$error .= 'Ëîãèí '.$reg_d[0].' óæå çàíÿò, âûáåðèòå äðóãîé.<br>'; $_POST['step'] = 1;
}
//Ðàçäåëèòåëè
if(substr_count($reg_d[0],' ')+substr_count($reg_d[0],'-')+substr_count($reg_d[0],'_')>2)
{
$error .= 'Íå áîëåå äâóõ ðàçäåëèòåëåé îäíîâðåìåííî (ïðîáåë, òèðå, íèæíåå ïîä÷åðêèâàíèå).<br>'; $_POST['step'] = 1;
}
$reg_d[0] = trim($reg_d[0],' ');
if($_POST['step']!=1)
{
$stp = 2; $noup = 0;
}
}
if($_POST['step']>2)
{
//ïðîâåðÿåì ïàðîëü
if(strlen($reg_d[1])<6 || strlen($reg_d[1])>30)
{
$error .= 'Äëèíà ïàðîëÿ íå ìîæåò áûòü ìåíüøå 6 ñèìâîëîâ èëè áîëåå 30 ñèìâîëîâ.<br>'; $_POST['step'] = 2;
}
if($reg_d[1]!=$reg_d[2])
{
$error .= 'Â àíêåòå ïàðîëü íóæíî ââåñòè äâàæäû, äëÿ ïðîâåðêè. Âî âòîðîé ðàç âû åãî ââåëè íåâåðíî, áóäüòå âíèìàòåëüíåå.<br>'; $_POST['step'] = 2;
}
if(preg_match('/'.$reg_d[0].'/i',$reg_d[1]))
{
$error .= 'Ïàðîëü ñîäåðæèò ýëåìåíòû ëîãèíà.<br>'; $_POST['step'] = 2;
}
if($_POST['step']!=2)
{
$stp = 3; $noup = 0;
}
}
if($_POST['step']>3)
{
//ïðîâåðÿåì e-mail
if(strlen($reg_d[3])<6 || strlen($reg_d[3])>50)
{
$error .= 'E-mail íå ìîæåò áûòü êîðî÷å 6-õ ñèìâîëîâ è äëèíåå 50-òè.<br>'; $_POST['step'] = 3;
}
if(!preg_match('#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s]+\.+[a-z]{2,6}))$#si', $reg_d[3]))
{
$error .= 'Âû óêàçàëè ÿâíî îøèáî÷íûé E-mail.<br>'; $_POST['step'] = 3;
}
$reg_d[4] = $chat->str_count($reg_d[4],30);
$reg_d[5] = $chat->str_count($reg_d[5],30);
if($_POST['step']!=3)
{
$stp = 4; $noup = 0;
}
}
if($_POST['step']>4)
{
//Èìÿ, Ïîë, Ãîðîä, Äåâèç è ò.ä.
$er = $this->en_ru($reg_d[6]);
if($er==true || strlen($reg_d[6])<2)
{
$error .= 'Óêàæèòå âàøå ðåàëüíîå èìÿ!<br>'; $_POST['step'] = 4;
}
$reg_d[6] = $chat->str_count($reg_d[6],90);
$reg_d[7] = round($reg_d[7]);
$reg_d[8] = round($reg_d[8]);
$reg_d[9] = round($reg_d[9]);
if($reg_d[7]<1 || $reg_d[7]>31 || $reg_d[8]<1 || $reg_d[8]>12 || $reg_d[9]<1920 || $reg_d[9]>2006)
{
$error .= 'Îøèáêà â íàïèñàíèè äíÿ ðîæäåíèÿ.<br>'; $_POST['step'] = 4;
}
if($reg_d[15]!=0 && $reg_d[15]!=1)
{
$error .= 'Âû óêàçàëè íå âåðíûé ïîë.<br>'; $_POST['step'] = 4;
}
if($reg_d[14]!='Black' && $reg_d[14]!='Blue' && $reg_d[14]!='Fuchsia' && $reg_d[14]!='Gray' && $reg_d[14]!='Green' && $reg_d[14]!='Maroon' && $reg_d[14]!='Navy' && $reg_d[14]!='Olive' && $reg_d[14]!='Purple' && $reg_d[14]!='Teal' && $reg_d[14]!='Orange' && $reg_d[14]!='Chocolate' && $reg_d[14]!='DarkKhaki' && $reg_d[14]!='SandyBrown')
{
$error .= 'Âû óêàçàëè íå âåðíûé öâåò ñîîáùåíèÿ â ÷àòå.<br>'; $_POST['step'] = 4;
}
if($_POST['step']!=4)
{
$stp = 5; $noup = 0;
}
}
if($_POST['step']>5)
{
//Ñîãëàøåíèå ñ çàêîíàìè
if(!isset($_POST['law_'.$reg['id']]) || $_POST['law_'.$reg['id']]!='on')
{
$error .= 'Èçâèíèòå, áåç ïðèíÿòèÿ ïðàâèë íàøåãî êëóáà, âû íå ìîæåòå çàðåãèñòðèðîâàòü ñâîé ïåðñîíàæ.<br>'; $_POST['step'] = 5;
}
if(!isset($_POST['law2_'.$reg['id']]) || $_POST['law2_'.$reg['id']]!='on')
{
$error .= 'Èçâèíèòå, áåç ïðèíÿòèÿ <u>Ñîãëàøåíèÿ î ïðåäîñòàâëåíèè ñåðâèñà èãðû '.$c['title'].'</u>, âû íå ìîæåòå çàðåãèñòðèðîâàòü ïåðñîíàæ.<br>'; $_POST['step'] = 5;
}
if($_POST['code']!=$_SESSION['code'] || $_SESSION['code']<100 || $_POST['code']=='')
{
$error .= 'Îøèáêà ââåäåíèÿ êîäà.<br>'; $_POST['step'] = 5;
}
if($_POST['step']!=5)
{
//çàâåðøåíèå ðåãèñòðàöèè è ðåäèðåêò â èãðó
if($filter->spamFiltr($reg_d[13])!=0)
{
$reg_d[13] = '';
}
if($filter->spamFiltr($reg_d[10])!=0)
{
$reg_d[10] = '';
}
if($filter->spamFiltr($reg_d[6])!=0)
{
$reg_d[6] = '';
}
/*$mbid = mysql_fetch_array(mysql_query('select min(t1.id + 1)
from users t1
where t1.id + 1 not in (select id from users where id > 9999) AND t1.id > 9998'));
//$mbid1 = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `id` = "'.$mbid[0].'" LIMIT 1'));
//$mbid2 = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `id` = "'.$mbid[0].'" LIMIT 1'));
//if(isset($mbid1['id']) && isset($mbid2['id'])) {
*/
$mbid = 'NULL';
/*}else{
/* ÷èñòèì âîçìîæíûå äàííûå */
/*if($mbid [0]> 0) {
mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$mbid[0].'" LIMIT 1');
mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$mbid[0].'" LIMIT 1');
mysql_query('DELETE FROM `bank` WHERE `uid` = "'.$mbid[0].'" LIMIT 1');
mysql_query('DELETE FROM `users_delo` WHERE `uid` = "'.$mbid[0].'" LIMIT 1');
mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$mbid[0].'" LIMIT 1');
}
$mbid = $mbid[0];
}*/
if($_COOKIE['b4n'] == '1') {
setcookie('b4n','2',time()+60*60*24*3);
$reg['referal'] = 'btl4.net';
}elseif(isset($_COOKIE['hstreger'])) {
$reg['referal'] = $_COOKIE['hstreger'];
}
$ins = mysql_query("INSERT INTO `users` (`activ`,`fnq`,`host_reg`,`room`,`login`,`pass`,`ipreg`,`ip`,`city`,`cityreg`,`a1`,`q1`,`mail`,`name`,`bithday`,`sex`,`city_real`,`icq`,`icq_hide`,`deviz`,`chatColor`,`timereg`) VALUES (
'0',
'0',
'".mysql_real_escape_string($reg['referal'])."',
'0',
'".$reg_d[0]."',
'".md5($reg_d[1])."',
'".IP."',
'".IP."',
'capitalcity',
'capitalcity',
'".$reg_d[4]."',
'".$reg_d[5]."',
'".$reg_d[3]."',
'".$reg_d[6]."',
'".$reg_d[7].".".$reg_d[8].".".$reg_d[9]."',
'".$reg_d[15]."',
'".$reg_d[10]."',
'".$reg_d[11]."',
'".$reg_d[12]."',
'".$reg_d[13]."',
'".$reg_d[14]."',
'".time()."')");
if($ins)
{
$uid = mysql_insert_id();
$refer = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`banned`,`admin`,`level` FROM `users` WHERE `id` = "'.mysql_real_escape_string($reg['referal']).'" LIMIT 1'));
if(isset($refer['id'])) {
mysql_query("INSERT INTO `items_users` (`gift`,`uid`,`item_id`,`data`,`iznosMAX`,`geniration`,`maidin`,`time_create`) VALUES ('".$refer['login']."','".$uid."','3199','noodet=1|items_in_file=sunduk_new|var_id=1|open=1|noremont=1|nodelete=1|nosale=1',1,2,'capitalcity',".time().")");
$text = '<font color=red>Âû ñòàëè âîñïèòàííèêîì èãðîêà &quot;'.$refer['login'].'&quot;!  èíâåíòàðå (ðàçäåë -ïðî÷åå-) âû íàéäåòå âñïîìîãàòåëüíûå ïðåäìåòû.</font>';
mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('capitalcity','0','','".$reg_d[0]."','".$text."','".time()."','11','0')");
}
mysql_query("INSERT INTO `online` (`uid`,`timeStart`) VALUES ('".$uid."','".time()."')");
mysql_query("INSERT INTO `stats` (`id`,`stats`) VALUES ('".$uid."','s1=3|s2=3|s3=3|s4=3|rinv=40|m9=5|m6=10')");
//Äîáàâëÿåì ïðåäìåòû
mysql_query("INSERT INTO `items_users` (`gift`,`uid`,`item_id`,`data`,`iznosMAX`,`geniration`,`maidin`,`time_create`) VALUES ('Ìèðîçäàòåëü','".$uid."','1','add_hpAll=3',10,2,'capitalcity',".time().")");
mysql_query("INSERT INTO `items_users` (`gift`,`uid`,`item_id`,`data`,`iznosMAX`,`geniration`,`maidin`,`time_create`) VALUES ('Ìóñîðùèê','".$uid."','73','add_mib3=1|add_mab3=1|add_mib4=1|add_mab4=1',20,2,'capitalcity',".time().")");
mysql_query("INSERT INTO `items_users` (`uid`,`item_id`,`data`,`iznosMAX`,`geniration`,`maidin`,`time_create`) VALUES ('".$uid."','724','moment=1|sudba=".mysql_real_escape_string($reg_d[0])."|moment_hp=100|nohaos=1|musor=2|noremont=1',100,2,'capitalcity',".time().")");
mysql_query("INSERT INTO `items_users` (`uid`,`item_id`,`data`,`iznosMAX`,`geniration`,`maidin`,`time_create`) VALUES ('".$uid."','865','tr_lvl=1|sudba=".mysql_real_escape_string($reg_d[0])."|useOnLogin=1|musor=1|noremont=1',50,2,'capitalcity',".time().")");
mysql_query("INSERT INTO `items_users` (`uid`,`item_id`,`data`,`iznosMAX`,`geniration`,`maidin`,`time_create`) VALUES ('".$uid."','4014','sudba=".mysql_real_escape_string($reg_d[0])."|noremont=1|usefromfile=1|musor=1|nodelete=1|nosale=1|expUpg=300000',1,2,'capitalcity',".time().")");
/*
$text = 'Àäìèíèñòðàöèÿ ïðîåêòà: Æåëàåì ïðèÿòíîãî îáùåíèÿ, âåëèêèõ ïîáåä è íåçàáûâàåìûõ âïå÷àòëåíèé â íàøåé ñ âàìè èãðå! :-)';
mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('capitalcity','0','','".$reg_d[0]."','".$text."','".time()."','11','0')");
$text = 'Âû ïîëó÷èëè ïðåäìåò [img[items/pot_cureHP100_20.gif]][1] &quot;Çåëüå Æèçíè&quot;, îí íàõîäèòñÿ â èíâåíòàðå, â ðàçäåëå &quot;ýëèêñèðû&quot;';
mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('capitalcity','0','','".$reg_d[0]."','".$text."','".time()."','11','0')");
$text = 'Âû ïîëó÷èëè ïðåäìåò [img[items/pal_button8.gif]][1] &quot;Íàïàäåíèå&quot;, îí íàõîäèòñÿ â èíâåíòàðå, â ðàçäåëå &quot;çàêëÿòèÿ&quot;';
mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('capitalcity','0','','".$reg_d[0]."','".$text."','".time()."','11','0')");
$text = 'Âû ïîëó÷èëè ïðåäìåò [img[items/qsvit_hran.gif]][1] &quot;Ñâèòîê Îáó÷åíèÿ&quot;, îí íàõîäèòñÿ â èíâåíòàðå, â ðàçäåëå &quot;çàêëÿòèÿ&quot;. <b><font color=red>Èñïîëüçîâàâ äàííûé ñâèòîê Âû ïîëó÷èòå +300.000 åä. îïûòà</font></b>';
mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('capitalcity','0','','".$reg_d[0]."','".$text."','".time()."','11','0')");
*/
if(isset($_COOKIE['login']) || isset($_COOKIE['pass']))
{
setcookie('login','',time()-60*60*24,'',$c['host']);
setcookie('pass','',time()-60*60*24,'',$c['host']);
}
setcookie('login',$reg_d[0],time()+60*60*24*7,'',$c['host']);
setcookie('pass',md5($reg_d[1]),time()+60*60*24*7,'',$c['host']);
setcookie('auth',md5($reg_d[1].'AUTH'.IP),time()+60*60*24*365,'',$c['host']);
setcookie('reg_capitalcity',true,time()+60*60,'',$c['host']);
$chat->send('',1,'capitalcity','','','Âàñ ïðèâåòñòâóåò íîâè÷îê: [login:'.$reg_d[0].']',time(),12,1,0,0);
mysql_query("UPDATE `users` SET `online`='".time()."' WHERE `uid` = '".$uid."' LIMIT 1");
mysql_query("UPDATE `register_code` SET `reg_id`='".$uid."',`time_finish`='".time()."' WHERE `id` = '".$cd['id']."' LIMIT 1");
mysql_query("UPDATE `items_users` SET `delete`='".time()."' WHERE `secret_id` = '".$cd['code']."' LIMIT 1");
mysql_query('DELETE FROM `register` WHERE `id` = "'.$reg['id'].'" LIMIT 1');
header('location: /bk');
die('Ðåãèñòàðöèÿ ïðîøëà óñïåøíî...');
}else{
$error .= 'Îøèáêà ðåãèñòðàöèè. Ïîïðîáóéòå ïîçæå...<br>';
}
}
}
}
return $stp;
}
}
$r = new register;
?>

View File

@ -1,35 +0,0 @@
<?php
if(!defined('GAME')) {
die();
}
class season {
public static $yy = array(
1 => array( 1 , '01' , 'ßíâàðü' , 'ßíâàðüñêèé' ),
2 => array( 2 , '02' , 'Ôåâðàëü' , 'Ôåâðàëüñêèé' ),
3 => array( 3 , '03' , 'Ìàðò' , 'Ìàðòîâñêèé' ),
4 => array( 4 , '04' , 'Àïðåëü' , 'Àïðåëüñêèé' ),
5 => array( 5 , '05' , 'Ìàé' , 'Ìàéñêèé' ),
6 => array( 6 , '06' , 'Èþíü' , 'Èþíüñêèé' ),
7 => array( 7 , '07' , 'Èþëü' , 'Èþëüñêèé' ),
8 => array( 8 , '08' , 'Àâãóñò' , 'Àâãóñòîâñêèé' ),
9 => array( 9 , '09' , 'Ñåíòÿáðü' , 'Ñåíòÿáðüñêèé' ),
10 => array( 10 , '10' , 'Îêòÿáðü' , 'Îêòÿáðüñêèé' ),
11 => array( 11 , '11' , 'Íîÿáðü' , 'Íîÿáðüñêèé' ),
12 => array( 12 , '12' , 'Äåêàáðü' , 'Äåêàáðüñêèé' ),
);
public static $date = array( ), $m = array( );
public static function data( $val ) {
self::$m = mysql_fetch_array(mysql_query('SELECT * FROM `sss_m` WHERE `id` = "'.mysql_real_escape_string((int)$val).'" LIMIT 1'));
if( self::$m['s'] != self::$date['m'] ) {
self::$m = array( );
}
}
}
?>

View File

@ -1,197 +0,0 @@
<?
if(!defined('GAME'))
{
die();
}
class telegram
{
private static $flag_one;
public static function start()
{
if (!isset(self::$flag_one))
{
$c = __CLASS__;
self::$flag_one = new $c($server);
}
return self::$flag_one;
}
public function send($to,$from,$text,$time,$fromType)
{
mysql_query('START TRANSACTION');
$ins = mysql_query("INSERT INTO `telegram` (`uid`,`from`,`fromType`,`text`,`time`) VALUES ('".$to."','".$from."','".$fromType."','".mysql_real_escape_string(AddSlashes(HtmlSpecialChars($text,NULL,'cp1251')))."','".time()."')");
mysql_query('COMMIT');
if($ins)
{
return mysql_insert_id();
}
}
public function readMsg($id,$uid)
{
$msg = mysql_fetch_array(mysql_query('SELECT * FROM `telegram` WHERE `id`="'.$id.'" AND `uid`="'.$uid.'" LIMIT 1 FOR UPDATE'));
if(isset($msg['id']))
{
mysql_query('START TRANSACTION');
$upd = mysql_query('UPDATE `telegram` SET `read`="1" WHERE `id` = "'.$id.'" AND `uid`="'.$uid.'" LIMIT 1');
mysql_query('COMMIT');
if($upd && $msg['lock']==0)
{
echo '<script>readGood('.$id.',"https://img.new-combats.com/i/misc/read.gif"); nobtext('.$id.');</script>';
}
}
}
public function lockMsg($id,$uid)
{
$msg = mysql_fetch_array(mysql_query('SELECT * FROM `telegram` WHERE `id`="'.$id.'" AND `uid`="'.$uid.'" LIMIT 1 FOR UPDATE'));
if(isset($msg['id']))
{
$lock = array(0=>1,1=>0);
mysql_query('START TRANSACTION');
$upd = mysql_query('UPDATE `telegram` SET `read`="1",`lock`="'.$lock[$msg['lock']].'" WHERE `id` = "'.$id.'" AND `uid`="'.$uid.'" LIMIT 1');
mysql_query('COMMIT');
if($upd)
{
if($lock[$msg['lock']]==1)
{
echo '<script>readGood('.$id.',"https://img.new-combats.com/i/lock_message.gif"); nobtext('.$id.');</script>';
}else{
echo '<script>readGood('.$id.',"https://img.new-combats.com/i/misc/read.gif");</script>';
}
}
}
}
public function deleteMsgAll($uid,$pg)
{
mysql_query('START TRANSACTION');
$upd = mysql_query('UPDATE `telegram` SET `delete`="1" WHERE `uid`="'.$uid.'" AND `read`="1" AND `lock`="0" AND `delete`="0"');
mysql_query('COMMIT');
if($upd)
{
echo '<script> getPage('.$pg.');</script>';
}
}
public function deleteMsg($id,$uid,$pg)
{
$msg = mysql_fetch_array(mysql_query('SELECT * FROM `telegram` WHERE `id`="'.$id.'" AND `uid`="'.$uid.'" LIMIT 1 FOR UPDATE'));
if(isset($msg['id']))
{
mysql_query('START TRANSACTION');
$upd = mysql_query('UPDATE `telegram` SET `delete`="1" WHERE `id` = "'.$id.'" AND `uid`="'.$uid.'" LIMIT 1');
mysql_query('COMMIT');
if($upd && $msg['delete']==0 && $msg['lock']==0)
{
echo '<script> getPage('.$pg.');</script>';
}
}
}
private function addMsgTable($id,$from,$fromType,$ttl,$time,$lock,$read,$pg)
{
$i1 = '<img id="msgImg'.$id.'" src="https://img.new-combats.com/i/misc/unread.gif">';
if($read==1)
{
$i1 = '<img id="msgImg'.$id.'" src="https://img.new-combats.com/i/misc/read.gif">';
}
if($lock==1)
{
$i1 = '<img id="msgImg'.$id.'" src="https://img.new-combats.com/i/lock_message.gif">';
}
if($fromType==1)
{
$from = '<a href="info/login='.$from.'" target="_blank" title="Èíô. î '.$from.'">'.$from.'</a>';
}elseif($read==0)
{
$from = '<b id="tablePostTxtB'.$id.'">'.$from.'</b>';
}
echo '<table id="tablePost'.$id.'" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30" class="underLine2"><div align="center">'.$i1.'</div></td>
<td width="200" id="tablePostTxt'.$id.'" class="underLine2">'.$from.'</td>
<td width="290" class="underLine2"><a onClick="openPost('.$id.'); return false;" href="#read'.$id.'" title="Ïðî÷èòàòü ñîîáùåíèå">'.substr($ttl,0,30).'...</a></td>
<td width="120" class="underLine2">'.date('d.m.y H:i',$time).'</td>
<td width="30" class="underLine2"><div align="center"><IMG style="cursor:pointer;" onClick="lockPost('.$id.');" title="Áëîêèðîâêà ñîîáùåíèÿ" src="https://img.new-combats.com/i/locked.gif"></div></td>
<td width="30" class="underLine2"><div align="center"><IMG style="cursor:pointer;" onClick="deletePost('.$id.','.$pg.');" title="Óäàëèòü ñîîáùåíèå" src="https://img.new-combats.com/i/clear.gif" width="11" height="11"></div></td>
</tr>
</table>
<div id="readMSG'.$id.'" style="display:none;" class="unreadMSG">'.$ttl.'</div>';
}
public function seeMsg($uid,$page,$maxPages)
{
$page = ceil($page);
echo '<div id="jx" style="display:none;"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30" class="underLine"><div align="center"></div></td>
<td width="200" class="underLine"><b>Îò êîãî</b></td>
<td width="290" class="underLine"><b>Çàãîëîâîê ñîîáùåíèÿ</b></td>
<td width="120" class="underLine"><b>Êîãäà</b></td>
<td width="30" class="underLine"><div align="center"><IMG alt="Áëîêèðîâêà ñîîáùåíèé" src="https://img.new-combats.com/i/lock_message.gif"></div></td>
<td width="30" class="underLine"><div align="center"><IMG style="cursor:pointer;" onClick="deletePostAll('.$page.');" alt="Óäàëèòü âñå ïðî÷èòàííûå ñîîáùåíèÿ" src="https://img.new-combats.com/i/clear.gif" width="11" height="11"></div></td>
</tr>
</table>';
$i = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `telegram` WHERE `uid`="'.$uid.'" AND `delete`="0"'));
$pg = ceil($i[0]/$maxPages);
if($page<0)
{
$page = 0;
}elseif($page>$pg)
{
$page = $pg;
}
if($i[0]>0)
{
$sp = mysql_query('SELECT * FROM `telegram` WHERE `uid`="'.$uid.'" AND `delete`="0" ORDER BY `id` DESC LIMIT '.(($page-1)*$maxPages).' , '.$maxPages.'');
while($pl = mysql_fetch_array($sp))
{
$this->addMsgTable($pl['id'],$pl['from'],$pl['fromType'],$pl['text'],$pl['time'],$pl['lock'],$pl['read'],$page);
}
}
if($i[0]==0)
{
echo '<div class="noMsg" align="center">Ñîîáùåíèé íåò</div>';
}elseif($i[0]>$maxPages){
$pages = '';
$i = 1;
while($i<=$pg)
{
$cls = '';
if($page==$i)
{
$cls = 'style="color:#6f0000; font-size:14px;"';
}
$pages .= '&nbsp;<a '.$cls.' onClick="getPage('.$i.'); return false;" href="#page'.$i.'">'.$i.'</a>';
$i++;
}
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30"><div align="center"></div></td>
<td width="200">Ñòðàíèöû: '.$pages.'</td>
<td width="240"></td>
<td width="170"></td>
<td width="30"></td>
<td width="30"></td>
</tr>
</table>';
}
}
public function __clone()
{
trigger_error('Äóáëèðîâàíèå íå äîïóñêàåòñÿ.', E_USER_ERROR);
}
}
?>

View File

@ -1,539 +0,0 @@
<?
if(!defined('GAME'))
{
die();
}
class turnir {
public $info,$user,$name = array(
0 => 'Âûæèòü ëþáîé öåíîé',
1 => 'Êàæäûé ñàì çà ñåáÿ',
2 => 'Çàõâàò êëþ÷à'
);
public function start() {
global $c,$u;
$this->info = mysql_fetch_array(mysql_query('SELECT * FROM `turnirs` WHERE `id` = "'.$u->info['inTurnirnew'].'" LIMIT 1'));
$this->user = mysql_fetch_array(mysql_query('SELECT * FROM `users_turnirs` WHERE `turnir` = "'.$u->info['inTurnirnew'].'" 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('UPDATE `turnirs` SET `status` = "3" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
//Ñîçäàíèå ïîåäèíêà
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 `inTurnirnew` = "'.$this->info['id'].'"');
//Îáîçíà÷àåì çàâåðøåíèå òóðíèðà ïðè âûõîäå
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['inTurnirnew'].'" LIMIT 1'));
//mysql_query('UPDATE `users` SET `inUser` = 0, `inTurnirnew` = 0 WHERE `inTurnirnew` = '.$this->info['id'].' AND `inUser` > 0 LIMIT '.$this->info['users_in']);
if($this->info['status'] == 3) {
$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_expn'] = 3000;
$inf['add_expp'] = array(
0,
1,
5,
10,
15,
25,
35,
70,
100,
150,
200,
300,
500,
700,
1000
);
//$inf['add_expn'] = floor($inf['add_expn']/100*$inf['add_expp'][$inf['level']]);
//$inf['add_expn'] = floor($inf['add_expn']/100*$inf['add_expp'][7]);
//ïîëó÷àåì îïûò (ñ 0 ïî 12 ëâë)
$inf['add_expn'] = array( 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>, ';
$r = 'Òóðíèð çàâåðøåí. Âû ÿâëÿåòåñü ïîáåäèòåëåì òóðíèðà, ïîëó÷åíî îïûòà: <b>'.$inf['add_expn'].'</b>.';
/*if( $this->info['users_in'] >= 10 ) {
$r .= '  òóðíèðå ñîáðàëîñü 10 èëè áîëåå ÷åëîâåê: <b>×åê íà 1 åêð.</b> äîáàâëåí ê Âàì â èíâåíòàðü.';
$u->addItem(4393,$inf['id'],'');
}*/
mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','".$inf['room']."','','".$inf['login']."','".$r."','".time()."','6','0')");
}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.'. Ñëåäóþùèé òóðíèð íà÷íåòñÿ ÷åðåç '.$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 = '<font color=black><b>Òóðíèð çàâåðøåí.</b></font> '.$win;
mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','".$r."','".time()."','6','0')");
}
}
public function locationSee() {
global $c,$u;
$r = '';
$tm1 = '';
$tm2 = '';
$noitm = array(
869 => 1,
1246 => 1,
155 => 1,
1245 => 1,
678 => 1
);
if($this->info['step'] != 3 && $this->info['step'] != 0) {
//ïîëó÷åíèå êîìïëåêòà
if(isset($_GET['gocomplect']) && $this->user['points'] < 2) {
$aso = explode(',',$this->user['items']);
$ast = explode('-',$_GET['gocomplect']);
$asg = array();
$asj = array();
$asgp = array();
$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]] != true) {
$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) {
$asg[$itm['inSlot']][count($asg[$itm['inSlot']])] = $itm['id'];
$asgp[$itm['inSlot']][count($asgp[$itm['inSlot']])] = $itm['price1'];
$j++;
}elseif($itm['inSlot'] == 10) {
$asg[$itm['inSlot']][count($asg[$itm['inSlot']])] = $itm['id'];
$asgp[$itm['inSlot']][count($asgp[$itm['inSlot']])] = $itm['price1'];
$j++;
}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;
}
//$addi = 0;
if($addi == 1) {
$i = 0;
while($i <= 17) {
if($i == 10) {
if($asg[$i][0] > 0) {
$u->addItem($asg[$i][0],$u->info['id']);
$this->user['points'] += 1+round($asgp[$i][0]);
}
if($asg[$i][1] > 0) {
$u->addItem($asg[$i][1],$u->info['id']);
$this->user['points'] += 1+round($asgp[$i][1]);
}
if($asg[$i][2] > 0) {
$u->addItem($asg[$i][2],$u->info['id']);
$this->user['points'] += 1+round($asgp[$i][2]);
}
}elseif($i == 3) {
if($asg[$i][0] > 0) {
$u->addItem($asg[$i][0],$u->info['id']);
$this->user['points'] += 1+round($asgp[$i][0]);
}
if($asg[$i][1] > 0) {
$u->addItem($asg[$i][1],$u->info['id']);
$this->user['points'] += 1+round($asgp[$i][1]);
}
}elseif($asg[$i] > 0) {
$u->addItem($asg[$i],$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` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('UPDATE `stats` SET `ability` = "100",`skills` = "10" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('UPDATE `users` SET `level` = "12" WHERE `id` = "'.$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 = array(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 = array(2,1);
}else{
$tmr = array(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 = array(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']} .= $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>Íà÷àëî òóðíèðà ÷åðåç '.$u->timeOut($this->info['time'] - time()).'! ';
if(isset($_GET['hpregenNowTurnir'])) {
if($u->stats['hpNow'] < $u->stats['hpAll'] || $u->stats['mpNow'] < $u->stats['mpAll']) {
mysql_query('UPDATE `stats` SET `hpNow` = "'.$u->stats['hpAll'].'",`mpNow` = "'.$u->stats['mpAll'].'" WHERE `id` = "'.$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($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) {
if($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 = array();
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'].',';
//$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 = array();
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>
<?
$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="https://img.new-combats.com/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 .= '<b class="CSSteam1">Êîìàíäà ¹1</b>: '.rtrim($tm1,', ');
//$r .= '<br><b class="CSSteam2">Êîìàíäà ¹2</b>: '.rtrim($tm2,', ');
$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;
}
}
$tur = new turnir;
$tur->start();
?>

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +0,0 @@
<?php
if( !defined('GAME') ) {
die();
}
class botLogic {
public $bot = array( );
//Ïîëó÷åíèå èíôîðìàöèè î áîòå
public function botInfo( $id ) {
self::$bot = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.mysql_real_escape_string($id).'" LIMIT 1'));
if( !isset(self::$bot['id']) ) {
self::$bot = 'stop';
}
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -1,516 +0,0 @@
<?php
if( !defined('GAME') ) {
die();
}
class botPriemLogic {
static $p = array();
static function start( $i, $id ) {
self::$p = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "'.$id.'" LIMIT 1'));
$test = self::testpriem( self::$p );
if( isset(self::$p['id']) && $test == 0 ) {
//Èñïîëüçóåì ïðèåì ïîä íîìåðîì $id
if( $id == 1 ) { self::priem1( $i ); } //Ïðèêðûòüñÿ 1|2|3|4|5|6|7|8|9|10|11|13|14|45|47|48|49|188|204|211|217|220|223|232|235|240|0|0|0|0|0|0|0|0|0|0|0|0|0|0
elseif( $id == 2 ) { self::priem2( $i ); } //Âëîìèòü
elseif( $id == 3 ) { self::priem3( $i ); } //Ñîáðàòü çóáû
elseif( $id == 4 ) { self::priem4( $i ); } //Ñèëüíûé óäàð
elseif( $id == 5 ) { self::priem5( $i ); } //Óòåðåòü ïîò
elseif( $id == 6 ) { self::priem6( $i ); } //Âîëÿ ê ïîáåäå
elseif( $id == 7 ) { self::priem7( $i ); } //Àêòèâíàÿ çàùèòà
elseif( $id == 8 ) { self::priem8( $i ); } //Òàíåö âåòðà
elseif( $id == 9 ) { self::priem9( $i ); } //Äèêàÿ óäà÷à
elseif( $id == 10 ) { self::priem10( $i ); } //Ïðåäâèäèíèå
elseif( $id == 11 ) { self::priem11( $i ); } //Óäà÷íûé óäàð
elseif( $id == 13 ) { self::priem13( $i ); } //Ñòîéêîñòü
elseif( $id == 14 ) { self::priem14( $i ); } //ßðîñòü
elseif( $id == 45 ) { self::priem45( $i ); } //Ïîëíàÿ çàùèòà
elseif( $id == 47 ) { self::priem47( $i ); } //Ñëåïàÿ óäà÷à
elseif( $id == 48 ) { self::priem48( $i ); } //Òàíåö ëåçâèé
elseif( $id == 49 ) { self::priem49( $i ); } //Âòîðîå äûõàíèå
elseif( $id == 188 ) { self::priem188( $i ); } //Æàæäà êðîâè
elseif( $id == 204 ) { self::priem204( $i ); } //Îáðå÷åííîñòü
elseif( $id == 211 ) { self::priem211( $i ); } //Àãðåññèâíàÿ çàùèòà
elseif( $id == 217 ) { self::priem217( $i ); } //Ðàçãàäàòü òàêòèêó
elseif( $id == 220 ) { self::priem220( $i ); } //Ñòàâêà íà îïåðåæåíèå
elseif( $id == 223 ) { self::priem223( $i ); } //Ðûâîê
elseif( $id == 232 ) { self::priem232( $i ); } //Âûæèòü
elseif( $id == 235 ) { self::priem235( $i ); } //Øîêèðóþùèé óäàð
elseif( $id == 240 ) { self::priem240( $i ); } //Õëåáíóòü êðîâè
elseif( $id >= 175 && $id <= 179 ) { self::priem175( $i ); }
//*********************************
}
return true;
}
static function usePriem($id,$on = NULL) {
//if(self::$p['id'] > 7 && self::$p['id'] < 11) {
//botLogic::e(botLogic::$bot['login'].', èñïîëüçóþ ïðèåì &quot;'.self::$p['name'].'&quot; , battle: <a target=_blank href=https://new-combats.com/logs.php?log='.botLogic::$bot['battle'].'>Link</a>');
//}
$go_txt = '&usepriem='.$id;
if( $on != '') {
$on = str_replace(' ','%20',$on);
$go_txt .= '&useon='.$on;
}
botLogic::inuser_go_btl( botLogic::$bot , $go_txt );
}
//Ñòàâêà íà îïåðåæåíèå
static function priem220( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(rand(0,100) >= 30) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Ðàçãàäàòü òàêòèêó
static function priem217( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(rand(0,100) >= 30) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Îáðå÷åííîñòü
static function priem204( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(rand(0,100) >= 30) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Âûæèòü
static function priem232( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(self::hp() > 30 || rand(0,100) >= 50) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Æàæäà êðîâè
static function priem188( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(rand(0,100) >= 30) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Øîê óäàð
static function priem235( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(rand(0,100) >= 50) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Õëåáíóòü êðîâè
static function priem240( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
//if(botLogic::$st['tactic2'] < 7 || botLogic::$st['tactic4'] < 3 || self::hp() > 70) {
if(self::hp() > 70) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Ñèëîâîå ïîëå
static function priem175( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
/*if(botLogic::$st['hpNow'] >= botLogic::$st['hpAll']) {
$su = false;
}elseif(botLogic::$st['hpNow'] < 5) {
$su = false;
}elseif(rand(0,100) >= 50) {
$su = false;
}*/
if($su == true) {
self::usePriem( $i );
}
}
//Ïðèêðûòüñÿ
static function priem1( $i ) {
$su = true;
if(rand(0,100) >= 50) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Âëîìèòü
static function priem2( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(rand(0,100) >= 50) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Ñîáðàòü çóáû
static function priem3( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
/*if(botLogic::$st['hpNow'] >= botLogic::$st['hpAll']) {
$su = false;
}elseif(botLogic::$st['hpNow'] < 10) {
$su = false;
}elseif(isset(botLogic::$pr[1]) && botLogic::$pr[1] < 1) {
$su = false;
}*/
if(self::hp() > 70 || rand(0,100) >= 50) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Âîëÿ ê ïîáåäå
static function priem6( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(self::hp() > 40 || rand(0,100) >= 50) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Òàíåö âåòðà
static function priem8( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(rand(0,100) >= 30) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Òàíåö ëåçâèé
static function priem48( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(rand(0,100) >= 70) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Äèêàÿ óäà÷à
static function priem9( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(rand(0,100) >= 30) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Ñëåïàÿ óäà÷à
static function priem47( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(rand(0,100) >= 50) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Ïðåäâèäåíüå
static function priem10( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(rand(0,100) >= 30) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Âòîðîå äûõàíèå
static function priem49( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(rand(0,100) >= 80 || self::hp() > 60) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Ðûâîê
static function priem223( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(self::hp() > 50 || rand(0,100) >= 50) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Óäà÷íûé óäàð
static function priem11( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
//if(isset(botLogic::$pr[6]) && botLogic::$st['tactic7'] > 0 && self::hp() < 66 && botLogic::$st['tactic1'] < 14) {
if(rand(0,100) >= 30){
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Ñòîéêîñòü
static function priem13( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(rand(0,100) >= 50){
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//ßðîñòü
static function priem14( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(rand(0,100) >= 50){
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Ñèëüíûé óäàð
static function priem4( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
/*if(isset(botLogic::$pr[6]) && botLogic::$st['tactic7'] > 0 && self::hp() < 66 && botLogic::$st['tactic1'] < 14) {
$su = false;
}elseif((isset(botLogic::$pr[11]) || isset(botLogic::$pr[6])) && rand(0,100) <= 75) {*/
if(rand(0,100) >= 60){
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Óòåðåòü ïîò
static function priem5( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
if(self::hp() > 95) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Àãðåññèâíàÿ çàùèòà
static function priem211( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
//if( rand(0,100) >= 80 || (isset(botLogic::$pr[7]) && botLogic::$pr[7] < 1) || (isset(botLogic::$pr[45]) && botLogic::$pr[45] < 1) || self::hp() > 80 ) {
if( rand(0,100) >= 80){
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Ïîëíàÿ çàùèòà
static function priem45( $i ) {
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
//if( rand(0,100) >= 60 || (isset(botLogic::$pr[7]) && botLogic::$pr[7] < 1) || (isset(botLogic::$pr[211]) && botLogic::$pr[211] < 1) || self::hp() > 80 ) {
if( rand(0,100) >= 50){
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
//Àêòèâíàÿ çàùèòà
static function priem7( $i ) {
//if (rand(0,100) >= 50){$su = true;}else{$su = false;}
$su = true;
//Ëîãèêà èñïîëüçîâàíèÿ ïðèåìà
/* Åñëè åñòü àáñîëþòíàÿ çàùèòà (àãðåññèâíóþ) è å¸ âîçìîæíî èñîïëüçîâàòü, à òàê-æå ÍÐ ìåíåå 70% */
//if( rand(0,100) >= 50 || (isset(botLogic::$pr[45]) && botLogic::$pr[45] < 1) || (isset(botLogic::$pr[211]) && botLogic::$pr[211] < 1) || self::hp() > 80 ) {
if(rand(0,100) >= 30) {
$su = false;
}
if($su == true) {
self::usePriem( $i );
}
}
static function hp() {
$p = round((botLogic::$st['hpNow']/botLogic::$st['hpAll']*100),2);
return $p;
}
//Òåñò íà âîçìîæíîñòü èñïîëüçîâàíèÿ
static function testpriem($pl) {
global $u;
$notr = 0;
$tr = $u->lookStats($pl['tr']);
$d2 = $u->lookStats($pl['date2']);
$x = 1;
while( $x <= 7 ) {
if(botLogic::$bot['tactic'.$x] < $pl['tt'.$x] && $x!=7 && $pl['tt'.$x] > 0) {
$notr++;
}elseif($x==7) {
if($pl['tt'.$x]>0 && botLogic::$bot['tactic'.$x]<=0) {
$notr++;
}
}
$x++;
}
if($pl['xuse']>0) {
$xu = $u->testAction('`vars` = "use_priem_'.botLogic::$bot['battle'].'_'.botLogic::$bot['id'].'" AND `vals` = "'.$pl['id'].'" LIMIT '.$pl['xuse'].'',2);
if($xu[0] >= $pl['xuse']) {
$notr++;
}
}
$x = 0;
$t = $u->items['tr'];
while($x < count($t))
{
$n = $t[$x];
if(isset($tr['tr_'.$n]))
{
if($n=='lvl')
{
if($tr['tr_'.$n] > botLogic::$bot['level'])
{
$notr++;
}
}elseif($tr['tr_'.$n] > botLogic::$st[$n])
{
$notr++;
}
}
$x++;
}
if(isset($tr['tr_mpNow']))
{
if(botLogic::$st['mpNow'] < $tr['tr_mpNow'])
{
$notr++;
}
}
if($pl['trUser']==1)
{
//òðåáóåò ÷òîáû ïîëüçîâàòåëü ñ êåì-òî ðàçìåíèâàëñÿ (ïðè îæèäàíèè ïðèåì ãàñíèò)
$ga = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_act` WHERE `battle` = "'.botLogic::$bot['battle'].'" AND `uid1` = "'.botLogic::$bot['id'].'" AND `uid2` = "'.botLogic::$bot['enemy'].'" LIMIT 1'));
if(isset($ga['id']))
{
$notr++;
}
}
//Åñëè ïðèåì óæå èñïîëüçîâàëè
if(botLogic::$st['prsu'][$pl['id']]>0) {
$notr++;
}
return $notr;
}
}
?>

View File

@ -1,294 +0,0 @@
<?
die('Что-то тут не так...');
/*
* Класс обработчика запроса от GameDealer.ru
* by victor niko
* niko@gamedealer.ru
* skype: victornikoua
* 14.09.2012
*
* $old = new Model_PartnerProjects_GamedealerReq;
$result = $old->init();
die((($result)));
*/
class Model_PartnerProjects_GamedealerReq{
private $allowIp = array(
'127.0.0.1'
);
private $gamedealerkey = '12345677';
var $projectid = 1;
function init(){
$ip = $_SERVER['REMOTE_ADDR'];
if(!in_array($ip,$this->allowIp))return $this->xml(array('status'=>-10,'desc'=>'ErrIP'));
//рабочий режим
//$xml = file_get_contents('php://input');
//тестовый режим. Параметры: check_balance / pay / getpacages / check_login
$xml = $this->testxml('check_balance');
$result = $this->parse($xml);
if(!is_object($result))return $this->xml(array('status'=>-50,'desc'=>'ErrorInitParse'));
if(isset($result->method)){
$methodname = 'gamedealer_'.(string)$result->method;
if(!method_exists($this, $methodname))return $this->xml(array('status'=>-20,'desc'=>'ErrMethod'));
try{
$resulttry = $this->$methodname($result);
return $this->xml($resulttry);
}catch(Exception $e){}
}
return $this->xml(array('status'=>-10,'desc'=>'MethodError '.$methodname.isset($e)?$e->getMessage():false));
}
private function _sign($method,$params=array()){
return md5(implode($params).$method.md5($this->gamedealerkey));
}
/*Генератор XML-ответа*/
function xml($arr=false){
header("Content-type: text/xml; charset=utf-8");
if(!$arr)$arr = array('status'=>-1,'desc'=>"ErrorXML");
$xml = '<gdanswer>'."\n";
foreach($arr as $k => $v){
$xml .= '<'.$k.'>'."";
if(is_array($v)){
foreach($v as $itemkey => $itemvalue){
if(is_array($itemvalue)){
$xml .= ' <item ';
foreach($itemvalue as $itemvalue_k => $itemvalue_v)$xml .= ' '.$itemvalue_k.'="'.$itemvalue_v.'" ';
$xml .= '></item>'."\n";
}else{
$xml .= '<'.$itemkey.'>'.$itemvalue.'</'.$itemkey.'>'."\n";
}
}
}else {
$xml .= $v;
}
$xml .= '</'.$k.'>'."\n";
}
$xml .= '</gdanswer>';
return $xml;
}
//проверка счета-акканта
function gamedealer_check_login($params){
$bank = isset($params->nick)?(int)$params->nick:false;
$projectid = isset($params->projectid)?(int)$params->projectid:false;
$sign = isset($params->sign)?(string)$params->sign:false;
$hash = $this->_sign('check_login',array($bank));
if($sign!=$hash)return array('status'=>-10,'desc'=>'SignError');
$check = $this->checkLoginByBank($bank);
if(isset($check['login'])){
return array('status'=>1,'desc'=>'Счет указан верно','addinfo'=>$check['login']);
}
return array('status'=>-100,'desc'=>'Ошибка проверки счета');
}
//запрос на оплату
function gamedealer_pay($params){
$bank = isset($params->nick)?(int)$params->nick:false;
$projectid = isset($params->projectid)?(int)$params->projectid:false;
$sign = isset($params->sign)?(string)$params->sign:false;
$paymentid = isset($params->payid)?(int)$params->payid:false; // уникальный номер платежа
$amount = isset($params->amount)?number_format((float)$params->amount,'2','.',''):false; //сумма в игровой валюте
$pacageid = isset($params->pacageid)?(int)$params->pacageid:''; //идентификатор покупки опции в ГД. если нету - платеж на счет юзера
$partneritemid = isset($params->partneritemid)?(int)$params->partneritemid:''; //идентификатор продукта в вашей системе
$additemid = isset($params->additemid)?(int)$params->additemid:''; //дополнительный идентификатор пакета
$paymethodid = isset($params->paymethodid)?(string)$params->paymethodid:false; //метод оплаты по системе геймдилер // может быть пустым)
$hash = $this->_sign('pay',array($bank,$projectid.$pacageid.$amount,$paymentid));
if($sign!=$hash)return array('status'=>-10,'desc'=>'SignError');
if($amount<0.01)return array('status'=>-20,'desc'=>'сумма слишком маленькая');
$check = $this->checkLoginByBank($bank);
if(!isset($check['login']))return array('status'=>-10,'desc'=>'Ошибка логина. счет неверный'); //логин перса добываем
return $this->oldbk_dopayment($paymentid,$bank,$projectid,$pacageid,$partneritemid,$amount,$check['login'],$additemid);
}
function gamedealer_check_balance($params){
$projectid = isset($params->projectid)?(int)$params->projectid:false;
$sign = isset($params->sign)?(string)$params->sign:false;
$method = 'check_balance';
if($sign != $this->_sign($method,array('projectid'=>$projectid)))return array('status'=>-10,'desc'=>"errSign");
$balance = 500;
return array('status'=>1,'desc'=>"Balance: ".$balance,'balance'=>$balance); //баланс в игре
}
function gamedealer_getpacages($params){
$sign = isset($params->sign)?(string)$params->sign:false;
$projectid = isset($params->projectid)?(int)$params->projectid:false;
$method = 'getpacages';
if($sign != $this->_sign($method,array('projectid'=>$projectid)))return array('status'=>-10,'desc'=>"errSign");
return array(
'status'=>1,
'desc'=>'Список снизу :)',
'pacages'=>array(
array(
'title'=>'Название сильвера',
'price'=>20,
'partneritemid'=>1 //ид в системе игры
),
array(
'title'=>'Название сильвера 2',
'price'=>20,
'partneritemid'=>1 //ид в системе игры
),
)
);
}
function parse($xml){
try{
return simplexml_load_string($xml);
}catch(Exception $e){
return false;
}
}
//тестовый интерфейс
function testxml($method='check_login'){
switch($method){
case 'check_login':
$nick = 243;
return '<?xml version="1.0" encoding="utf-8"?>
<gamedealer>
<method>check_login</method>
<nick>'.$nick.'</nick>
<projectid>1</projectid>
<sign>'.md5($nick.$method.md5($this->gamedealerkey)).'</sign>
</gamedealer>';
break;
case 'pay':
$amount= 0.01;
$nick = 243;
$projectid = 1;
$payid = 112222;
//$bank,$projectid.$pacageid.$amount,$paymentid
#echo "$nick.$projectid.$amount.$payid.$method";
$sign = md5($nick.$projectid.$amount.$payid.$method.md5($this->gamedealerkey));
return '<?xml version="1.0" encoding="utf-8"?>
<gamedealer>
<method>pay</method>
<nick>'.$nick.'</nick>
<projectid>'.$projectid.'</projectid>
<amount>'.$amount.'</amount>
<payid>'.$payid.'</payid>
<sign>'.$sign.'</sign>
</gamedealer>';
break;
case 'getpacages':
//список пакетов
return '<?xml version="1.0" encoding="utf-8"?>
<gamedealer>
<projectid>1</projectid>
<method>'.$method.'</method>
<sign>'.md5('1'.$method.md5($this->gamedealerkey)).'</sign>
</gamedealer>';
break;
case 'check_balance':
//баланс
return '<?xml version="1.0" encoding="utf-8"?>
<gamedealer>
<projectid>1</projectid>
<method>'.$method.'</method>
<sign>'.md5('1'.$method.md5($this->gamedealerkey)).'</sign>
</gamedealer>';
break;
}
}
//прием оплаты
private function oldbk_dopayment($paymentid,$bank,$projectid,$pacageid,$partneritemid,$amount,$login,$additemid){
//$additemid - дополнительный дентификатор пакета. например - ID клана
//если оплата на клан - projectid = 20099 // pacageid = 25 //partneritemid = 1 (в вашей системе)// additemid = 5 //идентификатор клана
//если пакеты
if($pacageid){
//если покупка билетов - то количество = amount/price ну и там округлять, остаток на счет.
return array('status'=>1,'desc'=>'Сильвер аккаунт успешно оплачен','paymentid'=>1); //уникальный номер платежа в системе проекта.
}else{
//просто оплата на баланс по счету
return array('status'=>1,'desc'=>'Счет попонен','paymentid'=>1); //уникальный номер платежа в системе проекта.
//или
return array('status'=>3,'desc'=>'Аккаунт уже оплачен с таким payid','paymentid'=>1);//уникальный номер платежа в системе проекта.
}
return array('status'=>-10,'desc'=>'Ошибка поиска карты/сильвера и т.п. или сумма не та');
}
//проверка счета
function checkLoginByBank($bank){
return array('status'=>1,'desc'=>'Bank exissts','login'=>'Администратор');
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -1,63 +0,0 @@
<?
session_start();
function er($e)
{
global $c;
die('<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><meta http-equiv="Content-Language" content="ru"><TITLE>Ïðîèçîøëà îøèáêà</TITLE></HEAD><BODY text="#FFFFFF"><p><font color=black>Ïðîèçîøëà îøèáêà: <pre>'.$e.'</pre><b><p><a href="https://'.$c[0].'/">Íàçàä</b></a><HR><p align="right">(c) <a href="https://'.$c[0].'/">'.$c[1].'</a></p></body></html>');
}
function GetRealIp()
{
if(!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip=$_SERVER['HTTP_CLIENT_IP'];
}elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}else{
$ip=$_SERVER['REMOTE_ADDR'];
}
return $ip;
}
define('IP',GetRealIp());
define('GAME',true);
include_once('_incl_data/__config.php');
include_once('_incl_data/class/__db_connect.php');
include_once('_incl_data/class/__user.php');
if(!isset($u->info['id']) || $u->info['ip'] != IP || $u->info['admin'] == 1) {
die('<meta http-equiv="refresh" content="0; URL=https://new-combats.com/">');
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Âèçóàëüíûé ðåäàêòîð Ëàáèðèíòîâ &copy; new-combats.com</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jqueryrotate.js"></script>
<script type="text/javascript" src="js/jquery.zclip.js"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script>
<script type="text/javascript" src="js/title.js"></script>
<link rel="stylesheet" type="text/css" href="css/clu0b.css" />
<link rel="stylesheet" type="text/css" href="css/windows.css" />
</head>
<body>
<div style="background:#CCCCCC;padding:10px;">
<span style="padding:5px; background:#999999;"><span style="color:#CCCCCC">#</span> <b>1</b></span>
<select name="select" id="select">
<option value="0">Âûáåðèòå íîìåð ïåùåðû</option>
<? $i = 0; while($i <= 100) { ?>
<option value="<?=$i?>"><?=$i?></option>
<? } ?>
</select>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,45 @@
<?php
namespace Magic\Elemental;
use Battle;
use Insallah\Math;
class Fire
{
private $btl;
private $color = '#a00';
private $colorCrit = '#f00';
private $colorMiss = '#909090';
public function __construct(Battle $btl)
{
$this->btl = $btl;
}
/** Âñïûøêà. Ïðè¸ìû: 34(8), 67(9), 68 (10), 69(11)
* @param $level
* @param $fireTargetMultiplier
* @return array
*/
public function Flash($level, $fireTargetMultiplier = 0)
{
$baseDamage = [
8 => [40, 40],
9 => [45, 45],
10 => [50, 50],
11 => [60, 60],
];
if (!is_numeric($fireTargetMultiplier)) {
$fireTargetMultiplier = 0;
}
$rawDamage = mt_rand($baseDamage[$level][0], $baseDamage[$level][1]);
$rawDamage = Math::addPercent($rawDamage, $fireTargetMultiplier);
return [
'name' => "Âñïûøêà [$level]",
'damage' => $rawDamage,
'color' => $this->color,
'colorCrit' => $this->colorCrit,
'colorMiss' => $this->colorMiss,
];
}
}

View File

@ -4,7 +4,7 @@ if(!defined('GAME'))
die();
}
class Magic
class Magic2
{
public $youuse = 0;

View File

@ -1,14 +1,11 @@
<?
if(!defined('GAME'))
{
if (!defined('GAME')) {
die();
}
if ($itm['magic_inci'] == 'yarostzvezd') {
$pvr = array();
$pvr = [];
//Äåéñòâèå ïðè êëèêå
$pvr['trs7'] = 5;
@ -31,13 +28,35 @@ if( $itm['magic_inci'] == 'yarostzvezd' ) {
mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $u->info['id'] . '" AND `id_eff` = 22 AND `v1` = "priem" AND `v2` = 325');
mysql_query("
INSERT INTO `eff_users` ( `id_eff`, `uid`, `name`, `data`, `overType`, `timeUse`, `timeAce`, `user_use`, `delete`, `v1`, `v2`, `img2`, `x`, `hod`, `bj`, `sleeptime`, `no_Ace`, `file_finish`, `tr_life_user`, `deactiveTime`, `deactiveLast`, `mark`, `bs`) VALUES
( 22, '".$u->info['id']."', 'ßðîñòü Õîëîäíûõ Çâåçä', 'add_acestar=1', 0, 77, 0, '".$u->info['id']."', 0, 'priem', 325, 'elementalcrit.gif', 1, -1, 'ÿðîñòüõîëîäíûõçâåçä', 0, 0, '', 0, 0, 0, 1, 0);
INSERT INTO `eff_users` (
`id_eff`,
`uid`,
`name`,
`data`,
`overType`,
`timeUse`,
`timeAce`,
`user_use`,
`delete`,
`v1`,
`v2`, `img2`, `x`, `hod`, `bj`, `sleeptime`, `no_Ace`, `file_finish`, `tr_life_user`, `deactiveTime`, `deactiveLast`, `mark`, `bs`) VALUES
(
22,
'" . $u->info['id'] . "',
'ßðîñòü Õîëîäíûõ Çâåçä',
'add_acestar=1',
0,
77,
0,
'" . $u->info['id'] . "',
0,
'priem',
325,
'elementalcrit.gif', 1, -1, 'ÿðîñòüõîëîäíûõçâåçä', 0, 0, '', 0, 0, 0, 1, 0);
");
$u->error = '<font color=red><b>Âû ïî÷óâñòâîâàëè ñèëó... </b></font>';
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm['id'] . ' LIMIT 1');
} else {
$u->error = '<font color=red><b>Ñâèòîê âîçìîæíî èñïîëüçîâàòü òîëüêî â áîþ</b></font>';
}

File diff suppressed because one or more lines are too long

View File

@ -1,196 +0,0 @@
<?
if(!defined('GAME')) { die(); }
class noob {
//Ïåðåìåííûå
public static $info = array(); //òåêóùèé êâåñò
/*
Ïðîâåðêà äåéñòâèÿ
*/
public static function test1($var) {
global $u;
$r = false;
$var = explode('=',$var);
if( $var[0] == 'slot' ) {
//Îäåò ëè â ñëîò ïðåäìåò
$test = mysql_fetch_array(mysql_query('SELECT `id`,`item_id` FROM `items_users` WHERE `uid` = "'.$u->info['id'].'" AND `inOdet` = "'.mysql_real_escape_string($var[1]).'" AND `delete` = 0 LIMIT 1'));
if(isset($test['id'])) {
if($var[2] == 0 || $var[2] == $test['item_id'] ) {
$r = true;
}
}
}
return $r;
}
/*
Ïðîâåðêè êâåñòà
*/
public static function testAll() {
global $u;
//Äîï ïðîâåðêè
$go = 1;
//Îïûò
$ex = explode('>',self::$info['module']);
if( $ex[0] == 'exp' ) {
if( $ex[1] < $u->info['exp'] ) {
self::$info['module'] = '';
}
}
$ex = explode('<',self::$info['module']);
if( $ex[0] == 'exp' ) {
if( $ex[1] < $u->info['exp'] ) {
mysql_query('UPDATE `users` SET `fnq` = "'.self::$info['next'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
self::$info['module'] = '';
}
}
//Îñòàëüíîå
$ex = explode('=',self::$info['module']);
if( $ex[0] == 'slots' ) {
//Íàäåòûå ïðåäìåòû â ñëîòû
$ex2 = explode(',',$ex[1]);
$i = 0; $gd = 1;
while( $i < count($ex2) ) {
if( !isset($u->stats['wp' . $ex2[$i] . 'id']) ) {
$gd = 0;
}
$i++;
}
if( $gd == 1 ) {
self::$info['module'] = '';
}
}
//
$go = 1;
//Òðåáîâàíèÿ
$e1 = explode('|',self::$info['tr']);
$i = 0;
while( $i < count($e1) ) {
$ex = explode('=',$e1[$i]);
//
if( $ex[0] == 'exp' ) {
if( $ex[1] == '>' ) {
if( $ex[2] > $u->info['exp'] ) {
$go = 0;
}
}elseif( $ex[1] == '<' ) {
if( $ex[2] < $u->info['exp'] ) {
$go = 0;
}
}
}
//
$i++;
}
//
//
return $go;
}
/*
Íà÷àëî ïðîâåðêè îáó÷åíèÿ
*/
public static function start() {
global $u;
if( $u->info['fnq'] == 0 ) {
$u->info['fnq'] = 1;
mysql_query('UPDATE `users` SET `fnq` = "'.$u->info['fnq'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}else{
if( $u->info['level'] > 2 ) {
mysql_query('UPDATE `users` SET `fnq` = "-1" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}
}
if( $u->info['fnq'] == 0 ) {
//Íà÷àëî îáó÷åíèÿ
/*$humor = array(
0 => array(
':maniac: Ñèëüíî íå áåéòå ;)',':beggar: Áóäåò ïîïðîøàéíè÷àòü - áåéòå!',':pal: Âîçìîæíî ñâåòëûé!',
':vamp: Âîçìîæíî òåìíûé!',':susel: Ñóäÿ ïî çäîðîâåííîìó á
':friday: Íå äîëãî äóìàâ îí íà÷àë èñêàòü ñîáóòûëüíèêà!',':doc: Ëåêàðü: Íîâè÷îê! Äà, äà! Òû! Åñëè òåáÿ ñëîìàþò - ó çíàõàðÿ òåáÿ ñîáåðóò îáðàòíî!'
),
1 => array(
':maniac: Ïîìíèòå! Äåâî÷åê íå áüåì ;)',':nail: Îíà êðàñèò íîãòè, íå îòâëåêàéòå âñå ñðàçó ;)',':pal: Âîçìîæíî ñâåòëàÿ!',
':vamp: Âîçìîæíî òåìíàÿ!',':rev: Ñóäÿ ïî êðàñèâîé îäåæäå - ýòî æåíùèíà!',':hug: È ñðàçó æå êèíóëàñü âñåõ öåëîâàòü!',
':angel2: Àíãåë ñîøåë ñ íåáåñ...'
)
);
$humor = $humor[$u->info['sex']];
*/
$u->info['fnq'] = 1;
mysql_query('UPDATE `users` SET `fnq` = "'.$u->info['fnq'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
//Îòïðàâëÿåì ñîîáùåíèå â ÷àò î íîâè÷êå
//$u->send('','','','','','Â íàøåì ìèðå ïîÿâèëñÿ íîâûé èãðîê &quot;<b>' . $u->info['login'] . '</b>&quot;! '.$humor[rand(0,count($humor)-1)].'',time(),6,0,0,0,1,0);
}else{
self::$info = mysql_fetch_array(mysql_query('SELECT * FROM `an_quest` WHERE `id` = "'.$u->info['fnq'].'" LIMIT 1'));
if(isset(self::$info['id'])) {
//Òåñòèðóåì êâåñò
$go = self::testAll();
if( $go == 0 ) {
//Òðåáîâàíèÿ íå ïîäõîäÿò
self::$info = array();
}elseif( $u->info['marker'] == self::$info['module'] || self::$info['module'] == '' || (self::$info['module'] == 'next' && isset($_GET['nextfnq'])) || self::test1(self::$info['module']) == true ) {
//Êâåñò âûïîëíåí, äåéñòâèå ñäåëàíî!
if( self::$info['room'] == '' || self::$info['room'] == $u->room['name'] ) {
//Âûäàåì íàãðàäó
$nag = explode('|',self::$info['win']);
if( $nag[3] != '0' ) {
//Âûäàåì ïðåäìåò
$ng = explode(',',$nag[3]);
$i = 0;
while( $i < count($ng) ) {
$ngi = explode(',',$ng[$i]);
$j = 0;
while( $j < count($ngi) ) {
$ngj = explode('=',$ngi[$j]);
// id = srok = data
$ngjs = '';
if( $ngj[1] > 0 ) {
$ngjs .= '|srok='.$ngj[1].'';
}
$u->addItem($ngj[0], $u->info['id'], $ngjs);
$j++;
}
$i++;
}
}
if( $nag[4] != '0' ) {
//Âûäàåì çóáû
$u->info['money4'] += $nag[4];
mysql_query('UPDATE `users` SET `money4` = "'.$u->info['money4'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}
$u->info['fnq'] = self::$info['next'];
mysql_query('UPDATE `users` SET `fnq` = "'.$u->info['fnq'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
self::$info = mysql_fetch_array(mysql_query('SELECT * FROM `an_quest` WHERE `id` = "'.$u->info['fnq'].'" LIMIT 1'));
$go = self::testAll();
if( $go == 0 || self::$info['act'] == 'deadline' ) {
//Òðåáîâàíèÿ íå ïîäõîäÿò
self::$info = array();
}
}
}else{
//Òåêóùèé êâåñò
}
if(isset(self::$info['id'])) {
self::$info['info'] = str_replace('{login}',$u->info['login'],self::$info['info']);
self::$info['info'] = str_replace('{level}',$u->info['level'],self::$info['info']);
self::$info['info'] = str_replace("\r\n",'<br>',self::$info['info']);
echo '<script>top.noob.takeData("'.self::$info['id'].'","'.self::$info['ico_bot'].'","'.self::$info['name_bot'].'","'.self::$info['name'].'","'.self::$info['act'].'","'.self::$info['next'].'","'.str_replace('"','&quot;',self::$info['info']).'");</script>';
}else{
echo '<script>top.noob.no();</script>';
}
}else{
//Êâåñò íå íàéäåí
echo '<script>top.noob.no();</script>';
}
//
}
}
}
?>

View File

@ -1,243 +0,0 @@
<?php
class GameDealerClass {
//Êîíôèãóðàöèè
public $c = array(
/* MySQL Áàçà äàííûõ */
'db_name' => 'pay_operations', //Òàáëèöà â êîòîðóþ çàíîñÿòñÿ äàííûå
'db_host' => 'localhost',
'db_user' => 'newcom1_abk',
'db_pass' => '4nWYsIM[c?}P',
'db_base' => 'newcom1_abk',
/* Íàñòðîéêè ïëàòåæåé */
'ip_list' => array('127,0,0,1,188.166.34.68,136.243.38.147,136.243.38.149,136.243.38.150,136.243.38.151,136.243.38.189,88.198.88.98'), //Óêàçûâàòü ÷åðåç çàïÿòóþ (Ðàçðåøåííûå IP)
'key' => 'qtzl0igb', //gamedealer key
'id' => '65643' //ID ïðîåêòà
),
$ip = '',
$BACK = array(); //Ðåçóëüòàò êîòîðûé âîçâðàùàåì â êîíöå
//Êîäèðóåì èç ÞÒÔ-8 â Êèðèëèöó
public function in($text) {
return iconv("UTF-8","cp1251",$text);
}
//Êîäèðóåì èç Êèðèëèöó â ÞÒÔ-8
public function out($text) {
return iconv("cp1251","UTF-8",$text);
}
//Äîáàâëÿåì äàííûå â áàçó äàííûõ
public function add($type,$value,$money) {
mysql_query('INSERT INTO `'.$this->c['db_name'].'` (`time`,`type`,`ip`,`value`,`money`,`project`) VALUES ("'.time().'","'.mysql_real_escape_string($type).'","'.$_SERVER['HTTP_X_REAL_IP'].'","'.mysql_real_escape_string($value).'","'.mysql_real_escape_string($money).'","'.mysql_real_escape_string($this->id).'")');
}
//Ïîäêëþ÷àåìñÿ ê áàçå äàííûõ
public function connect_db() {
$db = mysql_connect($this->c['db_host'],$this->c['db_user'],$this->c['db_pass']) or die('Îøèáêà ïîäêëþ÷åíèÿ ê MySQL ñåðâåðó!');
mysql_select_db($this->c['db_base'],$db) or die('Îøèáêà ïîäêëþ÷åíèÿ ê áàçå äàííûõ!');
mysql_query('SET NAMES cp1251');
}
public function output($a,$v = NULL) {
$r = '';
$i = 0;
while($i < count($a)) {
$rn = '';
$tb = '';
if($v != NULL) {
$rn = "\r\n";
$tb = " ";
}
$r .= $rn.'<'.$a[$i][0].'>';
if(!is_array($a[$i][1])) {
$rn = '';
$tb = '';
$r .= $rn.$tb.($this->out($a[$i][1]));
}else{
if($i > 0) {
$r .= $rn;
}
$r .= $tb.($this->output($a[$i][1],1));
}
$r .= $rn.'</'.$a[$i][0].'>';
$i++;
}
return $r;
}
//Ãåíåðèðóåì XML-ôàéë
public function backInformation() {
header('Content-Type: text/html/force-download');
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo $this->output($this->BACK,1);
}
//Ïðîâåðêà ñóùåñòâîâàíèÿ ïåðñîíàæà
public function test_accaunt($nick) {
$r = false;
$nick = mysql_fetch_array(mysql_query('SELECT `id` FROM `bank` WHERE `id` = "'.mysql_real_escape_string($nick).'" LIMIT 1'));
if(isset($nick['id'])) {
$r = true;
}
return $r;
}
//Ïîëó÷àåò ñ÷åò â áàíêå ïî ëîãèíó
public function getBank($nick) {
$nick = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "'.mysql_real_escape_string($nick).'" LIMIT 1'));
$nick = mysql_fetch_array(mysql_query('SELECT `id` FROM `bank` WHERE `uid` = "'.mysql_real_escape_string($nick['id']).'" LIMIT 1'));
return $nick['id'];
}
//Ïîèñê ëîãèíà
public function bank_user($nick) {
$nick = mysql_fetch_array(mysql_query('SELECT `id`,`uid FROM `bank` WHERE `id` = "'.mysql_real_escape_string($nick).'" LIMIT 1'));
$nick = mysql_fetch_array(mysql_query('SELECT `id`,`login` FROM `users` WHERE `login` = "'.mysql_real_escape_string($nick['uid']).'" LIMIT 1'));
return $nick['login'];
}
//Íà÷èíàåì îáðàáîòêó çàïðîñîâ
public function start_session() {
$this->ip = $_SERVER['HTTP_X_REAL_IP'];
//Ïîäêëþ÷àåìñÿ ê ÁÄ
$this->connect_db();
//Ïîëó÷àåì äàííûå çàïðîñà
//$xml = file_get_contents('php://input');
//Ïàðñèíã XML çàïðîñà
if(function_exists('simplexml_load_string')) {
$xml = simplexml_load_string($xml);
}else{
$this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc','Íå óäàëîñü ïðîèçâåñòè îáðàáîòêó çàïðîñà'))));
die($this->backInformation());
}
$this->id = $xml->projectid;
if(!in_array($this->ip,$this->c['ip_list'])) {
$this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc','Íåò äîñòóïà ñ äàííîãî IP'))));
die($this->backInformation());
}
//Îáðàáîòêà çàïðîñîâ
if($xml->method == 'check_balance') {
//<sign>MD5(method+MD5(gdKey))</sign>
$sign = md5($xml->method.md5($this->c['key']));
if($sign == $xml->sign) {
//Áàëàíñ äèëåðà
$balance = 1000000;
$this->BACK = array(array('gdanswer',array(array('status','1'),array('desc','Áàëàíñ äèëåðà: '.$balance),array('balance',$balance))));
$this->add('4','check:'.$xml->nick.':1'.$r,0);
}
}elseif($xml->method == 'check') {
/*
nick - ëîãèí ïåðñîíàæà <sign>MD5(nick+method+MD5(gdKey))</sign> */
$sign = md5($xml->nick.$xml->method.md5($this->c['key']));
if($sign == $xml->sign) {
$xml->nick = $this->in($xml->nick);
if($this->test_accaunt($xml->nick) == true) {
//Ïåðñîíàæ íàéäåí è çà÷èñëÿåì åìó èãðîâóþ âàëþòó
$this->BACK = array(array('gdanswer',array(array('status','1'),array('desc','Áàíêîâñêèé ñ÷åò íàéäåí'))));
$this->add('3','check:'.$xml->nick.':1'.$r,0);
}else{
//Ïåðñîíàæ íå íàéäåí
$this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc','Ïëàòåæ íå îáðàáîòàí. Áàíêîâñêèé ñ÷åò íå íàéäåí.'))));
$this->add('-1','Ïåðñîíàæ íå íàéäåí:pay:'.$xml->nick.':0',0);
}
}
}elseif($xml->method == 'pay') {
/* Ïðîâîäèì ïëàòåæ
nick - ëîãèí àêêàóíòà , projectid - id ïðîåêòà , sign , amount - äåíüãè , payid - id ïëàòåæà */
$sign = md5($xml->nick.$xml->projectid.$xml->amount.$xml->payid.$xml->method.md5($this->c['key']));
if($sign == $xml->sign) {
$xml->nick = $this->in($xml->nick);
if($this->test_accaunt($xml->nick) == true) {
//Ïåðñîíàæ íàéäåí è çà÷èñëÿåì åìó èãðîâóþ âàëþòó
$bank = $this->test_accaunt($xml->nick);
if($bank > 0) {
mysql_query('UPDATE `bank` SET `money2` = `money2` + '.mysql_real_escape_string($xml->amount).' WHERE `id` = "'.mysql_real_escape_string($xml->nick).'" LIMIT 1');
$this->BACK = array(array('gdanswer',array(array('status','1'),array('desc','Ïëàòåæ ïðîøåë óñïåøíî'),array('id',$this->c['id']))));
$this->add('2','pay:'.$xml->nick.':'.$xml->projectid.':'.$xml->sign.':'.$xml->amount.':'.$xml->payid.':'.$bank['id'],$xml->amount);
$user = mysql_fetch_array(mysql_query('SELECT `id`,`uid` FROM `bank` WHERE `id` = "'.mysql_real_escape_string($xml->nick).'" LIMIT 1'));
$user = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`city`,`sex`,`room` FROM `users` WHERE `id` = "'.mysql_real_escape_string($user['uid']).'" LIMIT 1'));
mysql_query('UPDATE `users` SET `catch` = `catch` + '.mysql_real_escape_string(floor($xml->amount)).' WHERE `id` = "'.mysql_real_escape_string($xml->nick).'" LIMIT 1');
$r = '<span class=date>'.date('d.m.Y H:i').'</span> Àëõèìèê <img src=https://img.new-combats.com/i/align/align50.gif width=12 height=15 /><u><b>Enchanter</b> / Àâòîìàòè÷åñêàÿ îïëàòà</u> ñîîáùàåò: ';
if($user['sex'] == 1) {
$r .= 'Óâàæàåìàÿ';
}else{
$r .= 'Óâàæàåìûé';
}
$r .= ' <b>'.$user['login'].'</b>, íà Âàø áàíêîâñêèé ñ÷åò ¹'.$bank.' çà÷èñëåíî '.$xml->amount.' Ekr. Áëàãîäàðèì Âàñ çà ïîêóïêó!';
mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$user['city']."','".$user['room']."','','".$user['login']."','".$r."','-1','5','0')");
}else{
$this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc','Ó ïîëüçîâàòåëÿ îòñóòñòâóåò áàíê'),array('id',$this->c['id']))));
$this->add('-1','Ó ïåðñîíàæà îòñóòñòâóåò áàíê:pay:'.$xml->nick.':'.$xml->projectid.':'.$xml->sign.':'.$xml->amount.':'.$xml->payid.':'.$bank['id'],$xml->amount);
}
}else{
//Ïåðñîíàæ íå íàéäåí
$this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc','Ïëàòåæ íå îáðàáîòàí. Ïåðñîíàæ íå íàéäåí.'))));
$this->add('-1','Ïåðñîíàæ íå íàéäåí:pay:'.$xml->nick.':0',0);
}
}else{
//Îøèáêà ñèãíàòóðû
$this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc','Îøèáêà ñèãíàòóðû'))));
$this->add('-1','Îøèáêà ñèãíàòóðû:pay:'.$xml->nick.':0',0);
}
}elseif($xml->method == 'check_login') {
/* Ïðîâåðêà àêêàóíòà
nick - ëîãèí àêêàóíòà , projectid - id ïðîåêòà , sign */
$sign = md5($xml->nick.$xml->method.md5($this->c['key']));
if($sign == $xml->sign) {
$xml->nick = $this->in($xml->nick);
if($this->test_accaunt($xml->nick) == true) {
//Ïåðñîíàæ íàéäåí
$this->BACK = array(array('gdanswer',array(array('status','1'),array('desc','Ñ÷åò íàéäåí'),array('addinfo',$this->bank_user($xml->nick)))));
$this->add('1','check_login:'.$xml->nick.':1'.$r,0);
}else{
//Ïåðñîíàæ íå íàéäåí
$this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc','Ñ÷åò íå íàéäåí'))));
$this->add('-1','Ïåðñîíàæ íå íàéäåí:check_login:'.$xml->nick.':0',0);
}
}else{
//Îøèáêà ñèãíàòóðû
$this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc','Îøèáêà ñèãíàòóðû'))));
$this->add('-1','Îøèáêà ñèãíàòóðû:pay:'.$xml->nick.':0',0);
}
}else{
$this->BACK = array(array('gdanswer',array(array('status','-1'),array('desc','Íåèçâåñòíûé òèï çàïðîñà'))));
$this->add('-1','Íåèçâåñòíûé òèï çàïðîñà:error_method:gamedealer',0);
}
//Çàíîñèì èíôîðìàöèþ
/* Ïðèìåð ðåçóëüòàòà çàïðîñà
$this->BACK = array(
array('gdanswer',array(array('status',-100),array('desc','Îïèñàíèå çàïðîñà')))
);
*/
//Âîçâðàùàåì ðåçóëüòàò
$this->backInformation();
}
}
$pay = new GameDealerClass;
$pay->start_session();
?>

View File

@ -28,7 +28,7 @@ $pvr = array();
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$this->ue['id'],$pvr['hp'],0);
$this->mg2static_points( $this->ue['id'] , $btl->stats[$btl->uids[$this->ue['id']]] );
$this->addAirStaticPoints(); /* Óäàð â Ñòàòèêó*/
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];
@ -103,7 +103,7 @@ $pvr = array();
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$pvr['uid'],$pvr['hp'],0);
$this->mg2static_points( $pvr['uid'] , $btl->stats[$btl->uids[$pvr['uid']]] );
$this->addAirStaticPoints($pvr['uid']); /* Óäàð â Ñòàòèêó*/
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];

View File

@ -28,7 +28,7 @@ $pvr = array();
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$this->ue['id'],$pvr['hp'],0);
$this->mg2static_points( $this->ue['id'] , $btl->stats[$btl->uids[$this->ue['id']]] );
$this->addAirStaticPoints(); /* Óäàð â Ñòàòèêó*/
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];
@ -103,7 +103,7 @@ $pvr = array();
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$pvr['uid'],$pvr['hp'],0);
$this->mg2static_points( $pvr['uid'] , $btl->stats[$btl->uids[$pvr['uid']]] );
$this->addAirStaticPoints($pvr['uid']); /* Óäàð â Ñòàòèêó*/
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];

View File

@ -39,7 +39,7 @@ while( $pvr['ix'] < count($btl->users) ) {
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$pvr['uid'],$pvr['hp'],0);
$this->mg2static_points( $pvr['uid'] , $btl->stats[$btl->uids[$pvr['uid']]] );
$this->addAirStaticPoints($pvr['uid']); /* Óäàð â Ñòàòèêó*/
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];

View File

@ -39,7 +39,7 @@ $pvr = array();
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$pvr['uid'],$pvr['hp'],0);
$this->mg2static_points( $pvr['uid'] , $btl->stats[$btl->uids[$pvr['uid']]] );
$this->addAirStaticPoints($pvr['uid']); /* Óäàð â Ñòàòèêó*/
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];

View File

@ -39,7 +39,7 @@ while( $pvr['ix'] < count($btl->users) ) {
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$pvr['uid'],$pvr['hp'],0);
$this->mg2static_points( $pvr['uid'] , $btl->stats[$btl->uids[$pvr['uid']]] );
$this->addAirStaticPoints($pvr['uid']); /* Óäàð â Ñòàòèêó*/
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];

View File

@ -60,11 +60,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
mysql_query('UPDATE `eff_users` SET `data` = "'.$pvr['redata'].'" WHERE `id` = "'.$btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['id'].'" LIMIT 1');
//
$pvr['hp'] = floor($pvr['hp']);
/*$pvr['hp'] = $priem->magatack( $u2, $u1, $pvr['hp'], 'âîäŕ', 0 );
$pvr['promah_type'] = $pvr['hp'][3];
$pvr['promah'] = $pvr['hp'][2];
$pvr['krit'] = $pvr['hp'][1];
$pvr['hp'] = $pvr['hp'][0];*/
$pvr['hpSee'] = '--';
$pvr['hpNow'] = floor($btl->stats[$btl->uids[$u1]]['hpNow']);
$pvr['hpAll'] = $btl->stats[$btl->uids[$u1]]['hpAll'];

View File

@ -60,11 +60,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
mysql_query('UPDATE `eff_users` SET `data` = "'.$pvr['redata'].'" WHERE `id` = "'.$btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['id'].'" LIMIT 1');
//
$pvr['hp'] = floor($pvr['hp']);
/*$pvr['hp'] = $priem->magatack( $u2, $u1, $pvr['hp'], 'âîäŕ', 0 );
$pvr['promah_type'] = $pvr['hp'][3];
$pvr['promah'] = $pvr['hp'][2];
$pvr['krit'] = $pvr['hp'][1];
$pvr['hp'] = $pvr['hp'][0];*/
$pvr['hpSee'] = '--';
$pvr['hpNow'] = floor($btl->stats[$btl->uids[$u1]]['hpNow']);
$pvr['hpAll'] = $btl->stats[$btl->uids[$u1]]['hpAll'];

View File

@ -60,11 +60,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
mysql_query('UPDATE `eff_users` SET `data` = "'.$pvr['redata'].'" WHERE `id` = "'.$btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['id'].'" LIMIT 1');
//
$pvr['hp'] = floor($pvr['hp']);
/*$pvr['hp'] = $priem->magatack( $u2, $u1, $pvr['hp'], 'âîäŕ', 0 );
$pvr['promah_type'] = $pvr['hp'][3];
$pvr['promah'] = $pvr['hp'][2];
$pvr['krit'] = $pvr['hp'][1];
$pvr['hp'] = $pvr['hp'][0];*/
$pvr['hpSee'] = '--';
$pvr['hpNow'] = floor($btl->stats[$btl->uids[$u1]]['hpNow']);
$pvr['hpAll'] = $btl->stats[$btl->uids[$u1]]['hpAll'];

View File

@ -60,11 +60,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
mysql_query('UPDATE `eff_users` SET `data` = "'.$pvr['redata'].'" WHERE `id` = "'.$btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['id'].'" LIMIT 1');
//
$pvr['hp'] = floor($pvr['hp']);
/*$pvr['hp'] = $priem->magatack( $u2, $u1, $pvr['hp'], 'âîäŕ', 0 );
$pvr['promah_type'] = $pvr['hp'][3];
$pvr['promah'] = $pvr['hp'][2];
$pvr['krit'] = $pvr['hp'][1];
$pvr['hp'] = $pvr['hp'][0];*/
$pvr['hpSee'] = '--';
$pvr['hpNow'] = floor($btl->stats[$btl->uids[$u1]]['hpNow']);
$pvr['hpAll'] = $btl->stats[$btl->uids[$u1]]['hpAll'];

View File

@ -60,11 +60,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
mysql_query('UPDATE `eff_users` SET `data` = "'.$pvr['redata'].'" WHERE `id` = "'.$btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['id'].'" LIMIT 1');
//
$pvr['hp'] = floor($pvr['hp']);
/*$pvr['hp'] = $priem->magatack( $u2, $u1, $pvr['hp'], 'âîäŕ', 0 );
$pvr['promah_type'] = $pvr['hp'][3];
$pvr['promah'] = $pvr['hp'][2];
$pvr['krit'] = $pvr['hp'][1];
$pvr['hp'] = $pvr['hp'][0];*/
$pvr['hpSee'] = '--';
$pvr['hpNow'] = floor($btl->stats[$btl->uids[$u1]]['hpNow']);
$pvr['hpAll'] = $btl->stats[$btl->uids[$u1]]['hpAll'];

View File

@ -1,4 +1,5 @@
<?
<?php
if (!defined('GAME')) {
die();
}
@ -6,54 +7,22 @@ if(!defined('GAME')) {
Ïðèåì: Ïðèçðà÷íàÿ çàùèòà
Ñëåäóþùèé óäàð ïðîòèâíèêà ïî âàì íàíåñåò íà 75% ìåíüøå óðîíà
*/
$pvr = array();
$pvr = [];
if (isset($pr_momental_this)) {
$fx_moment = function ($uid, $enemy, $j_id, $yron, $profil) {
if (!isset($btl->stats[$btl->uids[$uid]]['um_priem'][$j_id])) {
global $u, $btl;
$yron = $yron/4;
global $btl;
$btl->priemAddLogFast($uid, 0, "Ïðèçðà÷íàÿ çàùèòà",
'{tm1} '.$btl->addlt(1 , 17 , $btl->users[$btl->uids[$uid]]['sex'] , NULL).'',
'{tm1} ' . $btl->addlt(1, 17, $btl->users[$btl->uids[$uid]]['sex'], null),
0, time());
if( $yron < 0 ) {
$yron = 1;
}
//$yron = max($yron / 4, 1);
$btl->stats[$btl->uids[$uid]]['um_priem'][$j_id] = true;
}
return round($yron);
};
} elseif (isset($pr_tested_this)) {
$fx_priem = function ($id, $at, $uid, $j_id) {
// -- íà÷àëî ïðèåìà
global $u, $btl;
//
//Ïàðàìåòðû ïðèåìà
$pvr['used'] = 0;
//
$uid1 = $btl->atacks[$id]['uid1'];
$uid2 = $btl->atacks[$id]['uid2'];
if( $uid == $uid2 ) {
$a = 1;
$b = 2;
$u1 = ${'uid1'};
$u2 = ${'uid2'};
}elseif( $uid == $uid1 ) {
$a = 2;
$b = 1;
$u1 = ${'uid2'};
$u2 = ${'uid1'};
}
/*
if((!isset($btl->atacks[$id]['newsf5']) || $btl->atacks[$id]['newsf5'] == false) && (!isset($btl->atacks[$id]['stopfx']) || $btl->atacks[$id]['stopfx'] == false)) {
if( isset($at['p'][$a]['priems']['kill'][$uid][$j_id]) ) {
mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$btl->stats[$btl->uids[$uid]]['u_priem'][$j_id][3].'" AND `uid` = "'.$uid.'" LIMIT 1');
unset($btl->stats[$btl->uids[$uid]]['u_priem'][$j_id]);
$btl->stats[$btl->uids[$uid]]['u_priem'][$j_id] = false;
}
}
*/
//
// -- êîíåö ïðèåìà
return $at;
};
unset($pr_used_this);
@ -65,60 +34,52 @@ if( isset($pr_momental_this)) {
//Ïàðàìåòðû ïðèåìà
$pvr['used'] = 0;
//
$uid1 = $btl->atacks[$id]['uid1'];
$uid2 = $btl->atacks[$id]['uid2'];
if( $uid == $uid2 ) {
$a = 1;
$b = 2;
$u1 = ${'uid1'};
$u2 = ${'uid2'};
}elseif( $uid == $uid1 ) {
$a = 2;
$b = 1;
$u1 = ${'uid2'};
$u2 = ${'uid1'};
}
if( $a > 0 ) {
$j = 0; $k = 0; $wp = 3;
while($j < count($at['p'][$a]['atack'])) {
if( isset($at['p'][$a]['atack'][$j]['yron']) && (
$at['p'][$a]['atack'][$j][1] == 1 ||
$at['p'][$a]['atack'][$j][1] == 4 ||
$at['p'][$a]['atack'][$j][1] == 5 )) {
//if( !isset($at['p'][$a]['priems']['kill'][$uid][$j_id]) ) {
//
$at['p'][$a]['atack'][$j]['yron']['y'] = round($at['p'][$a]['atack'][$j]['yron']['y']/4);
$at['p'][$a]['atack'][$j]['yron']['r'] = round($at['p'][$a]['atack'][$j]['yron']['r']/4);
$at['p'][$a]['atack'][$j]['yron']['k'] = round($at['p'][$a]['atack'][$j]['yron']['k']/4);
$at['p'][$a]['atack'][$j]['yron']['m_k'] = round($at['p'][$a]['atack'][$j]['yron']['m_k']/4);
$at['p'][$a]['atack'][$j]['yron']['m_y'] = round($at['p'][$a]['atack'][$j]['yron']['m_y']/4);
//
if( $at['p'][$a]['atack'][$j]['yron']['y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['y'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['r'] >= 0 ) { $at['p'][$a]['atack'][$j]['yron']['r'] = -1; }
if( $at['p'][$a]['atack'][$j]['yron']['k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['k'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['m_k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_k'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['m_y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_y'] = 1; }
//
/*if( $pvr['used'] == 0 ) {
$at['p'][$a]['atack'][$j]['yron']['plog'][] = '$this->priemAddLog( '.$id.', '.$b.', '.$a.', '.$u2.', '.$u1.',
"Ïðèçðà÷íàÿ çàùèòà",
"{tm1} '.$btl->addlt($b , 17 , $btl->users[$btl->uids[$u2]]['sex'] , NULL).'",
'.($btl->hodID + 1).' );';
}*/
// ñïàñåíèå
$btl->spaCheck($u1);
// ñïàñåíèå
//
$at['p'][$a]['atack'][$j]['yron']['used'][] = array($j_id,$uid,$pvr['used']);
$at['p'][$a]['atack'][$j]['yron']['kill'][] = array($j_id,$uid,$pvr['kill']);
//
$at['p'][$a]['priems']['kill'][$uid][$j_id] = true;
// $uid1 = $btl->atacks[$id]['uid1'];
// $uid2 = $btl->atacks[$id]['uid2'];
// if ($uid == $uid2) {
// $a = 1;
// $b = 2;
// $u1 = $uid1;
// $u2 = $uid2;
// } elseif ($uid == $uid1) {
// $a = 2;
// $b = 1;
// $u1 = $uid2;
// $u2 = $uid1;
// }
}
$j++;
}
}
// -- êîíåö ïðèåìà
// if ($a > 0) {
// $j = 0;
// $k = 0;
// $wp = 3;
// while ($j < count($at['p'][$a]['atack'])) {
// if (
// isset($at['p'][$a]['atack'][$j]['yron']) &&
// (
// $at['p'][$a]['atack'][$j][1] == 1 ||
// $at['p'][$a]['atack'][$j][1] == 4 ||
// $at['p'][$a]['atack'][$j][1] == 5
// )
// ) {
// $at['p'][$a]['atack'][$j]['yron']['y'] = max(round($at['p'][$a]['atack'][$j]['yron']['y'] / 4), 1);
// $at['p'][$a]['atack'][$j]['yron']['r'] = min(round($at['p'][$a]['atack'][$j]['yron']['r'] / 4), -1);
// $at['p'][$a]['atack'][$j]['yron']['k'] = max(round($at['p'][$a]['atack'][$j]['yron']['k'] / 4), 1);
// $at['p'][$a]['atack'][$j]['yron']['m_k'] = max(round($at['p'][$a]['atack'][$j]['yron']['m_k'] / 4), 1);
// $at['p'][$a]['atack'][$j]['yron']['m_y'] = max(round($at['p'][$a]['atack'][$j]['yron']['m_y'] / 4), 1);
//
// // ñïàñåíèå
// $btl->spaCheck($u1);
// // ñïàñåíèå
// //
// $at['p'][$a]['atack'][$j]['yron']['used'][] = [$j_id, $uid, $pvr['used']];
// $at['p'][$a]['atack'][$j]['yron']['kill'][] = [$j_id, $uid, $pvr['kill']];
// //
// $at['p'][$a]['priems']['kill'][$uid][$j_id] = true;
// //}
// }
// $j++;
// }
// }
// // -- êîíåö ïðèåìà
return $at;
};
unset($pr_used_this);
@ -127,4 +88,3 @@ if( isset($pr_momental_this)) {
$this->addEffPr($pl, $id);
}
unset($pvr);
?>

View File

@ -1,24 +1,25 @@
<?
if (!defined('GAME')) {
die();
}
/*
Ïðèåì: Ïðèçðà÷íûé êèíæàë
Ïðèåì: Ïðèçðà÷íûé fire
Ñëåäóþùèé óäàð ïðîòèâíèêà ïî âàì íàíåñåò íà 50% ìåíüøå óðîíà
*/
$pvr = array();
$pvr = [];
if (isset($pr_momental_this)) {
$fx_moment = function ($uid, $enemy, $j_id, $yron, $profil) {
if (!isset($btl->stats[$btl->uids[$uid]]['um_priem'][$j_id])) {
global $u, $btl;
if ($profil == 5) {
$yron = $yron/2;
//$yron = $yron / 2;
/*$btl->priemAddLogFast( $uid, 0, "Ïðèçðà÷íûé îãîíü",
'{tm1} '.$btl->addlt(1 , 17 , $btl->users[$btl->uids[$uid]]['sex'] , NULL).'',
0, time() );*/
if( $yron < 0 ) {
$yron = 1;
}
// if ($yron < 0) {
// $yron = 1;
// }
$btl->stats[$btl->uids[$uid]]['um_priem'][$j_id] = true;
}
}
@ -57,65 +58,77 @@ if( isset($pr_momental_this)) {
} elseif (isset($pr_used_this)) {
$fx_priem = function ($id, $at, $uid, $j_id) {
// -- íà÷àëî ïðèåìà
global $u, $btl;
//
//Ïàðàìåòðû ïðèåìà
$pvr['used'] = 0;
//
$uid1 = $btl->atacks[$id]['uid1'];
$uid2 = $btl->atacks[$id]['uid2'];
if( $uid == $uid2 ) {
$a = 1;
$b = 2;
$u1 = ${'uid1'};
$u2 = ${'uid2'};
}elseif( $uid == $uid1 ) {
$a = 2;
$b = 1;
$u1 = ${'uid2'};
$u2 = ${'uid1'};
}
if( $a > 0 ) {
$j = 0; $k = 0; $wp = 3;
while($j < count($at['p'][$a]['atack'])) {
if( isset($at['p'][$a]['atack'][$j]['yron']) && (
$at['p'][$a]['atack'][$j][1] == 1 ||
$at['p'][$a]['atack'][$j][1] == 4 ||
$at['p'][$a]['atack'][$j][1] == 5 )) {
if( !isset($at['p'][$a]['priems']['kill'][$uid][$j_id]) ) {
//
if( $at['p'][$a]['atack'][$j]['yron']['w_type'] == 5 ) {
$at['p'][$a]['atack'][$j]['yron']['y'] = round($at['p'][$a]['atack'][$j]['yron']['y']/2);
$at['p'][$a]['atack'][$j]['yron']['r'] = round($at['p'][$a]['atack'][$j]['yron']['r']/2);
$at['p'][$a]['atack'][$j]['yron']['k'] = round($at['p'][$a]['atack'][$j]['yron']['k']/2);
$at['p'][$a]['atack'][$j]['yron']['m_k'] = round($at['p'][$a]['atack'][$j]['yron']['m_k']/2);
$at['p'][$a]['atack'][$j]['yron']['m_y'] = round($at['p'][$a]['atack'][$j]['yron']['m_y']/2);
//
if( $at['p'][$a]['atack'][$j]['yron']['y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['y'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['r'] >= 0 ) { $at['p'][$a]['atack'][$j]['yron']['r'] = -1; }
if( $at['p'][$a]['atack'][$j]['yron']['k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['k'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['m_k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_k'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['m_y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_y'] = 1; }
//
if( $pvr['used'] == 0 ) {
/*$at['p'][$a]['atack'][$j]['yron']['plog'][] = '$this->priemAddLog( '.$id.', '.$b.', '.$a.', '.$u2.', '.$u1.',
"Ïðèçðà÷íûé îãîíü",
"{tm1} '.$btl->addlt($b , 17 , $btl->users[$btl->uids[$u2]]['sex'] , NULL).'",
'.($btl->hodID + 1).' );';*/
}
//
$at['p'][$a]['atack'][$j]['yron']['used'][] = array($j_id,$uid,$pvr['used']);
$at['p'][$a]['atack'][$j]['yron']['kill'][] = array($j_id,$uid,$pvr['kill']);
//
//$at['p'][$a]['priems']['kill'][$uid][$j_id] = true;
}
//
}
}
$j++;
}
}
// -- êîíåö ïðèåìà
// global $u, $btl;
// //
// //Ïàðàìåòðû ïðèåìà
// $pvr['used'] = 0;
// //
// $uid1 = $btl->atacks[$id]['uid1'];
// $uid2 = $btl->atacks[$id]['uid2'];
// if ($uid == $uid2) {
// $a = 1;
// $b = 2;
// $u1 = ${'uid1'};
// $u2 = ${'uid2'};
// } elseif ($uid == $uid1) {
// $a = 2;
// $b = 1;
// $u1 = ${'uid2'};
// $u2 = ${'uid1'};
// }
// if ($a > 0) {
// $j = 0;
// $k = 0;
// $wp = 3;
// while ($j < count($at['p'][$a]['atack'])) {
// if (isset($at['p'][$a]['atack'][$j]['yron']) && (
// $at['p'][$a]['atack'][$j][1] == 1 ||
// $at['p'][$a]['atack'][$j][1] == 4 ||
// $at['p'][$a]['atack'][$j][1] == 5)) {
// if (!isset($at['p'][$a]['priems']['kill'][$uid][$j_id])) {
// //
// if ($at['p'][$a]['atack'][$j]['yron']['w_type'] == 5) {
// $at['p'][$a]['atack'][$j]['yron']['y'] = round($at['p'][$a]['atack'][$j]['yron']['y'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['r'] = round($at['p'][$a]['atack'][$j]['yron']['r'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['k'] = round($at['p'][$a]['atack'][$j]['yron']['k'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['m_k'] = round($at['p'][$a]['atack'][$j]['yron']['m_k'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['m_y'] = round($at['p'][$a]['atack'][$j]['yron']['m_y'] / 2);
// //
// if ($at['p'][$a]['atack'][$j]['yron']['y'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['y'] = 1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['r'] >= 0) {
// $at['p'][$a]['atack'][$j]['yron']['r'] = -1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['k'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['k'] = 1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['m_k'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['m_k'] = 1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['m_y'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['m_y'] = 1;
// }
// //
// if ($pvr['used'] == 0) {
// /*$at['p'][$a]['atack'][$j]['yron']['plog'][] = '$this->priemAddLog( '.$id.', '.$b.', '.$a.', '.$u2.', '.$u1.',
// "Ïðèçðà÷íûé îãîíü",
// "{tm1} '.$btl->addlt($b , 17 , $btl->users[$btl->uids[$u2]]['sex'] , NULL).'",
// '.($btl->hodID + 1).' );';*/
// }
// //
// $at['p'][$a]['atack'][$j]['yron']['used'][] = [$j_id, $uid, $pvr['used']];
// $at['p'][$a]['atack'][$j]['yron']['kill'][] = [$j_id, $uid, $pvr['kill']];
// //
// //$at['p'][$a]['priems']['kill'][$uid][$j_id] = true;
// }
// //
// }
// }
// $j++;
// }
// }
// // -- êîíåö ïðèåìà
return $at;
};
unset($pr_used_this);

View File

@ -1,24 +1,25 @@
<?
if (!defined('GAME')) {
die();
}
/*
Ïðèåì: Ïðèçðà÷íûé êèíæàë
Ïðèåì: Ïðèçðà÷íûé air
Ñëåäóþùèé óäàð ïðîòèâíèêà ïî âàì íàíåñåò íà 50% ìåíüøå óðîíà
*/
$pvr = array();
$pvr = [];
if (isset($pr_momental_this)) {
$fx_moment = function ($uid, $enemy, $j_id, $yron, $profil) {
if (!isset($btl->stats[$btl->uids[$uid]]['um_priem'][$j_id])) {
global $u, $btl;
if ($profil == 6) {
$yron = $yron/2;
//$yron = $yron / 2;
/*$btl->priemAddLogFast( $uid, 0, "Ïðèçðà÷íûé âîçäóõ",
'{tm1} '.$btl->addlt(1 , 17 , $btl->users[$btl->uids[$uid]]['sex'] , NULL).'',
0, time() );*/
if( $yron < 0 ) {
$yron = 1;
}
// if ($yron < 0) {
// $yron = 1;
// }
$btl->stats[$btl->uids[$uid]]['um_priem'][$j_id] = true;
}
}
@ -56,66 +57,78 @@ if( isset($pr_momental_this)) {
unset($pr_used_this);
} elseif (isset($pr_used_this)) {
$fx_priem = function ($id, $at, $uid, $j_id) {
// -- íà÷àëî ïðèåìà
global $u, $btl;
//
//Ïàðàìåòðû ïðèåìà
$pvr['used'] = 0;
//
$uid1 = $btl->atacks[$id]['uid1'];
$uid2 = $btl->atacks[$id]['uid2'];
if( $uid == $uid2 ) {
$a = 1;
$b = 2;
$u1 = ${'uid1'};
$u2 = ${'uid2'};
}elseif( $uid == $uid1 ) {
$a = 2;
$b = 1;
$u1 = ${'uid2'};
$u2 = ${'uid1'};
}
if( $a > 0 ) {
$j = 0; $k = 0; $wp = 3;
while($j < count($at['p'][$a]['atack'])) {
if( isset($at['p'][$a]['atack'][$j]['yron']) && (
$at['p'][$a]['atack'][$j][1] == 1 ||
$at['p'][$a]['atack'][$j][1] == 4 ||
$at['p'][$a]['atack'][$j][1] == 5 )) {
if( !isset($at['p'][$a]['priems']['kill'][$uid][$j_id]) ) {
//
if( $at['p'][$a]['atack'][$j]['yron']['w_type'] == 6 ) {
$at['p'][$a]['atack'][$j]['yron']['y'] = round($at['p'][$a]['atack'][$j]['yron']['y']/2);
$at['p'][$a]['atack'][$j]['yron']['r'] = round($at['p'][$a]['atack'][$j]['yron']['r']/2);
$at['p'][$a]['atack'][$j]['yron']['k'] = round($at['p'][$a]['atack'][$j]['yron']['k']/2);
$at['p'][$a]['atack'][$j]['yron']['m_k'] = round($at['p'][$a]['atack'][$j]['yron']['m_k']/2);
$at['p'][$a]['atack'][$j]['yron']['m_y'] = round($at['p'][$a]['atack'][$j]['yron']['m_y']/2);
//
if( $at['p'][$a]['atack'][$j]['yron']['y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['y'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['r'] >= 0 ) { $at['p'][$a]['atack'][$j]['yron']['r'] = -1; }
if( $at['p'][$a]['atack'][$j]['yron']['k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['k'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['m_k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_k'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['m_y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_y'] = 1; }
//
if( $pvr['used'] == 0 ) {
/*$at['p'][$a]['atack'][$j]['yron']['plog'][] = '$this->priemAddLog( '.$id.', '.$b.', '.$a.', '.$u2.', '.$u1.',
"Ïðèçðà÷íûé âîçäóõ",
"{tm1} '.$btl->addlt($b , 17 , $btl->users[$btl->uids[$u2]]['sex'] , NULL).'",
'.($btl->hodID + 1).' );';*/
}
//
$at['p'][$a]['atack'][$j]['yron']['used'][] = array($j_id,$uid,$pvr['used']);
$at['p'][$a]['atack'][$j]['yron']['kill'][] = array($j_id,$uid,$pvr['kill']);
//
//$at['p'][$a]['priems']['kill'][$uid][$j_id] = true;
}
//
}
}
$j++;
}
}
// -- êîíåö ïðèåìà
// // -- íà÷àëî ïðèåìà
// global $u, $btl;
// //
// //Ïàðàìåòðû ïðèåìà
// $pvr['used'] = 0;
// //
// $uid1 = $btl->atacks[$id]['uid1'];
// $uid2 = $btl->atacks[$id]['uid2'];
// if ($uid == $uid2) {
// $a = 1;
// $b = 2;
// $u1 = ${'uid1'};
// $u2 = ${'uid2'};
// } elseif ($uid == $uid1) {
// $a = 2;
// $b = 1;
// $u1 = ${'uid2'};
// $u2 = ${'uid1'};
// }
// if ($a > 0) {
// $j = 0;
// $k = 0;
// $wp = 3;
// while ($j < count($at['p'][$a]['atack'])) {
// if (isset($at['p'][$a]['atack'][$j]['yron']) && (
// $at['p'][$a]['atack'][$j][1] == 1 ||
// $at['p'][$a]['atack'][$j][1] == 4 ||
// $at['p'][$a]['atack'][$j][1] == 5)) {
// if (!isset($at['p'][$a]['priems']['kill'][$uid][$j_id])) {
// //
// if ($at['p'][$a]['atack'][$j]['yron']['w_type'] == 6) {
// $at['p'][$a]['atack'][$j]['yron']['y'] = round($at['p'][$a]['atack'][$j]['yron']['y'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['r'] = round($at['p'][$a]['atack'][$j]['yron']['r'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['k'] = round($at['p'][$a]['atack'][$j]['yron']['k'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['m_k'] = round($at['p'][$a]['atack'][$j]['yron']['m_k'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['m_y'] = round($at['p'][$a]['atack'][$j]['yron']['m_y'] / 2);
// //
// if ($at['p'][$a]['atack'][$j]['yron']['y'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['y'] = 1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['r'] >= 0) {
// $at['p'][$a]['atack'][$j]['yron']['r'] = -1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['k'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['k'] = 1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['m_k'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['m_k'] = 1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['m_y'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['m_y'] = 1;
// }
// //
// if ($pvr['used'] == 0) {
// /*$at['p'][$a]['atack'][$j]['yron']['plog'][] = '$this->priemAddLog( '.$id.', '.$b.', '.$a.', '.$u2.', '.$u1.',
// "Ïðèçðà÷íûé âîçäóõ",
// "{tm1} '.$btl->addlt($b , 17 , $btl->users[$btl->uids[$u2]]['sex'] , NULL).'",
// '.($btl->hodID + 1).' );';*/
// }
// //
// $at['p'][$a]['atack'][$j]['yron']['used'][] = [$j_id, $uid, $pvr['used']];
// $at['p'][$a]['atack'][$j]['yron']['kill'][] = [$j_id, $uid, $pvr['kill']];
// //
// //$at['p'][$a]['priems']['kill'][$uid][$j_id] = true;
// }
// //
// }
// }
// $j++;
// }
// }
// // -- êîíåö ïðèåìà
return $at;
};
unset($pr_used_this);

View File

@ -1,24 +1,25 @@
<?
if (!defined('GAME')) {
die();
}
/*
Ïðèåì: Ïðèçðà÷íûé êèíæàë
Ïðèåì: Ïðèçðà÷íûé water
Ñëåäóþùèé óäàð ïðîòèâíèêà ïî âàì íàíåñåò íà 50% ìåíüøå óðîíà
*/
$pvr = array();
$pvr = [];
if (isset($pr_momental_this)) {
$fx_moment = function ($uid, $enemy, $j_id, $yron, $profil) {
if (!isset($btl->stats[$btl->uids[$uid]]['um_priem'][$j_id])) {
global $u, $btl;
if ($profil == 7) {
$yron = $yron/2;
//$yron = $yron / 2;
/*$btl->priemAddLogFast( $uid, 0, "Ïðèçðà÷íàÿ âîäà",
'{tm1} '.$btl->addlt(1 , 17 , $btl->users[$btl->uids[$uid]]['sex'] , NULL).'',
0, time() );*/
if( $yron < 0 ) {
$yron = 1;
}
// if ($yron < 0) {
// $yron = 1;
// }
$btl->stats[$btl->uids[$uid]]['um_priem'][$j_id] = true;
}
}
@ -57,65 +58,77 @@ if( isset($pr_momental_this)) {
} elseif (isset($pr_used_this)) {
$fx_priem = function ($id, $at, $uid, $j_id) {
// -- íà÷àëî ïðèåìà
global $u, $btl;
//
//Ïàðàìåòðû ïðèåìà
$pvr['used'] = 0;
//
$uid1 = $btl->atacks[$id]['uid1'];
$uid2 = $btl->atacks[$id]['uid2'];
if( $uid == $uid2 ) {
$a = 1;
$b = 2;
$u1 = ${'uid1'};
$u2 = ${'uid2'};
}elseif( $uid == $uid1 ) {
$a = 2;
$b = 1;
$u1 = ${'uid2'};
$u2 = ${'uid1'};
}
if( $a > 0 ) {
$j = 0; $k = 0; $wp = 3;
while($j < count($at['p'][$a]['atack'])) {
if( isset($at['p'][$a]['atack'][$j]['yron']) && (
$at['p'][$a]['atack'][$j][1] == 1 ||
$at['p'][$a]['atack'][$j][1] == 4 ||
$at['p'][$a]['atack'][$j][1] == 5 )) {
if( !isset($at['p'][$a]['priems']['kill'][$uid][$j_id]) ) {
//
if( $at['p'][$a]['atack'][$j]['yron']['w_type'] == 7 ) {
$at['p'][$a]['atack'][$j]['yron']['y'] = round($at['p'][$a]['atack'][$j]['yron']['y']/2);
$at['p'][$a]['atack'][$j]['yron']['r'] = round($at['p'][$a]['atack'][$j]['yron']['r']/2);
$at['p'][$a]['atack'][$j]['yron']['k'] = round($at['p'][$a]['atack'][$j]['yron']['k']/2);
$at['p'][$a]['atack'][$j]['yron']['m_k'] = round($at['p'][$a]['atack'][$j]['yron']['m_k']/2);
$at['p'][$a]['atack'][$j]['yron']['m_y'] = round($at['p'][$a]['atack'][$j]['yron']['m_y']/2);
//
if( $at['p'][$a]['atack'][$j]['yron']['y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['y'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['r'] >= 0 ) { $at['p'][$a]['atack'][$j]['yron']['r'] = -1; }
if( $at['p'][$a]['atack'][$j]['yron']['k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['k'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['m_k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_k'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['m_y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_y'] = 1; }
//
if( $pvr['used'] == 0 ) {
/*$at['p'][$a]['atack'][$j]['yron']['plog'][] = '$this->priemAddLog( '.$id.', '.$b.', '.$a.', '.$u2.', '.$u1.',
"Ïðèçðà÷íàÿ âîäà",
"{tm1} '.$btl->addlt($b , 17 , $btl->users[$btl->uids[$u2]]['sex'] , NULL).'",
'.($btl->hodID + 1).' );';*/
}
//
$at['p'][$a]['atack'][$j]['yron']['used'][] = array($j_id,$uid,$pvr['used']);
$at['p'][$a]['atack'][$j]['yron']['kill'][] = array($j_id,$uid,$pvr['kill']);
//
//$at['p'][$a]['priems']['kill'][$uid][$j_id] = true;
}
//
}
}
$j++;
}
}
// -- êîíåö ïðèåìà
// global $u, $btl;
// //
// //Ïàðàìåòðû ïðèåìà
// $pvr['used'] = 0;
// //
// $uid1 = $btl->atacks[$id]['uid1'];
// $uid2 = $btl->atacks[$id]['uid2'];
// if ($uid == $uid2) {
// $a = 1;
// $b = 2;
// $u1 = ${'uid1'};
// $u2 = ${'uid2'};
// } elseif ($uid == $uid1) {
// $a = 2;
// $b = 1;
// $u1 = ${'uid2'};
// $u2 = ${'uid1'};
// }
// if ($a > 0) {
// $j = 0;
// $k = 0;
// $wp = 3;
// while ($j < count($at['p'][$a]['atack'])) {
// if (isset($at['p'][$a]['atack'][$j]['yron']) && (
// $at['p'][$a]['atack'][$j][1] == 1 ||
// $at['p'][$a]['atack'][$j][1] == 4 ||
// $at['p'][$a]['atack'][$j][1] == 5)) {
// if (!isset($at['p'][$a]['priems']['kill'][$uid][$j_id])) {
// //
// if ($at['p'][$a]['atack'][$j]['yron']['w_type'] == 7) {
// $at['p'][$a]['atack'][$j]['yron']['y'] = round($at['p'][$a]['atack'][$j]['yron']['y'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['r'] = round($at['p'][$a]['atack'][$j]['yron']['r'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['k'] = round($at['p'][$a]['atack'][$j]['yron']['k'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['m_k'] = round($at['p'][$a]['atack'][$j]['yron']['m_k'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['m_y'] = round($at['p'][$a]['atack'][$j]['yron']['m_y'] / 2);
// //
// if ($at['p'][$a]['atack'][$j]['yron']['y'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['y'] = 1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['r'] >= 0) {
// $at['p'][$a]['atack'][$j]['yron']['r'] = -1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['k'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['k'] = 1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['m_k'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['m_k'] = 1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['m_y'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['m_y'] = 1;
// }
// //
// if ($pvr['used'] == 0) {
// /*$at['p'][$a]['atack'][$j]['yron']['plog'][] = '$this->priemAddLog( '.$id.', '.$b.', '.$a.', '.$u2.', '.$u1.',
// "Ïðèçðà÷íàÿ âîäà",
// "{tm1} '.$btl->addlt($b , 17 , $btl->users[$btl->uids[$u2]]['sex'] , NULL).'",
// '.($btl->hodID + 1).' );';*/
// }
// //
// $at['p'][$a]['atack'][$j]['yron']['used'][] = [$j_id, $uid, $pvr['used']];
// $at['p'][$a]['atack'][$j]['yron']['kill'][] = [$j_id, $uid, $pvr['kill']];
// //
// //$at['p'][$a]['priems']['kill'][$uid][$j_id] = true;
// }
// //
// }
// }
// $j++;
// }
// }
// // -- êîíåö ïðèåìà
return $at;
};
unset($pr_used_this);

View File

@ -1,24 +1,25 @@
<?
if (!defined('GAME')) {
die();
}
/*
Ïðèåì: Ïðèçðà÷íûé êèíæàë
Ïðèåì: Ïðèçðà÷íûé earth
Ñëåäóþùèé óäàð ïðîòèâíèêà ïî âàì íàíåñåò íà 50% ìåíüøå óðîíà
*/
$pvr = array();
$pvr = [];
if (isset($pr_momental_this)) {
$fx_moment = function ($uid, $enemy, $j_id, $yron, $profil) {
if (!isset($btl->stats[$btl->uids[$uid]]['um_priem'][$j_id])) {
global $u, $btl;
if ($profil == 8) {
$yron = $yron/2;
//$yron = $yron / 2;
/*$btl->priemAddLogFast( $uid, 0, "Ïðèçðà÷íàÿ çåìëÿ",
'{tm1} '.$btl->addlt(1 , 17 , $btl->users[$btl->uids[$uid]]['sex'] , NULL).'',
0, time() );*/
if( $yron < 0 ) {
$yron = 1;
}
// if ($yron < 0) {
// $yron = 1;
// }
$btl->stats[$btl->uids[$uid]]['um_priem'][$j_id] = true;
}
}
@ -57,65 +58,77 @@ if( isset($pr_momental_this)) {
} elseif (isset($pr_used_this)) {
$fx_priem = function ($id, $at, $uid, $j_id) {
// -- íà÷àëî ïðèåìà
global $u, $btl;
//
//Ïàðàìåòðû ïðèåìà
$pvr['used'] = 0;
//
$uid1 = $btl->atacks[$id]['uid1'];
$uid2 = $btl->atacks[$id]['uid2'];
if( $uid == $uid2 ) {
$a = 1;
$b = 2;
$u1 = ${'uid1'};
$u2 = ${'uid2'};
}elseif( $uid == $uid1 ) {
$a = 2;
$b = 1;
$u1 = ${'uid2'};
$u2 = ${'uid1'};
}
if( $a > 0 ) {
$j = 0; $k = 0; $wp = 3;
while($j < count($at['p'][$a]['atack'])) {
if( isset($at['p'][$a]['atack'][$j]['yron']) && (
$at['p'][$a]['atack'][$j][1] == 1 ||
$at['p'][$a]['atack'][$j][1] == 4 ||
$at['p'][$a]['atack'][$j][1] == 5 )) {
if( !isset($at['p'][$a]['priems']['kill'][$uid][$j_id]) ) {
//
if( $at['p'][$a]['atack'][$j]['yron']['w_type'] == 8 ) {
$at['p'][$a]['atack'][$j]['yron']['y'] = round($at['p'][$a]['atack'][$j]['yron']['y']/2);
$at['p'][$a]['atack'][$j]['yron']['r'] = round($at['p'][$a]['atack'][$j]['yron']['r']/2);
$at['p'][$a]['atack'][$j]['yron']['k'] = round($at['p'][$a]['atack'][$j]['yron']['k']/2);
$at['p'][$a]['atack'][$j]['yron']['m_k'] = round($at['p'][$a]['atack'][$j]['yron']['m_k']/2);
$at['p'][$a]['atack'][$j]['yron']['m_y'] = round($at['p'][$a]['atack'][$j]['yron']['m_y']/2);
//
if( $at['p'][$a]['atack'][$j]['yron']['y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['y'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['r'] >= 0 ) { $at['p'][$a]['atack'][$j]['yron']['r'] = -1; }
if( $at['p'][$a]['atack'][$j]['yron']['k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['k'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['m_k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_k'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['m_y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_y'] = 1; }
//
if( $pvr['used'] == 0 ) {
/*$at['p'][$a]['atack'][$j]['yron']['plog'][] = '$this->priemAddLog( '.$id.', '.$b.', '.$a.', '.$u2.', '.$u1.',
"Ïðèçðà÷íàÿ çåìëÿ",
"{tm1} '.$btl->addlt($b , 17 , $btl->users[$btl->uids[$u2]]['sex'] , NULL).'",
'.($btl->hodID + 1).' );';*/
}
//
$at['p'][$a]['atack'][$j]['yron']['used'][] = array($j_id,$uid,$pvr['used']);
$at['p'][$a]['atack'][$j]['yron']['kill'][] = array($j_id,$uid,$pvr['kill']);
//
//$at['p'][$a]['priems']['kill'][$uid][$j_id] = true;
}
//
}
}
$j++;
}
}
// -- êîíåö ïðèåìà
// global $u, $btl;
// //
// //Ïàðàìåòðû ïðèåìà
// $pvr['used'] = 0;
// //
// $uid1 = $btl->atacks[$id]['uid1'];
// $uid2 = $btl->atacks[$id]['uid2'];
// if ($uid == $uid2) {
// $a = 1;
// $b = 2;
// $u1 = ${'uid1'};
// $u2 = ${'uid2'};
// } elseif ($uid == $uid1) {
// $a = 2;
// $b = 1;
// $u1 = ${'uid2'};
// $u2 = ${'uid1'};
// }
// if ($a > 0) {
// $j = 0;
// $k = 0;
// $wp = 3;
// while ($j < count($at['p'][$a]['atack'])) {
// if (isset($at['p'][$a]['atack'][$j]['yron']) && (
// $at['p'][$a]['atack'][$j][1] == 1 ||
// $at['p'][$a]['atack'][$j][1] == 4 ||
// $at['p'][$a]['atack'][$j][1] == 5)) {
// if (!isset($at['p'][$a]['priems']['kill'][$uid][$j_id])) {
// //
// if ($at['p'][$a]['atack'][$j]['yron']['w_type'] == 8) {
// $at['p'][$a]['atack'][$j]['yron']['y'] = round($at['p'][$a]['atack'][$j]['yron']['y'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['r'] = round($at['p'][$a]['atack'][$j]['yron']['r'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['k'] = round($at['p'][$a]['atack'][$j]['yron']['k'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['m_k'] = round($at['p'][$a]['atack'][$j]['yron']['m_k'] / 2);
// $at['p'][$a]['atack'][$j]['yron']['m_y'] = round($at['p'][$a]['atack'][$j]['yron']['m_y'] / 2);
// //
// if ($at['p'][$a]['atack'][$j]['yron']['y'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['y'] = 1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['r'] >= 0) {
// $at['p'][$a]['atack'][$j]['yron']['r'] = -1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['k'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['k'] = 1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['m_k'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['m_k'] = 1;
// }
// if ($at['p'][$a]['atack'][$j]['yron']['m_y'] < 1) {
// $at['p'][$a]['atack'][$j]['yron']['m_y'] = 1;
// }
// //
// if ($pvr['used'] == 0) {
// /*$at['p'][$a]['atack'][$j]['yron']['plog'][] = '$this->priemAddLog( '.$id.', '.$b.', '.$a.', '.$u2.', '.$u1.',
// "Ïðèçðà÷íàÿ çåìëÿ",
// "{tm1} '.$btl->addlt($b , 17 , $btl->users[$btl->uids[$u2]]['sex'] , NULL).'",
// '.($btl->hodID + 1).' );';*/
// }
// //
// $at['p'][$a]['atack'][$j]['yron']['used'][] = [$j_id, $uid, $pvr['used']];
// $at['p'][$a]['atack'][$j]['yron']['kill'][] = [$j_id, $uid, $pvr['kill']];
// //
// //$at['p'][$a]['priems']['kill'][$uid][$j_id] = true;
// }
// //
// }
// }
// $j++;
// }
// }
// // -- êîíåö ïðèåìà
return $at;
};
unset($pr_used_this);

View File

@ -56,8 +56,6 @@ $pvr = array();
$prv['color'] = '909090';
}
$this->mg2static_points( $this->ue['id'] , $btl->stats[$btl->uids[$u->info['id']]] );
$prv['text2'] = '{tm1} '.$prv['text'].'. <font Color='.$prv['color'].'><b '.$btl->maginfoattack($u->info['id'],$this->ue['id'],1).'>'.$pvr['hpSee'].'</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']';
if( $pvr['promah_type'] == 2 ) {
$prv['text'] = $btl->addlt(1 , 20 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);

View File

@ -56,7 +56,6 @@ $pvr = array();
$prv['color'] = '909090';
}
$this->mg2static_points( $this->ue['id'] , $btl->stats[$btl->uids[$u->info['id']]] );
$prv['text2'] = '{tm1} '.$prv['text'].'. <font Color='.$prv['color'].'><b>'.$pvr['hpSee'].'</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']';
if( $pvr['promah_type'] == 2 ) {

View File

@ -36,7 +36,7 @@ $pvr = array();
//Èñïîëüçóåì ïðîâåðêó íà óðîí ïðèåìîâ
$pvr['hp'] = $btl->testYronPriem( $u->info['id'], $pvr['uid'], 21, $pvr['hp'], 5, true );
if( $pvr['krit'] == false ) {
if(!$pvr['krit']) {
if( $pvr['hp'] > $pvr['lim'] ) {
$pvr['hp'] = $pvr['lim'];
}
@ -49,7 +49,6 @@ $pvr = array();
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$pvr['uid'],$pvr['hp'],0);
$this->mg2static_points( $pvr['uid'] , $btl->stats[$btl->uids[$pvr['uid']]] );
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];
@ -62,8 +61,8 @@ $pvr = array();
mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$pvr['uid']]]['hpNow'].'" WHERE `id` = "'.$pvr['uid'].'" LIMIT 1');
//
if( $pvr['promah'] == false ) {
if( $pvr['krit'] == false ) {
if(!$pvr['promah']) {
if(!$pvr['krit']) {
$prv['color2'] = '006699';
if(isset($btl->mcolor[$btl->mname['îãîíü']])) {
$prv['color2'] = $btl->mcolor[$btl->mname['îãîíü']];
@ -96,12 +95,7 @@ $pvr = array();
($btl->hodID + 1)
);
//Äîáàâëÿåì ïðèåì
//$this->addEffPr($pl,$id);
//$this->addPriem($pvr['uid'],$pl['id'],'atgm='.floor($pvr['hp']/5).'',0,77,5,$u->info['id'],1,'ÿäîâèòîåîáëàêî',0,0,1);
//Îòíèìàåì òàêòèêè
//$this->mintr($pl);
//
$pvr['xx']++;
}
@ -110,12 +104,6 @@ $pvr = array();
$btl->delPriem($pvr['x5'],$btl->users[$btl->uids[$this->ue['id']]],2);
//
//Äîáàâëÿåì ïðèåì
//$this->addEffPr($pl,$id);
//$this->addPriem($this->ue['id'],$pl['id'],'atgm='.($pvr['hp']/16).'',2,77,4,$u->info['id'],3,'îëåäåíåíèå',0,0,1);
//Îòíèìàåì òàêòèêè
//$this->mintr($pl);
unset($pvr);
?>

View File

@ -49,7 +49,7 @@ $pvr = array();
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$pvr['uid'],$pvr['hp'],0);
$this->mg2static_points( $pvr['uid'] , $btl->stats[$btl->uids[$pvr['uid']]] );
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];

View File

@ -49,7 +49,7 @@ $pvr = array();
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$pvr['uid'],$pvr['hp'],0);
$this->mg2static_points( $pvr['uid'] , $btl->stats[$btl->uids[$pvr['uid']]] );
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];

View File

@ -56,7 +56,7 @@ $pvr = array();
$prv['color'] = '909090';
}
$this->mg2static_points( $this->ue['id'] , $btl->stats[$btl->uids[$u->info['id']]] );
$this->addAirStaticPoints(); /* Óäàð â Ñòàòèêó*/
$prv['text2'] = '{tm1} '.$prv['text'].'. <font Color='.$prv['color'].'><b '.$btl->maginfoattack($u->info['id'],$this->ue['id'],2).'>'.$pvr['hpSee'].'</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']';
if( $pvr['promah_type'] == 2 ) {
@ -76,5 +76,6 @@ $pvr = array();
//Îòíèìàåì òàêòèêè
//$this->mintr($pl);
unset($pvr);
?>

View File

@ -56,7 +56,7 @@ $pvr = array();
$prv['color'] = '909090';
}
$this->mg2static_points( $this->ue['id'] , $btl->stats[$btl->uids[$u->info['id']]] );
$this->addAirStaticPoints(); /* Óäàð â Ñòàòèêó*/
$prv['text2'] = '{tm1} '.$prv['text'].'. <font Color='.$prv['color'].'><b '.$btl->maginfoattack($u->info['id'],$this->ue['id'],2).'>'.$pvr['hpSee'].'</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']';
if( $pvr['promah_type'] == 2 ) {

View File

@ -11,7 +11,7 @@ $pvr['x5'] = mysql_fetch_array(mysql_query('SELECT `id`,`x` FROM `eff_users` WHE
if( $pvr['x5']['x'] < 5 ) {
$prv['x'] = '';
if( $pvr['x5']['x'] > 0 ) {
$prv['x'] = ' x'.($pvr['x5']['x']+1).'';
$prv['x'] = ' x'.($pvr['x5']['x']+1);
}
//
$this->addEffPr($pl,$id);

View File

@ -59,11 +59,9 @@ if( isset($pr_used_this) && isset($pr_moment) && !isset($btl->info['id']) && !is
mysql_query('UPDATE `eff_users` SET `data` = "'.$pvr['redata'].'" WHERE `id` = "'.$btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['id'].'" LIMIT 1');
//
$pvr['hp'] = floor($pvr['hp']);
//$pvr['hp'] = $priem->magatack( $u2, $u1, $pvr['hp'], 'âîäà', 0 );
$pvr['promah_type'] = 0;
$pvr['promah'] = false;
$pvr['krit'] = false;
//$pvr['hp'] = $pvr['hp'][0];
$pvr['hpSee'] = '--';
$pvr['hpNow'] = floor($btl->stats[$btl->uids[$u1]]['hpNow']);
$pvr['hpAll'] = $btl->stats[$btl->uids[$u1]]['hpAll'];

View File

@ -57,11 +57,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
mysql_query('UPDATE `eff_users` SET `data` = "'.$pvr['redata'].'" WHERE `id` = "'.$btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['id'].'" LIMIT 1');
//
$pvr['hp'] = floor($pvr['hp']);
/*$pvr['hp'] = $priem->magatack( $u2, $u1, $pvr['hp'], 'âîäŕ', 0 );
$pvr['promah_type'] = $pvr['hp'][3];
$pvr['promah'] = $pvr['hp'][2];
$pvr['krit'] = $pvr['hp'][1];
$pvr['hp'] = $pvr['hp'][0];*/
$pvr['hpSee'] = '--';
$pvr['hpNow'] = floor($btl->stats[$btl->uids[$u1]]['hpNow']);
$pvr['hpAll'] = $btl->stats[$btl->uids[$u1]]['hpAll'];

View File

@ -57,11 +57,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
mysql_query('UPDATE `eff_users` SET `data` = "'.$pvr['redata'].'" WHERE `id` = "'.$btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['id'].'" LIMIT 1');
//
$pvr['hp'] = floor($pvr['hp']);
/*$pvr['hp'] = $priem->magatack( $u2, $u1, $pvr['hp'], 'âîäŕ', 0 );
$pvr['promah_type'] = $pvr['hp'][3];
$pvr['promah'] = $pvr['hp'][2];
$pvr['krit'] = $pvr['hp'][1];
$pvr['hp'] = $pvr['hp'][0];*/
$pvr['hpSee'] = '--';
$pvr['hpNow'] = floor($btl->stats[$btl->uids[$u1]]['hpNow']);
$pvr['hpAll'] = $btl->stats[$btl->uids[$u1]]['hpAll'];

View File

@ -1,214 +1,6 @@
<?
<?php
/**@var $this Priems*/
if(!defined('GAME')) {
die();
}
/*
Ïðèåì: Ïûëàþùèé Âçðûâ
*/
$pvr = array();
$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$btl->users[$btl->uids[$this->ue['id']]]['id'].'" AND `bj` = "ïîæèðàþùååïëàìÿ" AND `user_use` = "'.$u->info['id'].'" ORDER BY `id` DESC LIMIT 1'));
if( isset($pvr['mg']['id']) ) {
//Äåéñòâèå ïðè êëèêå
$pvr['hp'] = 0;
$pvr['data'] = $this->lookStatsArray($pvr['mg']['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;
$pvr['redata'] = '';
while( $pvr['di'] < 4 ) {
if( isset($pvr['data']['atgm'][($pvr['dc']-$pvr['di'])]) ) {
if( $pvr['rd'] < 3 ) {
$pvr['hp'] += $pvr['data']['atgm'][($pvr['dc']-$pvr['di'])];
$pvr['redata'] = 'atgm='.$pvr['data']['atgm'][($pvr['dc']-$pvr['di'])].'|'.$pvr['redata'];
$pvr['rd']++;
}
}
$pvr['di']++;
}
$pvr['hp23'] = $pvr['hp'];
$pvr['hp'] = round($pvr['hp']*5);
$pvr['hp'] = round($pvr['hp']/100*33);
$pvr['hp24'] = $pvr['hp'];
//$pvr['hp'] = floor($pvr['hp']/20*$u->stats['mg3']);//óìåëêè
//$pvr['hp'] = floor($pvr['hp']/200*$u->stats['s5']);//Èíòåëåêò
/*if( $btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] < floor($btl->stats[$btl->uids[$this->ue['id']]]['hpAll']/100*33) ) {
$pvr['hp'] = floor( $pvr['hp'] + ($pvr['hp']/100*(33*$pvr['mg']['x'])) );
}*/
/*
$pvr['hp_test'] = $this->magatack( $u->info['id'], $this->ue['id'], $pvr['hp'], 'îãîíü', 1 );
$pvr['promah_type'] = $pvr['hp_test'][3];
$pvr['promah'] = $pvr['hp_test'][2];
$pvr['krit'] = $pvr['hp_test'][1];
*/
//$pvr['hp'] = $pvr['hp_test'][0];
$pvr['hpSee'] = '--';
$pvr['hpNow'] = floor($btl->stats[$btl->uids[$this->ue['id']]]['hpNow']);
$pvr['hpAll'] = $btl->stats[$btl->uids[$this->ue['id']]]['hpAll'];
//Èñïîëüçóåì ïðîâåðêó íà óðîí ïðèåìîâ
$pvr['hp'] = $btl->testYronPriem( $u->info['id'], $this->ue['id'], 21, $pvr['hp'], 7, true );
$pvr['hp25'] = $pvr['hp'];
$pvr['hpSee'] = '-'.$pvr['hp'];
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$this->ue['id'],$pvr['hp'],0);
$pvr['hp26'] = $pvr['hp'];
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];
}elseif( $pvr['hpNow'] < 0 ) {
$pvr['hpNow'] = 0;
}
$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] = $pvr['hpNow'];
mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'].'" WHERE `id` = "'.$this->ue['id'].'" LIMIT 1');
$prv['text'] = $btl->addlt(1 , 19 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
//Öâåò ïðèåìà
if( $pvr['promah'] == false ) {
if( $pvr['krit'] == false ) {
$prv['color2'] = '006699';
if(isset($btl->mcolor[$btl->mname['îãîíü']])) {
$prv['color2'] = $btl->mcolor[$btl->mname['îãîíü']];
}
$prv['color'] = '000000';
if(isset($btl->mncolor[$btl->mname['îãîíü']])) {
$prv['color'] = $btl->mncolor[$btl->mname['îãîíü']];
}
}else{
$prv['color2'] = 'FF0000';
$prv['color'] = 'FF0000';
}
}else{
$prv['color2'] = '909090';
$prv['color'] = '909090';
}
$prv['text2'] = '{tm1} '.$prv['text'].'. <font Color='.$prv['color'].'><b '.$btl->maginfoattack($u->info['id'],$this->ue['id'],1).'>'.$pvr['hpSee'].'</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].'] (Áàçîâûé óðîí: '.$pvr['hp23'].'/'.$pvr['hp24'].'/'.$pvr['hp25'].'/'.$pvr['hp26'].' åä.)';
if( $pvr['promah_type'] == 2 ) {
$prv['text'] = $btl->addlt(1 , 20 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
$prv['text2'] = '{tm1} '.$prv['text'].'. <font Color='.$prv['color'].'><b '.$btl->maginfoattack($u->info['id'],$this->ue['id'],1).'>--</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']';
}
$btl->priemAddLog( $id, 1, 2, $u->info['id'], $this->ue['id'],
'<font color^^^^#'.$prv['color2'].'>Ïûëàþùèé Âçðûâ</font>',
$prv['text2'],
($btl->hodID + 1)
);
//
//Äåéñòâèå ïðè êëèêå
//$pvr['rx'] = rand(80,80);
//$pvr['rx'] = floor($pvr['rx']/10);
$pvr['uen'] = $this->ue['id'];
$pvr['rx'] = 4;
$pvr['xx'] = 0;
$pvr['ix'] = 0;
while( $pvr['ix'] < count($btl->users) ) {
if( $btl->stats[$pvr['ix']]['hpNow'] > 0 && $btl->users[$pvr['ix']]['team'] != $u->info['team'] && $pvr['xx'] < $pvr['rx'] && $pvr['uen'] != $btl->users[$pvr['ix']]['id'] ) {
//
$pvr['uid'] = $btl->users[$pvr['ix']]['id'];
$pvr['hp'] = floor($pvr['hp']);
/*
$pvr['hp'] = $this->magatack( $u->info['id'], $pvr['uid'], $pvr['hp'], 'îãîíü', 0 );
$pvr['promah_type'] = $pvr['hp'][3];
$pvr['promah'] = $pvr['hp'][2];
$pvr['krit'] = $pvr['hp'][1];
$pvr['hp'] = $pvr['hp'][0];
*/
$pvr['hpSee'] = '--';
$pvr['hpNow'] = floor($btl->stats[$btl->uids[$pvr['uid']]]['hpNow']);
$pvr['hpAll'] = $btl->stats[$btl->uids[$pvr['uid']]]['hpAll'];
//Èñïîëüçóåì ïðîâåðêó íà óðîí ïðèåìîâ
$pvr['hp'] = $btl->testYronPriem( $u->info['id'], $pvr['uid'], 21, $pvr['hp'], 6, true );
$pvr['hpSee'] = '-'.$pvr['hp'];
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$pvr['uid'],$pvr['hp'],0);
$this->mg2static_points( $pvr['uid'] , $btl->stats[$btl->uids[$pvr['uid']]] );
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];
}elseif( $pvr['hpNow'] < 0 ) {
$pvr['hpNow'] = 0;
}
$btl->stats[$btl->uids[$pvr['uid']]]['hpNow'] = $pvr['hpNow'];
mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$pvr['uid']]]['hpNow'].'" WHERE `id` = "'.$pvr['uid'].'" LIMIT 1');
//
if( $pvr['promah'] == false ) {
if( $pvr['krit'] == false ) {
$prv['color2'] = '006699';
if(isset($btl->mcolor[$btl->mname['îãîíü']])) {
$prv['color2'] = $btl->mcolor[$btl->mname['îãîíü']];
}
$prv['color'] = '000000';
if(isset($btl->mncolor[$btl->mname['îãîíü']])) {
$prv['color'] = $btl->mncolor[$btl->mname['îãîíü']];
}
}else{
$prv['color2'] = 'FF0000';
$prv['color'] = 'FF0000';
}
}else{
$prv['color2'] = '909090';
$prv['color'] = '909090';
}
//
//
//$prv['color2'] = $btl->mcolor[$btl->mname['çåìëÿ']];
$prv['text'] = $btl->addlt(1 , 19 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
if( $pvr['promah_type'] == 2 ) {
$prv['text2'] = '{tm1} '.$prv['text'].'. <font Color='.$prv['color'].'><b '.$btl->maginfoattack($u->info['id'],$pvr['uid'],1).'>--</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']';
}else{
$prv['text2'] = '{tm1} '.$prv['text'].'. <font Color='.$prv['color'].'><b '.$btl->maginfoattack($u->info['id'],$pvr['uid'],1).'>'.$pvr['hpSee'].'</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']';
}
$btl->priemAddLog( $id, 1, 2, $u->info['id'], $pvr['uid'],
'<font color^^^^#'.$prv['color2'].'>Ïûëàþùèé Âçðûâ</font>',
$prv['text2'],
($btl->hodID + 1)
);
//Äîáàâëÿåì ïðèåì
//$this->addEffPr($pl,$id);
//$this->addPriem($pvr['uid'],$pl['id'],'atgm='.floor($pvr['hp']/5).'',0,77,5,$u->info['id'],1,'ÿäîâèòîåîáëàêî',0,0,1);
//Îòíèìàåì òàêòèêè
//$this->mintr($pl);
//
$pvr['xx']++;
}
$pvr['ix']++;
}
//Äîáàâëÿåì ïðèåì
//$this->addEffPr($pl,$id);
//$this->addPriem($this->ue['id'],242,'add_notactic=1|add_nousepriem=1',2,77,2,$u->info['id'],3,'ïûëàþùèéóæàñ',0,0,1);
//Óäàëÿåì îëåäåíåíèå
$pvr['mg']['priem']['id'] = $pvr['mg']['id'];
$btl->delPriem($pvr['mg'],$btl->users[$btl->uids[$this->ue['id']]],2);
//Îòíèìàåì òàêòèêè
$this->mintr($pl);
}else{
echo '<font color=red><b>Íà ïåðñîíàæå íåò ïîæèðàþùåãî ïëàìåíè (Âàøåãî çàêëÿòèÿ)</b></font>';
$cup = true;
}
unset($pvr);
?>
$this->addPriem($this->u->info['id'],243,'add_acestar=1',2,77,1,$this->u->info['id'],1,'',0,0,1);

View File

@ -1,52 +1,41 @@
<?
if(!defined('GAME')) {
die();
<?php
/**
* @var $this Priems
* @var $btl Battle
* @var $id int
* @var $pl array
*/
if (!$id) {
exit();
}
/*
Ïðèåì: Ïûëàþùàÿ Ñìåðòü
*/
$pvr = array();
$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$btl->users[$btl->uids[$this->ue['id']]]['id'].'" AND `bj` = "ïîæèðàþùååïëàìÿ" AND `user_use` = "'.$u->info['id'].'" ORDER BY `id` DESC LIMIT 1'));
if( $btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] > round($btl->stats[$btl->uids[$this->ue['id']]]['hpAll']/100*33) ) {
echo '<font color=red><b>Óðîâåíü çäîðîâüÿ öåëè äîëæåí áûòü íèæå 33%</b></font>';
$pvr = [];
$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = ' . $btl->users[$btl->uids[$this->ue['id']]]['id'] . ' AND `bj` = "ïîæèðàþùååïëàìÿ" AND `user_use` = ' . $u->info['id'] . ' ORDER BY `id` DESC LIMIT 1'));
if (
$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] > round($btl->stats[$btl->uids[$this->ue['id']]]['hpAll'] / 100 * 33)
) {
echo '<b style="color: red">Óðîâåíü çäîðîâüÿ öåëè äîëæåí áûòü íèæå 33%</b>';
$cup = true;
}elseif( isset($pvr['mg']['id']) ) {
} elseif (!isset($pvr['mg']['id'])) {
echo '<b style="color: red">Íà ïåðñîíàæå íåò ïîæèðàþùåãî ïëàìåíè (Âàøåãî çàêëÿòèÿ)</b>';
$cup = true;
} else {
//Äåéñòâèå ïðè êëèêå
$pvr['hp'] = 0;
$pvr['data'] = $this->lookStatsArray($pvr['mg']['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;
$pvr['redata'] = '';
while( $pvr['di'] < 4 ) {
if( isset($pvr['data']['atgm'][($pvr['dc']-$pvr['di'])]) ) {
if( $pvr['rd'] < 3 ) {
$pvr['hp'] += $pvr['data']['atgm'][($pvr['dc']-$pvr['di'])];
$pvr['redata'] = 'atgm='.$pvr['data']['atgm'][($pvr['dc']-$pvr['di'])].'|'.$pvr['redata'];
$pvr['rd']++;
}
}
$pvr['di']++;
}
$pvr['name'] = $pvr['mg']['name'];
$pvr['hp23'] = $pvr['hp'];
//$pvr['hp'] = round(((5*$pvr['hp'])/100)*150);
$pvr['hp'] = 450;
$pvr['hp24'] = $pvr['hp'];
//$pvr['hp'] = floor($pvr['hp']/20*$u->stats['mg3']);//óìåëêè
//$pvr['hp'] = floor($pvr['hp']/200*$u->stats['s5']);//Èíòåëåêò
//if( $btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] < floor($btl->stats[$btl->uids[$this->ue['id']]]['hpAll']/100*30) ) {
//$pvr['hp'] = floor( $pvr['hp'] + ($pvr['hp']/100*(50*$pvr['mg']['x'])) );
//}
// Óðîí = 150% îñòàâøåãîñÿ óðîíà (óðîí çà õîä * êîëè÷åñòâî õîäîâ * 150/100).
$pvr['hp'] = floor($pvr['data']['atgm'] * $pvr['mg']['hod'] * 1.5);
// Ìû äîëæíû ñìî÷ü êðèòîâàòü, íî ìû íå äîëæíû åù¸ ðàç ìîäèôèöèðîâàòü óðîí!
$pvr['hp_test'] = $this->magatack($u->info['id'], $this->ue['id'], $pvr['hp'], 'îãîíü', 1);
$pvr['promah_type'] = 0;
$pvr['promah'] = false;
$pvr['krit'] = $pvr['hp_test'][1];
if( $pvr['krit'] == true ) {
if ($pvr['krit']) {
$pvr['hp'] = round($pvr['hp'] * 2);
}
$pvr['hpSee'] = '--';
@ -69,57 +58,28 @@ if( $btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] > round($btl->stats[$btl->
} elseif ($pvr['hpNow'] < 0) {
$pvr['hpNow'] = 0;
}
$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] = $pvr['hpNow'];
mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'].'" WHERE `id` = "'.$this->ue['id'].'" LIMIT 1');
mysql_query('UPDATE `stats` SET `hpNow` = ' . $btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] . ' WHERE `id` = ' . $this->ue['id']);
$prv['text'] = $btl->addlt(1 , 19 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
$prv['text'] = $btl->addlt(1, 19, $btl->users[$btl->uids[$u->info['id']]]['sex'], null);
//Öâåò ïðèåìà
if( $pvr['promah'] == false ) {
if( $pvr['krit'] == false ) {
$prv['color2'] = '006699';
if(isset($btl->mcolor[$btl->mname['îãîíü']])) {
$prv['color2'] = $btl->mcolor[$btl->mname['îãîíü']];
}
$prv['color'] = '000000';
if(isset($btl->mncolor[$btl->mname['îãîíü']])) {
$prv['color'] = $btl->mncolor[$btl->mname['îãîíü']];
}
}else{
$prv['color2'] = 'FF0000';
$prv['color'] = 'FF0000';
}
}else{
$prv['color2'] = '909090';
$prv['color'] = '909090';
}
$prv['color'] = $pvr['krit'] ? "f00" : "a00";
$prv['text2'] = '{tm1} ' . $prv['text'] . '. <font Color=' . $prv['color'] . '><b>' . $pvr['hpSee'] . '</b></font> [' . $pvr['hpNow'] . '/' . $pvr['hpAll'] . ']';
if( $pvr['promah_type'] == 2 ) {
$prv['text'] = $btl->addlt(1 , 20 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
$prv['text2'] = '{tm1} '.$prv['text'].'. <font Color='.$prv['color'].'><b'.$btl->maginfoattack($u->info['id'],$this->ue['id'],1).'>--</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']';
}
$btl->priemAddLog($id, 1, 2, $u->info['id'], $this->ue['id'],
'<font color^^^^#'.$prv['color2'].'>Ïûëàþùàÿ Ñìåðòü</font>',
'<font color^^^^#' . $prv['color'] . '>Ïûëàþùàÿ Ñìåðòü</font>',
$prv['text2'],
($btl->hodID + 1)
);
//Äîáàâëÿåì ïðèåì
//$this->addEffPr($pl,$id);
//$this->addPriem($this->ue['id'],242,'add_notactic=1|add_nousepriem=1',2,77,2,$u->info['id'],3,'ïûëàþùèéóæàñ',0,0,1);
//Óäàëÿåì îëåäåíåíèå
$pvr['mg']['priem']['id'] = $pvr['mg']['id'];
$btl->delPriem($pvr['mg'], $btl->users[$btl->uids[$this->ue['id']]], 2);
//Îòíèìàåì òàêòèêè
$this->mintr($pl);
}else{
echo '<font color=red><b>Íà ïåðñîíàæå íåò ïîæèðàþùåãî ïëàìåíè (Âàøåãî çàêëÿòèÿ)</b></font>';
$cup = true;
}
unset($pvr);
?>

View File

@ -1,76 +1,14 @@
<?
if(!defined('GAME')) {
die();
}
/*
Ïðèåì: Öåëü âîäû
<?php
/**
* Ïðèåì: Öåëü {ñòèõèÿ}
* @var $this Priems
* @var $btl Battle
* @var $id
* @var $pl
*/
$pvr = array();
$pvr['x5'] = mysql_fetch_array(mysql_query('SELECT `id`,`x` FROM `eff_users` WHERE `uid` = "'.$this->ue['id'].'" AND `v2` = 25 AND `delete` = 0 LIMIT 1'));
if( $pvr['x5']['x'] < 5 ) {
$prv['x'] = '';
if( $pvr['x5']['x'] > 0 ) {
$prv['x'] = ' x'.($pvr['x5']['x']+1).'';
if (!$id) {
exit();
}
//
$this->addEffPr($pl,$id);
//
$prv['effx'] = '';
if( $pvr['x5']['x'] > 0 ) {
$prv['eff'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id` = "'.$pvr['x5']['id'].'" LIMIT 1'));
if( isset($prv['eff']['id']) ) {
//Ðàçáèðàåì äàòó $prv['eff']['data']
$prv['eda'] = $prv['eff']['data'];
}
}else{
//Ðàçáèðàåì äàòó $pl['date3']
$prv['eda'] = $pl['date3'];
}
//
if( isset($prv['eda']) ) {
$prv['d'] = $u->lookStats($prv['eda']);
$prv['j'] = $u->lookStats($this->redate($prv['eda'],$u->info['id']));
$prv['v'] = $u->lookKeys($this->redate($prv['eda'],$u->info['id']),0); // êëþ÷è 2
$prv['i'] = 0; $prv['inf'] = '';
while($prv['i']<count($prv['v'])) {
//$prv['j'][$prv['v'][$prv['i']]] += $prv['j'][$prv['v'][$prv['i']]];
$prv['vi'] = str_replace('add_','',$prv['v'][$prv['i']]);
if($u->is[$prv['vi']]!='') {
if($prv['j'][$prv['v'][$prv['i']]]>0) {
$prv['inf'] .= $u->is[$prv['vi']].': +'.($prv['j'][$prv['v'][$prv['i']]]*(1+$pvr['x5']['x'])).', ';
}elseif($prv['j'][$prv['v'][$prv['i']]]<0){
$prv['inf'] .= $u->is[$prv['vi']].': '.($prv['j'][$prv['v'][$prv['i']]]*(1+$prv['x5']['x'])).', ';
}
}
$prv['i']++;
}
$prv['effx'] = rtrim($prv['inf'],', ');
}
//
if( $prv['effx'] != '' ) {
$prv['effx'] = ' ('.$prv['effx'].')';
}
//
$prv['color2'] = '000000';
$prv['text'] = $btl->addlt(1 , 19 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
$prv['text2'] = '{tm1} '.$prv['text'].'.'.$prv['effx'];
$btl->priemAddLog( $id, 1, 2, $u->info['id'], $this->ue['id'],
'<font color^^^^#'.$prv['color2'].'>Öåëü âîäû'.$prv['x'].'</font>',
$prv['text2'],
($btl->hodID + 0)
);
//Äîáàâëÿåì ïðèåì
//$this->addEffPr($pl,$id);
//$this->addPriem($this->ue['id'],$pl['id'],'atgm='.floor($pvr['hp']/10).'',0,77,-1,$u->info['id'],5,'öåëüâîäû',0,0,1);
//Îòíèìàåì òàêòèêè
//$this->mintr($pl);
}else{
$cup = true;
echo '<font color=red><b>Íà ïåðîñíàæå äîñòèãíóòî ìàêñèàëüíîå êîëëè÷åñòâî öåëåé</b></font>';
}
unset($pvr);
?>
$cup = $this->magicTarget('water', $pl, $id, $btl);

View File

@ -11,14 +11,14 @@ $pvr['x5'] = mysql_fetch_array(mysql_query('SELECT `id`,`x` FROM `eff_users` WHE
if( $pvr['x5']['x'] < 5 ) {
$prv['x'] = '';
if( $pvr['x5']['x'] > 0 ) {
$prv['x'] = ' x'.($pvr['x5']['x']+1).'';
$prv['x'] = ' x'.($pvr['x5']['x']+1);
}
//
$this->addEffPr($pl,$id);
//
$prv['effx'] = '';
if( $pvr['x5']['x'] > 0 ) {
$prv['eff'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id` = "'.$pvr['x5']['id'].'" LIMIT 1'));
$prv['eff'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id` = '.$pvr['x5']['id']));
if( isset($prv['eff']['id']) ) {
//Ðàçáèðàåì äàòó $prv['eff']['data']
$prv['eda'] = $prv['eff']['data'];
@ -34,7 +34,7 @@ if( $pvr['x5']['x'] < 5 ) {
$prv['v'] = $u->lookKeys($this->redate($prv['eda'],$u->info['id']),0); // êëþ÷è 2
$prv['i'] = 0; $prv['inf'] = '';
while($prv['i']<count($prv['v'])) {
//$prv['j'][$prv['v'][$prv['i']]] += $prv['j'][$prv['v'][$prv['i']]];
$prv['vi'] = str_replace('add_','',$prv['v'][$prv['i']]);
if($u->is[$prv['vi']]!='') {
if($prv['j'][$prv['v'][$prv['i']]]>0) {

View File

@ -57,11 +57,7 @@ if( isset($pr_used_this) && isset($pr_moment) ) {
mysql_query('UPDATE `eff_users` SET `data` = "'.$pvr['redata'].'" WHERE `id` = "'.$btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['id'].'" LIMIT 1');
//
$pvr['mp'] = floor($pvr['mp']*$btl->stats[$btl->uids[$u1]]['effects'][$prv['j_priem']]['x']);
/*$pvr['hp'] = $priem->magatack( $u2, $u1, $pvr['hp'], 'âîäŕ', 0 );
$pvr['promah_type'] = $pvr['hp'][3];
$pvr['promah'] = $pvr['hp'][2];
$pvr['krit'] = $pvr['hp'][1];
$pvr['hp'] = $pvr['hp'][0];*/
$pvr['mpSee'] = '--';
$pvr['mpNow'] = floor($btl->stats[$btl->uids[$u1]]['mpNow']);
$pvr['mpAll'] = $btl->stats[$btl->uids[$u1]]['mpAll'];

View File

@ -99,7 +99,8 @@ if( isset($pr_momental_this)) {
//
//if( $at['p'][$a]['atack'][$j]['yron']['y'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['y'] = 0; }
if( $at['p'][$a]['atack'][$j]['yron']['r'] >= 0 ) { $at['p'][$a]['atack'][$j]['yron']['r'] = -1; }
$priem->mg2static_points( $u1 , $btl->stats[$btl->uids[$u1]] );
$priem->addAirStaticPoints($u1);
/*
if( $at['p'][$a]['atack'][$j]['yron']['k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['k'] = 1; }
if( $at['p'][$a]['atack'][$j]['yron']['m_k'] < 1 ) { $at['p'][$a]['atack'][$j]['yron']['m_k'] = 1; }

View File

@ -1,14 +1,4 @@
<?
if(!defined('GAME')) {
die();
}
/*
Прием: Скорость молнии
*/
$pvr = array();
//Действие при клике
<?php
/* Прием: Скорость молнии */
if(!$id) die();
$this->addEffPr($pl,$id);
unset($pvr);
?>

View File

@ -116,7 +116,7 @@ $pvr = array();
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$pvr['uid'],$pvr['hp'],0);
$this->mg2static_points( $pvr['uid'] , $btl->stats[$btl->uids[$pvr['uid']]] );
$this->addAirStaticPoints(); /* Óäàð â Ñòàòèêó*/
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];

View File

@ -1,76 +1,14 @@
<?
if(!defined('GAME')) {
die();
}
/*
Ïðèåì: Öåëü âîäû
<?php
/**
* Ïðèåì: Öåëü {ñòèõèÿ}
* @var $this Priems
* @var $btl Battle
* @var $id
* @var $pl
*/
$pvr = array();
$pvr['x5'] = mysql_fetch_array(mysql_query('SELECT `id`,`x` FROM `eff_users` WHERE `uid` = "'.$this->ue['id'].'" AND `v2` = 26 AND `delete` = 0 LIMIT 1'));
if( $pvr['x5']['x'] < 5 ) {
$prv['x'] = '';
if( $pvr['x5']['x'] > 0 ) {
$prv['x'] = ' x'.($pvr['x5']['x']+1).'';
if (!$id) {
exit();
}
//
$this->addEffPr($pl,$id);
//
$prv['effx'] = '';
if( $pvr['x5']['x'] > 0 ) {
$prv['eff'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id` = "'.$pvr['x5']['id'].'" LIMIT 1'));
if( isset($prv['eff']['id']) ) {
//Ðàçáèðàåì äàòó $prv['eff']['data']
$prv['eda'] = $prv['eff']['data'];
}
}else{
//Ðàçáèðàåì äàòó $pl['date3']
$prv['eda'] = $pl['date3'];
}
//
if( isset($prv['eda']) ) {
$prv['d'] = $u->lookStats($prv['eda']);
$prv['j'] = $u->lookStats($this->redate($prv['eda'],$u->info['id']));
$prv['v'] = $u->lookKeys($this->redate($prv['eda'],$u->info['id']),0); // êëþ÷è 2
$prv['i'] = 0; $prv['inf'] = '';
while($prv['i']<count($prv['v'])) {
//$prv['j'][$prv['v'][$prv['i']]] += $prv['j'][$prv['v'][$prv['i']]];
$prv['vi'] = str_replace('add_','',$prv['v'][$prv['i']]);
if($u->is[$prv['vi']]!='') {
if($prv['j'][$prv['v'][$prv['i']]]>0) {
$prv['inf'] .= $u->is[$prv['vi']].': +'.($prv['j'][$prv['v'][$prv['i']]]*(1+$pvr['x5']['x'])).', ';
}elseif($prv['j'][$prv['v'][$prv['i']]]<0){
$prv['inf'] .= $u->is[$prv['vi']].': '.($prv['j'][$prv['v'][$prv['i']]]*(1+$prv['x5']['x'])).', ';
}
}
$prv['i']++;
}
$prv['effx'] = rtrim($prv['inf'],', ');
}
//
if( $prv['effx'] != '' ) {
$prv['effx'] = ' ('.$prv['effx'].')';
}
//
$prv['color2'] = '000000';
$prv['text'] = $btl->addlt(1 , 19 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
$prv['text2'] = '{tm1} '.$prv['text'].'.'.$prv['effx'];
$btl->priemAddLog( $id, 1, 2, $u->info['id'], $this->ue['id'],
'<font color^^^^#'.$prv['color2'].'>Öåëü îãíÿ'.$prv['x'].'</font>',
$prv['text2'],
($btl->hodID + 0)
);
//Äîáàâëÿåì ïðèåì
//$this->addEffPr($pl,$id);
//$this->addPriem($this->ue['id'],$pl['id'],'atgm='.floor($pvr['hp']/10).'',0,77,-1,$u->info['id'],5,'öåëüâîäû',0,0,1);
//Îòíèìàåì òàêòèêè
//$this->mintr($pl);
}else{
$cup = true;
echo '<font color=red><b>Íà ïåðîñíàæå äîñòèãíóòî ìàêñèàëüíîå êîëëè÷åñòâî öåëåé</b></font>';
}
unset($pvr);
?>
$cup = $this->magicTarget('fire', $pl, $id, $btl);

View File

@ -1,65 +1,27 @@
<?
<?php
if (!defined('GAME')) {
die();
}
/*
Ïðèåì: Öåëü âîäû
Ïðèåì: Ñòàòèêà.
*/
$pvr = array();
$pvr = [];
$pvr['x5'] = mysql_fetch_array(mysql_query('SELECT `id`,`x` FROM `eff_users` WHERE `uid` = "'.$this->ue['id'].'" AND `v2` = 260 AND `delete` = 0 LIMIT 1'));
if( $pvr['x5']['x'] < 5 ) {
$prv['x'] = '';
$pvr['x5'] = mysql_fetch_array(mysql_query('SELECT `id`,`x` FROM `eff_users` WHERE `uid` = ' . $this->ue['id'] . ' AND `v2` = 260 AND `delete` = 0 LIMIT 1'));
if ($pvr['x5']['x'] > 0) {
$prv['x'] = ' x'.($pvr['x5']['x']+1).'';
}
//
$this->addEffPr($pl,$id);
//
$prv['effx'] = '';
if( $pvr['x5']['x'] > 0 ) {
$prv['eff'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id` = "'.$pvr['x5']['id'].'" LIMIT 1'));
if( isset($prv['eff']['id']) ) {
$prv['eda'] = $prv['eff']['data'];
}
}else{
$prv['eda'] = $pl['date3'];
}
//
if( isset($prv['eda']) ) {
$prv['d'] = $u->lookStats($prv['eda']);
$prv['j'] = $u->lookStats($this->redate($prv['eda'],$u->info['id']));
$prv['v'] = $u->lookKeys($this->redate($prv['eda'],$u->info['id']),0); // êëþ÷è 2
$prv['i'] = 0; $prv['inf'] = '';
while($prv['i']<count($prv['v'])) {
$prv['vi'] = str_replace('add_','',$prv['v'][$prv['i']]);
if($u->is[$prv['vi']]!='') {
if($prv['j'][$prv['v'][$prv['i']]]>0) {
$prv['inf'] .= $u->is[$prv['vi']].': +'.($prv['j'][$prv['v'][$prv['i']]]).', ';
}elseif($prv['j'][$prv['v'][$prv['i']]]<0){
$prv['inf'] .= $u->is[$prv['vi']].': '.($prv['j'][$prv['v'][$prv['i']]]).', ';
}
}
$prv['i']++;
}
$prv['effx'] = rtrim($prv['inf'],', ');
}
//
if( $prv['effx'] != '' ) {
$prv['effx'] = ' ('.$prv['effx'].')';
}
//
$prv['color2'] = '000000';
$prv['text'] = $btl->addlt(1 , 19 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
$prv['text2'] = '{tm1} '.$prv['text'].'.'.$prv['effx'];
$btl->priemAddLog( $id, 1, 2, $u->info['id'], $this->ue['id'],
'<font color^^^^#'.$prv['color2'].'>Ñòàòèêà'.$prv['x'].'</font>',
$prv['text2'],
($btl->hodID + 0)
);
}else{
$cup = true;
echo '<font color=red><b>Íà ïåðîñíàæå äîñòèãíóòî ìàêñèàëüíîå êîëëè÷åñòâî ñòàòèê</b></font>';
echo '<b style="color: red">Íà ïåðîñíàæå óæå åñòü ñòàòèêà.</b>';
} else {
$this->addEffPr($pl, $id);
$prv['color2'] = '0af';
$prv['text'] = $btl->addlt(1, 19, $btl->users[$btl->uids[$this->u->info['id']]]['sex'], null);
$prv['text2'] = '{tm1} ' . $prv['text'];
$btl->priemAddLog($id, 1, 2, $u->info['id'], $this->ue['id'],
'<font color^^^^#' . $prv['color2'] . '>Ñòàòèêà</font>',
$prv['text2'],
($btl->hodID)
);
}
unset($pvr);
?>

View File

@ -1,152 +1,49 @@
<?
if(!defined('GAME')) {
die();
}
/*
Ïðèåì: Çàðÿä: Ïîðàæåíèå
<?php
/**
* Ïðèåì: Çàðÿä: Ïîðàæåíèå
* @var Battle $btl
* @var $id
* @var $pl
*/
$pvr = array();
//$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$btl->users[$btl->uids[$this->ue['id']]]['id'].'" AND `v2` = "260" AND `user_use` = "'.$u->info['id'].'" ORDER BY `id` DESC LIMIT 1'));
$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$btl->users[$btl->uids[$this->ue['id']]]['id'].'" AND `v2` = "260" ORDER BY `id` DESC LIMIT 1'));
if( isset($pvr['mg']['id']) ) {
//Äåéñòâèå ïðè êëèêå
//$pvr['hp'] = floor(144/3*$pvr['mg']['x']);
/*$pvr['hp'] = 1;*/
//
$pvr['data'] = $this->lookStatsArray($pvr['mg']['data']);
//
/**/
if( $pvr['data']['add_mg2static_points'][0] < 1 ) {
echo '<font color=red><b>Ñòàòèêà íå ñîáðàëà äîñòàòî÷íîãî êîëè÷åñòâà çàðÿäîâ</b></font>';
if (!$id) {
exit();
}
$params = [
'maxLimitbyStatic' => [1 => 90, 2 => 140, 3 => 175, 4 => 200, 5 => 244],
'query' => 'select x from eff_users where v2 = 260 and user_use = %s and uid = %s',
'query_remove_static' => 'delete from eff_users where v2 = 260 and user_use = %s and uid = %s',
'hpNow' => $btl->stats[$btl->uids[$this->ue['id']]]['hpNow'],
'hpAll' => $btl->stats[$btl->uids[$this->ue['id']]]['hpAll'],
'color' => '#0af',
'logtext' => '{tm1} ' . $btl->addlt(1, 19, $btl->users[$btl->uids[$this->u->info['id']]]['sex'], null),
];
$params = array_merge($params, [
'x' => mysql_fetch_array(mysql_query(sprintf($params['query'], $this->u->info['id'], $this->ue['id']))),
'damage' => '',
]);
$params['damage'] = mt_rand(1, $params['maxLimitbyStatic'][$params['x'][0]]);
if (empty($params['x'])) {
echo '<b style="color: red">Íà ïåðñîíàæå íåò âàøåãî çàêëÿòèÿ Ñòàòèêè</b>';
$cup = true;
} else {
$pvr['hp'] = floor($btl->stats[$btl->uids[$this->ue['id']]]['hpAll']-floor($btl->stats[$btl->uids[$this->ue['id']]]['hpNow']));
//
$pvr['hp'] = floor( ( $pvr['hp'] / 100 * rand( 1 , 3 ) ) * $pvr['data']['add_mg2static_points'][0] );
$pvr['mx'] = array(
0 => 170,
1 => 170,
2 => 170,
3 => 170,
4 => 170,
5 => 170,
6 => 170,
7 => 170,
8 => 204,
9 => 244,
10 => 292,
11 => 352,
12 => 454,
13 => 570,
14 => 604,
15 => 744,
16 => 892,
17 => 952,
18 => 1054,
19 => 1170,
20 => 1292,
21 => 1487
);
$pvr['mx'] = $pvr['mx'][$u->info['level']];
//
//$pvr['hp'] = floor($pvr['hp']/20*$u->stats['mg3']);//óìåëêè
//$pvr['hp'] = floor($pvr['hp']/200*$u->stats['s5']);//Èíòåëåêò
/*if( $btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'] < floor($btl->stats[$btl->uids[$u->info['enemy']]]['hpAll']/100*30) ) {
$pvr['hp'] = floor( $pvr['hp'] + ($pvr['hp']/100*(50*$pvr['mg']['x'])) );
}*/
$pvr['hp'] = $this->magatack( $u->info['id'], $this->ue['id'], $pvr['hp'], 'âîçäóõ', 1 );
$pvr['promah_type'] = $pvr['hp'][3];
$pvr['promah'] = $pvr['hp'][2];
$pvr['krit'] = $pvr['hp'][1];
$pvr['hp'] = $pvr['hp'][0];
$pvr['hpSee'] = '--';
$pvr['hpNow'] = floor($btl->stats[$btl->uids[$this->ue['id']]]['hpNow']);
$pvr['hpAll'] = $btl->stats[$btl->uids[$this->ue['id']]]['hpAll'];
if( $pvr['krit'] == true ) {
if( $pvr['hp'] > $pvr['mx']*2 ) {
$pvr['hp'] = $pvr['mx']*2;
}
}else{
if( $pvr['hp'] > $pvr['mx'] ) {
$pvr['hp'] = $pvr['mx'];
}
$params['damage'] = $btl->testYronPriem($this->u->info['id'], $this->ue['id'], 21, $params['damage'], 6, true);
$btl->priemYronSave($this->u->info['id'], $this->ue['id'], $params['damage'], 0);
$params['hpNow'] -= $params['damage'];
if ($params['hpNow'] > $params['hpAll']) {
$params['hpNow'] = $params['hpAll'];
} elseif ($params['hpNow'] < 0) {
$params['hpNow'] = 0;
}
$params['logtext'] .= sprintf("<b style='color: %s;'>-%s</b> [%s/%s]", $params['color'], $params['damage'], $params['hpNow'], $params['hpAll']);
//Èñïîëüçóåì ïðîâåðêó íà óðîí ïðèåìîâ
$pvr['hp'] = $btl->testYronPriem( $u->info['id'], $this->ue['id'], 21, $pvr['hp'], 6, true );
$pvr['hpSee'] = '-'.$pvr['hp'];
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$this->ue['id'],$pvr['hp'],0);
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];
}elseif( $pvr['hpNow'] < 0 ) {
$pvr['hpNow'] = 0;
}
$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] = $pvr['hpNow'];
mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'].'" WHERE `id` = "'.$this->ue['id'].'" LIMIT 1');
$prv['text'] = $btl->addlt(1 , 19 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
//Öâåò ïðèåìà
if( $pvr['promah'] == false ) {
if( $pvr['krit'] == false ) {
$prv['color2'] = '006699';
if(isset($btl->mcolor[$btl->mname['âîçäóõ']])) {
$prv['color2'] = $btl->mcolor[$btl->mname['âîçäóõ']];
}
$prv['color'] = '000000';
if(isset($btl->mncolor[$btl->mname['âîçäóõ']])) {
$prv['color'] = $btl->mncolor[$btl->mname['âîçäóõ']];
}
}else{
$prv['color2'] = 'FF0000';
$prv['color'] = 'FF0000';
}
}else{
$prv['color2'] = '909090';
$prv['color'] = '909090';
}
$prv['text2'] = '{tm1} '.$prv['text'].'. <font Color='.$prv['color'].'><b '.$btl->maginfoattack($u->info['id'],$this->ue['id'],3).'>'.$pvr['hpSee'].'</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']';
if( $pvr['promah_type'] == 2 ) {
$prv['text'] = $btl->addlt(1 , 20 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
$prv['text2'] = '{tm1} '.$prv['text'].'. <font Color='.$prv['color'].'><b '.$btl->maginfoattack($u->info['id'],$this->ue['id'],3).'>--</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']';
}
$btl->priemAddLog( $id, 1, 2, $u->info['id'], $this->ue['id'],
'<font color^^^^#'.$prv['color2'].'>Çàðÿä: Ïîðàæåíèå</font>',
$prv['text2'],
($btl->hodID + 1)
);
//Äîáàâëÿåì ïðèåì
//$this->addEffPr($pl,$id);
//$this->addPriem($u->info['enemy'],$pl['id'],'atgm='.($pvr['hp']/16).'',2,77,4,$u->info['id'],3,'îëåäåíåíèå',0,0,1);
//Óäàëÿåì îëåäåíåíèå
$pvr['mg']['priem']['id'] = $pvr['mg']['id'];
//$btl->delPriem($pvr['mg'],$btl->users[$btl->uids[$this->ue['id']]],2);
$pvr['edt'] = $u->lookStats($pvr['mg']['data']);
$pvr['edt']['add_zm2proc'] = 0;
$pvr['edt']['add_mg2static_points'] = 0;
$pvr['edt'] = $u->impStats($pvr['edt']);
mysql_query('UPDATE `eff_users` SET `x` = 1, `data` = "'.$pvr['edt'].'" WHERE `id` = "'.$pvr['mg']['id'].'" LIMIT 1');
$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] = $params['hpNow'];
mysql_query('UPDATE `stats` SET `hpNow` = ' . $params['hpNow'] . ' WHERE `id` = ' . $this->ue['id']);
$btl->priemAddLog($id, 1, 2, $this->u->info['id'], $this->ue['id'], "<span style='color: {$params['color']}'>Çàðÿä: Ïîðàæåíèå</span>",
$params['logtext'], ($btl->hodID + 1));
mysql_query(sprintf($params['query_remove_static'], $this->u->info['id'], $this->ue['id']));
//Îňíčěŕĺě ňŕęňčęč
$this->mintr($pl);
}
}else{
echo '<font color=red><b>Íà ïåðñîíàæå íåò Ñòàòèêè (Âàøåãî çàêëÿòèÿ)</b></font>';
$cup = true;
}
unset($pvr);
?>
unset($params);

View File

@ -1,4 +1,4 @@
<?
<?php /**@var $this Priems*/
if (!defined('GAME')) {
die();
}
@ -6,47 +6,29 @@ if(!defined('GAME')) {
Ïðèåì: Çàðÿä: Ñîáðàòü
*/
$pvr = array();
//$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$btl->users[$btl->uids[$this->ue['id']]]['id'].'" AND `v2` = "260" AND `user_use` = "'.$u->info['id'].'" ORDER BY `id` DESC LIMIT 1'));
$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$btl->users[$btl->uids[$this->ue['id']]]['id'].'" AND `v2` = "260" ORDER BY `id` DESC LIMIT 1'));
if( isset($pvr['mg']['id']) ) {
//Äåéñòâèå ïðè êëèêå
//$pvr['hp'] = floor(144/3*$pvr['mg']['x']);
/*$pvr['hp'] = 1;*/
//
$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = ' . $btl->users[$btl->uids[$this->ue['id']]]['id'] . ' AND `v2` = 260 ORDER BY `id` DESC LIMIT 1'));
if (!isset($pvr['mg']['id'])) {
echo '<b style="color: red">Íà ïåðñîíàæå íåò Ñòàòèêè</b>';
$cup = true;
} else {
$pvr['data'] = $this->lookStatsArray($pvr['mg']['data']);
//
/**/
if( $pvr['data']['add_mg2static_points'][0] < 1 ) {
echo '<font color=red><b>Ñòàòèêà íå ñîáðàëà äîñòàòî÷íîãî êîëè÷åñòâà çàðÿäîâ</b></font>';
if ($pvr['data']['add_mg2static_points'] < 1) {
echo '<b style="color: red">Ñòàòèêà íå ñîáðàëà äîñòàòî÷íîãî êîëè÷åñòâà çàðÿäîâ</b>';
$cup = true;
} else {
$prv['text'] = $btl->addlt(1 , 21 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
$prv['text'] = $btl->addlt(1, 21, $btl->users[$btl->uids[$this->u->info['id']]]['sex'], NULL);
//Öâåò ïðèåìàû
if( $pvr['promah'] == false ) {
if( $pvr['krit'] == false ) {
$prv['color2'] = '006699';
if(isset($btl->mcolor[$btl->mname['âîçäóõ']])) {
$prv['color2'] = $btl->mcolor[$btl->mname['âîçäóõ']];
}
$prv['color'] = '000000';
if(isset($btl->mncolor[$btl->mname['âîçäóõ']])) {
$prv['color'] = $btl->mncolor[$btl->mname['âîçäóõ']];
}
}else{
$prv['color2'] = 'FF0000';
$prv['color'] = 'FF0000';
}
}else{
$prv['color2'] = '909090';
$prv['color'] = '909090';
}
$prv['color'] = $this->logColor[$this::AIR];
//Õèëÿåì ìàíó
$pvr['mp'] = $pvr['data']['add_mg2static_points'][0]*(3*$u->info['level']);
$pvr['mp'] = $pvr['data']['add_mg2static_points'] * (3 * $this->u->info['level']);
//
$pvr['mpSee'] = '';
$pvr['mpNow'] = floor($btl->stats[$btl->uids[$u->info['id']]]['mpNow']);
$pvr['mpAll'] = $btl->stats[$btl->uids[$u->info['id']]]['mpAll'];
$pvr['mpNow'] = floor($btl->stats[$btl->uids[$this->u->info['id']]]['mpNow']);
$pvr['mpAll'] = $btl->stats[$btl->uids[$this->u->info['id']]]['mpAll'];
$pvr['mpTr'] = $pvr['mpNow'] + $pvr['mp'];
if ($pvr['mpTr'] > $pvr['mpAll']) {
@ -61,53 +43,32 @@ if( isset($pvr['mg']['id']) ) {
$pvr['mpSee'] = $pvr['mp'];
}
if( $pvr['mpSee'] == '' || $pvr['mpSee'] == 0 ) {
if (empty($pvr['mpSee'])) {
$pvr['mpSee'] = '--';
}
$u->stats['mpNow'] = $pvr['mpNow'];
$u->info['mpNow'] = $pvr['mpNow'];
$btl->stats[$btl->uids[$u->info['id']]]['mpNow'] = $pvr['mpNow'];
$btl->users[$btl->uids[$u->info['id']]]['mpNow'] = $pvr['mpNow'];
mysql_query('UPDATE `stats` SET `mpNow` = "'.$u->stats['mpNow'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
$this->u->stats['mpNow'] = $pvr['mpNow'];
$this->u->info['mpNow'] = $pvr['mpNow'];
$btl->stats[$btl->uids[$this->u->info['id']]]['mpNow'] = $pvr['mpNow'];
$btl->users[$btl->uids[$this->u->info['id']]]['mpNow'] = $pvr['mpNow'];
mysql_query('UPDATE `stats` SET `mpNow` = ' . $this->u->stats['mpNow'] . ' WHERE `id` = ' . $this->u->info['id']);
//Óäàëÿåì 1 íåãàòèâíûé ýôôåêò
$pvr['no'] = ' AND `a`.`v2` != 201';
$pvr['sp'] = mysql_query('SELECT `a`.* FROM `eff_users` AS `a` LEFT JOIN `priems` AS `b` ON `b`.`id` = `a`.`v2` WHERE `a`.`uid` = "'.$u->info['id'].'" AND `a`.`delete` = 0 AND `a`.`v1` = "priem" '.$pvr['no'].' AND `b`.`neg` > 0 LIMIT 1');
$pvr['sp'] = mysql_query('select * from eff_users left join priems on priems.id = v2 where `delete` = 0 and neg > 0 and v1 = \'priem\' and v2 != 201 and uid = ' . $this->u->info['id']);
$pvr['pl'] = mysql_fetch_array($pvr['sp']);
$pvr['pl']['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "'.$pvr['pl']['v2'].'" LIMIT 1'));
shuffle($pvr['pl']);
$pvr['pl'] = $pvr['pl'][0];
$pvr['pl']['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = ' . $pvr['pl']['v2']));
if (isset($pvr['pl']['priem'])) {
$btl->delPriem($pvr['pl'],$btl->users[$btl->uids[$u->info['id']]],100);
$btl->delPriem($pvr['pl'], $btl->users[$btl->uids[$this->u->info['id']]], 100);
}
$prv['text2'] = '{tm1} ' . $prv['text'] . ' ÷åðåç {u2}. <font Color=' . $prv['color'] . '><b>' . $pvr['mpSee'] . '</b></font> [' . $pvr['mpNow'] . '/' . $pvr['mpAll'] . '] (ìàíà)';
$btl->priemAddLog( $id, 1, 2, $u->info['id'], $this->ue['id'],
'<font color^^^^#'.$prv['color2'].'>Çàðÿä: Ñîáðàòü</font>',
$prv['text2'],
($btl->hodID + 1)
);
$btl->priemAddLog($id, 1, 2, $this->u->info['id'], $this->ue['id'], '<font color^^^^#' . $prv['color'] . '>Çàðÿä: Ñîáðàòü</font>', $prv['text2'], ($btl->hodID + 1));
//Äîáàâëÿåì ïðèåì
//$this->addEffPr($pl,$id);
//$this->addPriem($this->ue['id'],$pl['id'],'atgm='.($pvr['hp']/16).'',2,77,4,$u->info['id'],3,'îëåäåíåíèå',0,0,1);
//Óäàëÿåì îëåäåíåíèå
$pvr['mg']['priem']['id'] = $pvr['mg']['id'];
//$btl->delPriem($pvr['mg'],$btl->users[$btl->uids[$this->ue['id']]],2);
$pvr['edt'] = $u->lookStats($pvr['mg']['data']);
$pvr['edt']['add_zm2proc'] = 0;
$pvr['edt']['add_mg2static_points'] = 0;
$pvr['edt'] = $u->impStats($pvr['edt']);
mysql_query('UPDATE `eff_users` SET `x` = 1, `data` = "'.$pvr['edt'].'" WHERE `id` = "'.$pvr['mg']['id'].'" LIMIT 1');
//Îòíèìàåì òàêòèêè
//$this->mintr($pl);
$pvr['edt'] = $this->changeStatsData($pvr['mg']['data'], ['add_mg2static_points' => 0]);
mysql_query('UPDATE `eff_users` SET `x` = 1, `data` = "' . $pvr['edt'] . '" WHERE `id` = ' . $pvr['mg']['id']);
}
}else{
echo '<font color=red><b>Íà ïåðñîíàæå íåò Ñòàòèêè (Âàøåãî çàêëÿòèÿ)</b></font>';
$cup = true;
}
unset($pvr);
?>

View File

@ -1,43 +1,27 @@
<?
if(!defined('GAME')) {
die();
}
/*
Ïðèåì: Îëåäåíåíèå: Ðàçáèòü!
<?php
/** Ïðèåì: Îëåäåíåíèå: Ðàçáèòü! (êàêîãî-òî õðåíà íåêîòîðûå ïðè¸ìû ïîëíîñòüþ óìèðàþò ïðè ïåðåíîñå â _cron_)
* @var $this Priems
* @var $btl Battle
* @var $id int
* @var $pl array
*/
if (!$id) {
exit();
}
//$cup = $this->glaciationBreak($id, $pl, $btl);
$pvr = array();
$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$btl->users[$btl->uids[$this->ue['id']]]['id'].'" AND `bj` = "îëåäåíåíèå" AND `user_use` = "'.$u->info['id'].'" ORDER BY `id` DESC LIMIT 1'));
if( isset($pvr['mg']['id']) ) {
$pvr['mg'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $btl->users[$btl->uids[$this->ue['id']]]['id'] . '" AND `bj` = "îëåäåíåíèå" AND `user_use` = "' . $this->u->info['id'] . '" ORDER BY `id` DESC LIMIT 1'));
if (!isset($pvr['mg']['id'])) {
echo '<b style="color: red;">Íà ïåðñîíàæå íåò îëåäåíåíèÿ (Âàøåãî çàêëÿòèÿ)</b>';
$cup = true;
} else {
//Äåéñòâèå ïðè êëèêå
//$pvr['hp'] = floor(144/3*$pvr['mg']['x']);
$pvr['hp'] = 1;
//
$pvr['data'] = $this->lookStatsArray($pvr['mg']['data']);
$pvr['di'] = 0;
$pvr['dc'] = count($pvr['data']['atgm']);
$pvr['rd'] = 0;
while( $pvr['di'] < 4 ) {
if( isset($pvr['data']['atgm'][($pvr['dc']-$pvr['di'])]) ) {
if( $pvr['rd'] < 3 ) {
$pvr['hp'] += $pvr['data']['atgm'][($pvr['dc']-$pvr['di'])];
$pvr['rd']++;
}
}
$pvr['di']++;
}
//
//$pvr['hp'] = 444;
$pvr['hp'] = 100;
//$pvr['hp'] += floor($pvr['hp']/100*$u->stats['mg3']);//óìåëêè
//$pvr['hp'] += floor($pvr['hp']/100*($u->stats['s5']*0.15));//Èíòåëåêò , áûëî 0.33
//
if( $btl->stats[$btl->uids[$u->info['enemy']]]['hpNow'] < floor($btl->stats[$btl->uids[$this->ue['id']]]['hpAll']/100*33) ) {
//$pvr['hp'] = floor( $pvr['hp'] + ($pvr['hp']/100*(50*$pvr['mg']['x'])) );
$pvr['hp'] = 80;
if ($btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] < floor($btl->stats[$btl->uids[$this->ue['id']]]['hpAll'] * 0.2)) {
$pvr['hp'] *= 1.5;
}
$pvr['hp'] = $this->magatack( $u->info['id'], $this->ue['id'], $pvr['hp'], 'âîäà', 1 );
$pvr['hp'] = $this->magatack($this->u->info['id'], $this->ue['id'], $pvr['hp'], 'âîäà', 1);
$pvr['promah_type'] = $pvr['hp'][3];
$pvr['promah'] = $pvr['hp'][2];
$pvr['krit'] = $pvr['hp'][1];
@ -47,11 +31,11 @@ if( isset($pvr['mg']['id']) ) {
$pvr['hpAll'] = $btl->stats[$btl->uids[$this->ue['id']]]['hpAll'];
//Èñïîëüçóåì ïðîâåðêó íà óðîí ïðèåìîâ
$pvr['hp'] = $btl->testYronPriem( $u->info['id'], $this->ue['id'], 21, $pvr['hp'], 7, true );
$pvr['hp'] = $btl->testYronPriem($this->u->info['id'], $this->ue['id'], 21, $pvr['hp'], 7, true);
$pvr['hpSee'] = '-' . $pvr['hp'];
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$this->ue['id'],$pvr['hp'],0);
$btl->priemYronSave($this->u->info['id'], $this->ue['id'], $pvr['hp'], 0);
if ($pvr['hpNow'] > $pvr['hpAll']) {
$pvr['hpNow'] = $pvr['hpAll'];
@ -61,44 +45,24 @@ if( isset($pvr['mg']['id']) ) {
$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] = $pvr['hpNow'];
mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'].'" WHERE `id` = "'.$this->ue['id'].'" LIMIT 1');
mysql_query('UPDATE `stats` SET `hpNow` = ' . $pvr['hpNow'] . ' WHERE `id` = ' . $this->ue['id']);
$prv['text'] = $btl->addlt(1 , 19 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
$prv['text'] = $btl->addlt(1, 19, $btl->users[$btl->uids[$this->u->info['id']]]['sex'], NULL);
//Öâåò ïðèåìà
if( $pvr['promah'] == false ) {
if( $pvr['krit'] == false ) {
$prv['color2'] = '006699';
if(isset($btl->mcolor[$btl->mname['âîäà']])) {
$prv['color2'] = $btl->mcolor[$btl->mname['âîäà']];
}
$prv['color'] = '000000';
if(isset($btl->mncolor[$btl->mname['âîäà']])) {
$prv['color'] = $btl->mncolor[$btl->mname['âîäà']];
}
if ($pvr['promah']) {
$prv['color'] = $this->logColor['miss'];
} elseif ($pvr['krit']) {
$prv['color'] = $this->logColor['crit'];
} else {
$prv['color2'] = 'FF0000';
$prv['color'] = 'FF0000';
$prv['color'] = $this->logColor[$this::WATER];
}
}else{
$prv['color2'] = '909090';
$prv['color'] = '909090';
}
$prv['text2'] = '{tm1} '.$prv['text'].'. <font Color='.$prv['color'].'><b '.$btl->maginfoattack($u->info['id'],$this->ue['id'],3).'>'.$pvr['hpSee'].'</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']';
$prv['text2'] = '{tm1} ' . $prv['text'] . '. <font Color=' . $prv['color'] . '><b ' . $btl->maginfoattack($this->u->info['id'], $this->ue['id'], 3) . '>' . $pvr['hpSee'] . '</b></font> [' . $pvr['hpNow'] . '/' . $pvr['hpAll'] . ']';
if ($pvr['promah_type'] == 2) {
$prv['text'] = $btl->addlt(1 , 20 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
$prv['text2'] = '{tm1} '.$prv['text'].'. <font Color='.$prv['color'].'><b '.$btl->maginfoattack($u->info['id'],$this->ue['id'],3).'>--</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']';
$prv['text'] = $btl->addlt(1, 20, $btl->users[$btl->uids[$this->u->info['id']]]['sex'], NULL);
$prv['text2'] = '{tm1} ' . $prv['text'] . '. <font Color=' . $prv['color'] . '><b ' . $btl->maginfoattack($this->u->info['id'], $this->ue['id'], 3) . '>--</b></font> [' . $pvr['hpNow'] . '/' . $pvr['hpAll'] . ']';
}
$btl->priemAddLog( $id, 1, 2, $u->info['id'], $u->info['enemy'],
'<font color^^^^#'.$prv['color2'].'>Îëåäåíåíèå: Ðàçáèòü!</font>',
$prv['text2'],
($btl->hodID + 1)
);
//Äîáàâëÿåì ïðèåì
//$this->addEffPr($pl,$id);
//$this->addPriem($u->info['enemy'],$pl['id'],'atgm='.($pvr['hp']/16).'',2,77,4,$u->info['id'],3,'îëåäåíåíèå',0,0,1);
$btl->priemAddLog($id, 1, 2, $this->u->info['id'], $this->u->info['enemy'], '<font color^^^^#' . $prv['color'] . '>Îëåäåíåíèå: Ðàçáèòü!</font>', $prv['text2'], ($btl->hodID + 1));
//Óäàëÿåì îëåäåíåíèå
$pvr['mg']['priem']['id'] = $pvr['mg']['id'];
@ -106,9 +70,5 @@ if( isset($pvr['mg']['id']) ) {
//Îòíèìàåì òàêòèêè
$this->mintr($pl);
}else{
echo '<font color=red><b>Íà ïåðñîíàæå íåò îëåäåíåíèÿ (Âàøåãî çàêëÿòèÿ)</b></font>';
$cup = true;
}
unset($pvr);
?>

View File

@ -1,92 +1,16 @@
<?
<?php
/** @var $this Priems*/
if(!defined('GAME')) {
die();
}
/*
Ïðèåì: Êðèñòàëëèçàöèÿ
*/
$pvr = array();
/* Ïðèåì: Êðèñòàëëèçàöèÿ */
if( isset($pr_used_this) && isset($pr_moment) ) {
//Êàæäûé õîä
$fx_priem = function( $id , $at , $uid, $j_id ) {
// -- íà÷àëî ïðèåìà
global $u, $btl, $priem;
// -- êîíåö ïðèåìà
return $at;
};
unset( $pr_used_this );
}else{
//Äåéñòâèå ïðè êëèêå
//$pvr['hp'] = $this->magatack( $u->info['id'], $this->ue['id'], $pvr['hp'], 'âîäà', 1 );
$pvr['promah_type'] = 0;
$pvr['promah'] = false;
$pvr['krit'] = false;
$pvr['hp'] = $btl->stats[$btl->uids[$this->ue['id']]]['s1'];
if( $pvr['hp'] > 10*$u->info['level'] ) {
$pvr['hp'] = $u->info['level']*10;
$this->crystalize($id, $pl, $btl);
}
$pvr['hpSee'] = '--';
$pvr['hpNow'] = floor($btl->stats[$btl->uids[$this->ue['id']]]['hpNow']);
$pvr['hpAll'] = $btl->stats[$btl->uids[$this->ue['id']]]['hpAll'];
//Èñïîëüçóåì ïðîâåðêó íà óðîí ïðèåìîâ
$pvr['hp'] = $btl->testYronPriem( $u->info['id'], $this->ue['id'], 21, $pvr['hp'], 7, true );
$pvr['hpSee'] = '-'.$pvr['hp'];
$pvr['hpNow'] -= $pvr['hp'];
$btl->priemYronSave($u->info['id'],$this->ue['id'],$pvr['hp'],0);
if( $pvr['hpNow'] > $pvr['hpAll'] ) {
$pvr['hpNow'] = $pvr['hpAll'];
}elseif( $pvr['hpNow'] < 0 ) {
$pvr['hpNow'] = 0;
}
$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'] = $pvr['hpNow'];
mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$this->ue['id']]]['hpNow'].'" WHERE `id` = "'.$this->ue['id'].'" LIMIT 1');
$prv['text'] = $btl->addlt(1 , 19 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
//Öâåò ïðèåìà
if( $pvr['promah'] == false ) {
if( $pvr['krit'] == false ) {
$prv['color2'] = '006699';
if(isset($btl->mcolor[$btl->mname['âîäà']])) {
$prv['color2'] = $btl->mcolor[$btl->mname['âîäà']];
}
$prv['color'] = '000000';
if(isset($btl->mncolor[$btl->mname['âîäà']])) {
$prv['color'] = $btl->mncolor[$btl->mname['âîäà']];
}
}else{
$prv['color2'] = 'FF0000';
$prv['color'] = 'FF0000';
}
}else{
$prv['color2'] = '909090';
$prv['color'] = '909090';
}
$prv['text2'] = '{tm1} '.$prv['text'].'. <font Color='.$prv['color'].'><b '.$btl->maginfoattack($u->info['id'],$this->ue['id'],3).'>'.$pvr['hpSee'].'</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']';
if( $pvr['promah_type'] == 2 ) {
$prv['text'] = $btl->addlt(1 , 20 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
$prv['text2'] = '{tm1} '.$prv['text'].'. <font Color='.$prv['color'].'><b '.$btl->maginfoattack($u->info['id'],$this->ue['id'],3).'>--</b></font> ['.$pvr['hpNow'].'/'.$pvr['hpAll'].']';
}
$btl->priemAddLog( $id, 1, 2, $u->info['id'], $this->ue['id'],
'<font color^^^^#'.$prv['color2'].'>Êðèñòàëëèçàöèÿ</font>',
$prv['text2'],
($btl->hodID + 1)
);
//Äîáàâëÿåì ïðèåì
//$this->addEffPr($pl,$id);
$this->addPriem($this->ue['id'],268,'|add_s1=-'.$btl->stats[$btl->uids[$u->info['id']]]['mg3'].'|add_s2=-'.$btl->stats[$btl->uids[$u->info['id']]]['mg3'].'',2,77,3,$u->info['id'],3,'êðèñòàëëèçàöèÿ',0,0,1);
//Îòíèìàåì òàêòèêè
//$this->mintr($pl);
}
unset($pvr);
?>

View File

@ -1,76 +1,14 @@
<?
if(!defined('GAME')) {
die();
}
/*
Ïðèåì: Öåëü âîäû
<?php
/**
* Ïðèåì: Öåëü {ñòèõèÿ}
* @var $this Priems
* @var $btl Battle
* @var $id
* @var $pl
*/
$pvr = array();
$pvr['x5'] = mysql_fetch_array(mysql_query('SELECT `id`,`x` FROM `eff_users` WHERE `uid` = "'.$this->ue['id'].'" AND `v2` = 27 AND `delete` = 0 LIMIT 1'));
if( $pvr['x5']['x'] < 5 ) {
$prv['x'] = '';
if( $pvr['x5']['x'] > 0 ) {
$prv['x'] = ' x'.($pvr['x5']['x']+1).'';
if (!$id) {
exit();
}
//
$this->addEffPr($pl,$id);
//
$prv['effx'] = '';
if( $pvr['x5']['x'] > 0 ) {
$prv['eff'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id` = "'.$pvr['x5']['id'].'" LIMIT 1'));
if( isset($prv['eff']['id']) ) {
//Ðàçáèðàåì äàòó $prv['eff']['data']
$prv['eda'] = $prv['eff']['data'];
}
}else{
//Ðàçáèðàåì äàòó $pl['date3']
$prv['eda'] = $pl['date3'];
}
//
if( isset($prv['eda']) ) {
$prv['d'] = $u->lookStats($prv['eda']);
$prv['j'] = $u->lookStats($this->redate($prv['eda'],$u->info['id']));
$prv['v'] = $u->lookKeys($this->redate($prv['eda'],$u->info['id']),0); // êëþ÷è 2
$prv['i'] = 0; $prv['inf'] = '';
while($prv['i']<count($prv['v'])) {
//$prv['j'][$prv['v'][$prv['i']]] += $prv['j'][$prv['v'][$prv['i']]];
$prv['vi'] = str_replace('add_','',$prv['v'][$prv['i']]);
if($u->is[$prv['vi']]!='') {
if($prv['j'][$prv['v'][$prv['i']]]>0) {
$prv['inf'] .= $u->is[$prv['vi']].': +'.($prv['j'][$prv['v'][$prv['i']]]*(1+$pvr['x5']['x'])).', ';
}elseif($prv['j'][$prv['v'][$prv['i']]]<0){
$prv['inf'] .= $u->is[$prv['vi']].': '.($prv['j'][$prv['v'][$prv['i']]]*(1+$prv['x5']['x'])).', ';
}
}
$prv['i']++;
}
$prv['effx'] = rtrim($prv['inf'],', ');
}
//
if( $prv['effx'] != '' ) {
$prv['effx'] = ' ('.$prv['effx'].')';
}
//
$prv['color2'] = '000000';
$prv['text'] = $btl->addlt(1 , 19 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
$prv['text2'] = '{tm1} '.$prv['text'].'.'.$prv['effx'];
$btl->priemAddLog( $id, 1, 2, $u->info['id'], $this->ue['id'],
'<font color^^^^#'.$prv['color2'].'>Öåëü âîçäóõà'.$prv['x'].'</font>',
$prv['text2'],
($btl->hodID + 0)
);
//Äîáàâëÿåì ïðèåì
//$this->addEffPr($pl,$id);
//$this->addPriem($this->ue['id'],$pl['id'],'atgm='.floor($pvr['hp']/10).'',0,77,-1,$u->info['id'],5,'öåëüâîäû',0,0,1);
//Îòíèìàåì òàêòèêè
//$this->mintr($pl);
}else{
$cup = true;
echo '<font color=red><b>Íà ïåðîñíàæå äîñòèãíóòî ìàêñèàëüíîå êîëëè÷åñòâî öåëåé</b></font>';
}
unset($pvr);
?>
$cup = $this->magicTarget('air', $pl, $id, $btl);

View File

@ -101,11 +101,9 @@ if( isset($pr_momental_this)) {
//
//
//$priem->addPriem($u1,278,'|add_yzm3=-'.($btl->users[$btl->uids[$u2]]['level']).'',2,77,2,$u2,100,'èíåéêàñàíèå',0,0,1);
$pvr['x55'] = mysql_fetch_array(mysql_query('SELECT `id`,`x` FROM `eff_users` WHERE `uid` = "'.$u1.'" AND `v2` = 25 AND `delete` = 0 LIMIT 1'));
if( $pvr['x55']['x'] <1 ) {
$priem->addPriem($u1,25,-1,2,77,-1,$u2,5,'öåëüâîäû',0,0,1);
//$priem->addPriem($u1,25,'|add_zm3=-20',2,77,-1,$u2,100,'öåëüâîäû',0,0,1);
if( $pvr['used'] == 0 ) {
$at['p'][$a]['atack'][$j]['yron']['plog'][] = '$this->priemAddLog( '.$id.', '.$b.', '.$a.', '.$u2.', '.$u1.',
"<font color^^^^#'.$prv['color2'].'>Öåëü Âîäû</font>",

View File

@ -145,8 +145,6 @@ if( isset($pr_momental_this)) {
}*/
//}
//
//$priem->addPriem($u1,279,'|add_yzm3=-'.floor($btl->users[$btl->uids[$u2]]['level']*1.25).'',2,77,2,$u2,100,'číĺéęŕńŕíčĺ',0,0,1);
//$priem->addPriem($u1,278,'|add_yzm3=-'.($btl->users[$btl->uids[$u2]]['level']).'',2,77,2,$u2,100,'číĺéęŕńŕíčĺ',0,0,1);
$pvr['x5'] = mysql_fetch_array(mysql_query('SELECT `id`,`x` FROM `eff_users` WHERE `uid` = "'.$u1.'" AND `v2` = 25 AND `delete` = 0 LIMIT 1'));
if( $pvr['x5']['x'] < 5 ) {
$priem->addPriem($u1,25,'|add_zm3=-20',2,77,-1,$u2,100,'öåëüâîäû',0,0,1);

View File

@ -1,76 +1,14 @@
<?
if(!defined('GAME')) {
die();
}
/*
Ïðèåì: Öåëü âîäû
<?php
/**
* Ïðèåì: Öåëü {ñòèõèÿ}
* @var $this Priems
* @var $btl Battle
* @var $id
* @var $pl
*/
$pvr = array();
$pvr['x5'] = mysql_fetch_array(mysql_query('SELECT `id`,`x` FROM `eff_users` WHERE `uid` = "'.$this->ue['id'].'" AND `v2` = 28 AND `delete` = 0 LIMIT 1'));
if( $pvr['x5']['x'] < 5 ) {
$prv['x'] = '';
if( $pvr['x5']['x'] > 0 ) {
$prv['x'] = ' x'.($pvr['x5']['x']+1).'';
if (!$id) {
exit();
}
//
$this->addEffPr($pl,$id);
//
$prv['effx'] = '';
if( $pvr['x5']['x'] > 0 ) {
$prv['eff'] = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id` = "'.$pvr['x5']['id'].'" LIMIT 1'));
if( isset($prv['eff']['id']) ) {
//Ðàçáèðàåì äàòó $prv['eff']['data']
$prv['eda'] = $prv['eff']['data'];
}
}else{
//Ðàçáèðàåì äàòó $pl['date3']
$prv['eda'] = $pl['date3'];
}
//
if( isset($prv['eda']) ) {
$prv['d'] = $u->lookStats($prv['eda']);
$prv['j'] = $u->lookStats($this->redate($prv['eda'],$u->info['id']));
$prv['v'] = $u->lookKeys($this->redate($prv['eda'],$u->info['id']),0); // êëþ÷è 2
$prv['i'] = 0; $prv['inf'] = '';
while($prv['i']<count($prv['v'])) {
//$prv['j'][$prv['v'][$prv['i']]] += $prv['j'][$prv['v'][$prv['i']]];
$prv['vi'] = str_replace('add_','',$prv['v'][$prv['i']]);
if($u->is[$prv['vi']]!='') {
if($prv['j'][$prv['v'][$prv['i']]]>0) {
$prv['inf'] .= $u->is[$prv['vi']].': +'.($prv['j'][$prv['v'][$prv['i']]]*(1+$pvr['x5']['x'])).', ';
}elseif($prv['j'][$prv['v'][$prv['i']]]<0){
$prv['inf'] .= $u->is[$prv['vi']].': '.($prv['j'][$prv['v'][$prv['i']]]*(1+$prv['x5']['x'])).', ';
}
}
$prv['i']++;
}
$prv['effx'] = rtrim($prv['inf'],', ');
}
//
if( $prv['effx'] != '' ) {
$prv['effx'] = ' ('.$prv['effx'].')';
}
//
$prv['color2'] = '000000';
$prv['text'] = $btl->addlt(1 , 19 , $btl->users[$btl->uids[$u->info['id']]]['sex'] , NULL);
$prv['text2'] = '{tm1} '.$prv['text'].'.'.$prv['effx'];
$btl->priemAddLog( $id, 1, 2, $u->info['id'], $this->ue['id'],
'<font color^^^^#'.$prv['color2'].'>Öåëü çåìëè'.$prv['x'].'</font>',
$prv['text2'],
($btl->hodID + 0)
);
//Äîáàâëÿåì ïðèåì
//$this->addEffPr($pl,$id);
//$this->addPriem($this->ue['id'],$pl['id'],'atgm='.floor($pvr['hp']/10).'',0,77,-1,$u->info['id'],5,'öåëüâîäû',0,0,1);
//Îòíèìàåì òàêòèêè
//$this->mintr($pl);
}else{
$cup = true;
echo '<font color=red><b>Íà ïåðîñíàæå äîñòèãíóòî ìàêñèàëüíîå êîëëè÷åñòâî öåëåé</b></font>';
}
unset($pvr);
?>
$cup = $this->magicTarget('earth', $pl, $id, $btl);

Some files were not shown because too many files have changed in this diff Show More