diff --git a/_incl_data/class/Achievements.php b/_incl_data/class/Achievements.php new file mode 100644 index 00000000..71102dd4 --- /dev/null +++ b/_incl_data/class/Achievements.php @@ -0,0 +1,226 @@ + [ + 'questname' => 'Ежедн.Задания', + 'quest' => 'Выполнить задания бабки.', + 'check' => ['Заданий', 5, 25, 50, 100, 250], + 'prize' => ['Жетон
успеха
', 5, 20, 40, 60, 100], + 'startlink' => 11 + ], + 'vx' => [ + 'questname' => 'Хаотические бои', + 'quest' => 'Победить в хаотических боях.', + 'check' => ['Побед', 50, 300, 400, 500, 1000], + 'prize' => ['екр.', 25, 50, 75, 100, 200], + 'startlink' => 21 + ], + 'snt' => [ + 'questname' => 'Сундук трупожора', + 'quest' => 'Открыть сундук трупожора.', + 'check' => ['Открытий', 5, 25, 50, 100, 250], + 'prize' => ['екр.', 10, 25, 50, 75, 200], + 'startlink' => 31 + ], + 'rp' => [ + 'questname' => 'Руны 8 лвл.', + 'quest' => 'Получить руну при плавке плохих заготовок. [S]', + 'check' => ['Рун', 5, 10, 25, 50, 100], + 'prize' => ['Плохие
заготовки
', 5, 7, 10, 12, 15], + 'startlink' => 41 + ], + 'rn' => [ + 'questname' => 'Руны 9 лвл.', + 'quest' => 'Получить руну при плавке нормальных заготовок. [M]', + 'check' => ['Рун', 5, 10, 15, 25, 50], + 'prize' => ['Нормальные
заготовки
', 5, 7, 9, 12, 15], + 'startlink' => 51 + ], + 'rb' => [ + 'questname' => 'Руны 10 лвл.', + 'quest' => 'Получить руну при плавке идеальных заготовок. [L]', + 'check' => ['Рун', 2, 5, 8, 11, 15], + 'prize' => ['Идеальные
заготовки
', 2, 4, 6, 10, 15], + 'startlink' => 61 + ], + 'pg' => [ + 'questname' => 'Героич. Сражения', + 'quest' => 'Поучаствовать в героическом сражении.', + 'check' => ['Участий', 100, 200, 400, 600, 1000], + 'prize' => ['Жетон
успеха
', 10, 20, 40, 60, 80], + 'startlink' => 71 + ], + 'bv' => [ + 'questname' => 'Продажи Бабушке', + 'quest' => 'Продать бабушке найденные вещи в пещере.', + 'check' => ['Продаж', 5, 25, 50, 100, 250], + 'prize' => ['кр.', 500, 1000, 2000, 4000, 5000], + 'startlink' => 81 + ], + 'kw' => [ + 'questname' => 'Клан Поединки', + 'quest' => 'Победить в клановой войне.', + 'check' => ['Побед', 5, 10, 15, 20, 25], + 'prize' => ['Свиток
кланового
опыта ', 1, 2, 5, 10, 15], + 'startlink' => 91 + ], + 'pa' => [ # not implemented! + 'questname' => 'Покровительство', + 'quest' => 'Получить покровительство Ангела.', + 'check' => ['Получено', 5, 25, 50, 100, 250], + 'prize' => null, + 'startlink' => null + ], + 'bs' => [ + 'questname' => 'Башня смерти', + 'quest' => 'Победы в башне смерти.', + 'check' => ['Побед', 1, 5, 10, 50, 500], + 'prize' => ['екр.', 1, 5, 10, 50, 200], + 'startlink' => 101 + ], + 'trn' => [ # not implemented! + 'questname' => null, + 'quest' => 'Победы в турнирах.', + 'check' => ['Побед', 25, 50, 100, 200, 500], + 'prize' => ['екр.', 25, 25, 25, 25, 50], + 'startlink' => 111 + ], + ]; + + public function __construct(user $user) + { + $this->user = $user; + $this->info = Db::getRow('select * from users_achiv where id = ?', [$user->info['id']]); + } + + private function prizeName($int, $string) + { + return in_array($string, ['екр.', 'кр.']) ? $int . ' ' . $string : $string . ' ' . $int; + } + + private function drawSunduk($nagr, $whatInside, $tier) + { + return vsprintf('Сундук', + [ + "location.href='\main.php?titul&nagr=$nagr'", + "top.hi(this, 'Сундук $tier ранга
Содержит:
$whatInside
', event, 2, 0, 1, 1, 'max-width:307px')", + "top.hic();", + "top.hic();", + "https://img.new-combats.com/i/titul/nagr$tier.gif" + ]); + } + + public function getList() + { + $string = ''; + $this->calculateCurrent(1); + + foreach ($this->data as $key => $value) { + //Бля, какую херню приходится городить! + //Первое число = требование следующего тира минус требование текущего тира (надо набрать) + //Второе число = количество достижений минус требование текущего тира (набрал) + //Требования текущего тира отнимаются чтобы каждый тир начинал считать процент с 0. + //Пизды дать тому, кто так уебански называет переменные, что нужно полдня въезжать что происходит. + //И хер поменяешь - всё сломается. FFUUUUUUUUUUUUUU!!! Ins. + $percentToSuccess = Math::get100Percentage( + $value['check'][$this->info['klas' . $key] + 1] - $value['check'][$this->info['klas' . $key]], + $this->info[$key] - $value['check'][$this->info['klas' . $key]] + ); + //klas$name динамически рассчитыватся исходя из $name в базе + $string .= '

' . empty($value['questname']) ? $value['quest'] : $value['questname'] . '

'; + $string .= '' . $value['quest'] . '
'; + $string .= 'Текущий Ранг: ' . $this->info['klas' . $key] . ' '; + $string .= 'Количество ' . mb_strtolower($value['check'][0]) . ': ' . $this->info[$key] . ' =' . $percentToSuccess . '%'; + + $string .= Table::get([ + ['Ранги', 1, 2, 3, 4, 5], + $value['check'], + [ + 'Награда', + $this->prizeName($value['prize'][1], $value['prize'][0]), + $this->prizeName($value['prize'][2], $value['prize'][0]), + $this->prizeName($value['prize'][3], $value['prize'][0]), + $this->prizeName($value['prize'][4], $value['prize'][0]), + $this->prizeName($value['prize'][5], $value['prize'][0]) + ] + ], 'prizelist', true); + # If has new tier, AND only first 5 tiers AND prize is set. + if ( + $this->info['klas' . $key] > $this->info[$key . '_n'] && + in_array($this->info[$key . '_n'], [0, 1, 2, 3, 4]) && + !empty($value['prize']) && + !empty($value['startlink']) + ) { + $string .= '
Награда:
'; + $string .= $this->drawSunduk( + $this->info[$key . '_n'] + $value['startlink'], + $this->prizeName($value['prize'][$this->info[$key . '_n'] + 1], $value['prize'][0]), + $this->info[$key . '_n'] + 1 + ); + } + $string .= '
'; + } + return $string; + } + + private function calculateCurrent($check = null) + { + $this->info['bs'] = $this->user->info['win_bs']; + foreach ($this->info as $k => $v) { + if (empty($this->info[$k]) && is_null($check)) { + continue; + } + $this->info["klas$k"] = 0; + for ($i = 1; $i <= 5; $i++) { + if ($this->info[$k] >= $this->data[$k]['check'][$i]) { + $this->info["klas$k"] = $i; + } + } + } + } + + public function getInfo() + { + $this->calculateCurrent(); + return $this->info; + } + + public function getCheckedInfo() + { + $this->calculateCurrent(1); + return $this->info; + } + + public function updateTier($name) + { + Db::sql("update users_achiv set $name = $name + 1 where id = ?", [$this->user->info['id']]); + } + + /** + * @return array[] + */ + public function getData() + { + return $this->data; + } + + public function hasNoTier4Access($nagr) + { + return $this->user->info['level'] < 9 && in_array($nagr, [14, 15, 24, 25, 34, 35, 44, 45, 54, 55, 64, 65, 74, 75, 84, 85, 94, 95, 104, 105]); + } + + public function givePrizeItems($itemId, $aType) + { + for ($i = 1; $i <= $this->data[$aType]['prize'][$this->info[$aType . '_n'] + 1]; $i++) { + $this->user->addItem($itemId, $this->user->info['id']); + } + } +} \ No newline at end of file diff --git a/_incl_data/class/Insallah/Core/Math.php b/_incl_data/class/Insallah/Core/Math.php new file mode 100644 index 00000000..f9279129 --- /dev/null +++ b/_incl_data/class/Insallah/Core/Math.php @@ -0,0 +1,17 @@ + 0 ? round(($number * 100) / $total, 2) : 0; + } + + public static function get100Percentage($total, $number) + { + return min(self::getPercentage($total, $number), 100); + } +} \ No newline at end of file diff --git a/_incl_data/class/Insallah/Core/Table.php b/_incl_data/class/Insallah/Core/Table.php new file mode 100644 index 00000000..b704f81a --- /dev/null +++ b/_incl_data/class/Insallah/Core/Table.php @@ -0,0 +1,22 @@ +' . implode('', $row) . ''; + } + + return (!empty($class) ? "" : '
') . $c . '
' . PHP_EOL; + } +} \ No newline at end of file diff --git a/_incl_data/class/__user.php b/_incl_data/class/__user.php index d47c9e83..3f7e0ea8 100644 --- a/_incl_data/class/__user.php +++ b/_incl_data/class/__user.php @@ -1,4 +1,7 @@ true, // + 310 => true, //Снадобье Забытых Мастеров - 33 => true, // - 34 => true, // - 35 => true, // + 33 => true, //Звездная Энергия + 34 => true, //Звездная Тяжесть + 35 => true, //Звездная Сияние - 42 => true, // - 43 => true, // + 42 => true, //Неуязвимость Оружию + 43 => true, //Неуязвимость Стихиям 296 => true ]; public $aves = ['now' => 0, 'max' => 0], $rep, $tfer, $error2 = '', $room = [], $bank = [], $align_nm = [ - 1 => '', - 2 => '', - 3 => '', - 7 => '' + 1 => 'Свет', + 2 => 'Хаос', + 3 => 'Тьма', + 7 => 'Нейтралитет' ], $mod_nm = [ 0 => [0 => ''], - 1 => ['1' => '', '1.1' => ' ', '1.4' => ' ', '1.5' => ' ', '1.6' => '', '1.7' => ' ', '1.75' => '-', '1.9' => ' ', '1.91' => ' ', '1.92' => ' ', '1.99' => ' '], - 3 => ['3' => '', '3.01' => '-', '3.05' => '-', '3.06' => '', '3.07' => '-', '3.075' => '-', '3.09' => '-', '3.091' => '-', '3.092' => ' ', '3.99' => ' '] + 1 => ['1' => 'Свет', '1.1' => 'Паладин Поднебесья', '1.4' => 'Таможенный Паладин', '1.5' => 'Паладин Солнечной Улыбки', '1.6' => 'Инквизитор', '1.7' => 'Паладин Огненной Зари', '1.75' => 'Паладин-Хранитель', '1.9' => 'Паладин Неба', '1.91' => 'Старший Паладин Неба', '1.92' => 'Ветеран Ордена', '1.99' => 'Верховный Паладин'], + 3 => ['3' => 'Тьма', '3.01' => 'Тарман-Служитель', '3.05' => 'Тарман-Надсмотрщик', '3.06' => 'Каратель', '3.07' => 'Тарман-Убийца', '3.075' => 'Тарман-Хранитель', '3.09' => 'Тарман-Палач', '3.091' => 'Тарман-Владыка', '3.092' => 'Ветеран Армады', '3.99' => 'Тарман Патриарх'] ]; public $btl_txt = '', $rgd = [0 => 0, 1 => 0], $error = '', @@ -54,13 +57,13 @@ class user $city_name2 = ['emeraldscity' => 'Emeraldscity', 'abandonedplain' => 'Abandonedplain', 'capitalcity' => 'Capitalcity', 'angelscity' => 'Angelscity', 'newcapitalcity' => 'Newcapitalcity', 'demonscity' => 'Demonscity', 'fallenearth' => 'FallenEarth', 'dreamscity' => 'Dreams City', 'suncity' => 'Sun City', 'devilscity' => 'Devils City'], $stats, $info, $map, $mapUsers, $is = [ - 'acestar' => ' ', 'spasenie' => ' ', 'more_awards' => ' %', 'exp' => ' (%)', 'align_bs' => ' ', - 'nopryh' => ' ', 'puti' => ' ', 'align' => '', 'hpAll' => ' (HP)', 'mpAll' => ' (P)', 'enAll' => ' ', 'sex' => '', 'lvl' => '', 's1' => '', 's2' => '', 's3' => '', 's4' => '', 's5' => '', 's6' => '', 's7' => '', 's8' => '', 's9' => ' ', 's10' => '', 's11' => '', 'm1' => '. (%)', 'm2' => '. (%)', 'm3' => '. . (%)', 'm21' => '. . (%)', 'm4' => '. (%)', 'm5' => '. (%)', 'm6' => '. (%)', 'm7' => '. (%)', 'm8' => '. (%)', 'm9' => '. (%)', 'm14' => '. . (%)', 'm15' => '. . (%)', 'm16' => '. . (%)', 'm17' => '. . (%)', 'm18' => '. . (%)', 'm19' => '. . (%)', 'm20' => '. (%)', 'a1' => ' , ', 'a2' => ' , ', 'a3' => ' , ', 'a4' => ' ', 'a5' => ' ', 'a6' => ' ', 'a7' => ' ', 'aall' => ' ', 'mall' => ' ', 'm2all' => ' ', 'mg1' => ' ', 'mg2' => ' ', 'mg3' => ' ', 'mg4' => ' ', 'mg5' => ' ', 'mg6' => ' ', 'mg7' => ' ', 'tj' => ' ', 'lh' => ' ', 'minAtack' => ' ', 'maxAtack' => ' ', 'm10' => '. ', 'm11' => '. ', 'm11a' => '. ', 'pa1' => '. ', 'pa2' => '. ', 'pa3' => '. ', 'pa4' => '. ', 'pm1' => '. ', 'pm2' => '. ', 'pm3' => '. ', 'pm4' => '. ', 'pm5' => '. ', 'pm6' => '. ', 'pm7' => '. ', 'za' => ' ', 'zm' => ' ', 'zma' => ' ', 'za1' => ' ', 'za2' => ' ', 'za3' => ' ', 'za4' => ' ', 'zm1' => ' ', 'zm2' => ' ', 'zm3' => ' ', 'zm4' => ' ', 'zm5' => ' ', 'zm6' => ' ', 'zm7' => ' ', 'magic_cast' => ' ', 'pza' => ' ', 'pzm' => ' ', 'pza1' => ' ', 'min_heal_proc' => ' (%)', 'notravma' => ' ', 'yron_min' => ' ', 'yron_max' => ' ', 'zaproc' => ' (%)', 'zmproc' => ' (%)', 'zm2proc' => ' (%)', 'pza2' => ' ', 'pza3' => ' ', 'pza4' => ' ', 'pzm1' => ' ', 'pzm2' => ' ', 'pzm3' => ' ', 'pzm4' => ' ', 'pzm5' => ' ', 'pzm6' => ' ', 'pzm7' => ' ', 'speedhp' => ' (%)', 'speedmp' => ' (%)', 'tya1' => ' ', 'tya2' => ' ', 'tya3' => ' ', 'tya4' => ' ', 'tym1' => ' ', 'mg2static_points' => ' ()', 'tym2' => ' ', 'tym3' => ' ', 'tym4' => ' ', 'hpProc' => ' (%)', 'mpProc' => ' (%)', 'tym5' => ' ', 'tym6' => ' ', 'tym7' => ' ', 'min_use_mp' => ' ', 'pog' => ' ', 'pog2' => ' ', 'pog2p' => ' ', 'pog2mp' => ' ', 'maxves' => ' ', 'bonusexp' => ' ', 'speeden' => ' (%)', - 'antm3' => '. ', 'repair_z' => ' ', 'repair_r' => ' ', - 'yza' => ' (%)', 'yzm' => ' (%)', 'yzma' => ' (%)' - , 'yza1' => ' (%)', 'yza2' => ' (%)', 'yza3' => ' (%)', 'yza4' => ' (%)' - , 'yzm1' => ' (%)', 'yzm2' => ' (%)', 'yzm3' => ' (%)', 'yzm4' => ' (%)', 'yzm5' => ' (%)', 'yzm6' => ' (%)', 'yzm7' => ' (%)', 'rep' => ' ' - , 'repair_discount' => ' ', 'hpVinos' => ' ', 'bronze' => 'Bronze Premium Account', 'silvers' => 'Silver Premium Account', 'gold' => ' ', 'speed_dungeon' => ' ', 'zona' => ' ' + 'acestar' => 'Следующий каст будет критическим', 'spasenie' => 'Спасение после смерти', 'more_awards' => 'Повышеная награда %', 'exp' => 'Получаемый опыт (%)', 'align_bs' => 'Служитель закона', + 'nopryh' => 'Прямое поподание', 'puti' => 'Запрет перемещения', 'align' => 'Склонность', 'hpAll' => 'Уровень жизни (HP)', 'mpAll' => 'Уровень маны (МP)', 'enAll' => 'Уровень энергии', 'sex' => 'Пол', 'lvl' => 'Уровень', 's1' => 'Сила', 's2' => 'Ловкость', 's3' => 'Интуиция', 's4' => 'Выносливость', 's5' => 'Интеллект', 's6' => 'Мудрость', 's7' => 'Духовность', 's8' => 'Воля', 's9' => 'Свобода духа', 's10' => 'Божественность', 's11' => 'Энергия', 'm1' => 'Мф. критического удара (%)', 'm2' => 'Мф. против критического удара (%)', 'm3' => 'Мф. мощности крит. удара (%)', 'm21' => 'Мф. абс. попадания (%)', 'm4' => 'Мф. увертывания (%)', 'm5' => 'Мф. против увертывания (%)', 'm6' => 'Мф. контрудара (%)', 'm7' => 'Мф. парирования (%)', 'm8' => 'Мф. блока щитом (%)', 'm9' => 'Мф. удара сквозь броню (%)', 'm14' => 'Мф. абс. критического удара (%)', 'm15' => 'Мф. абс. увертывания (%)', 'm16' => 'Мф. абс. парирования (%)', 'm17' => 'Мф. абс. контрудара (%)', 'm18' => 'Мф. абс. блока щитом (%)', 'm19' => 'Мф. абс. магический промах (%)', 'm20' => 'Мф. удача (%)', 'a1' => 'Мастерство владения ножами, кинжалами', 'a2' => 'Мастерство владения топорами, секирами', 'a3' => 'Мастерство владения дубинами, молотами', 'a4' => 'Мастерство владения мечами', 'a5' => 'Мастерство владения магическими посохами', 'a6' => 'Мастерство владения луками', 'a7' => 'Мастерство владения арбалетами', 'aall' => 'Мастерство владения оружием', 'mall' => 'Мастерство владения магией стихий', 'm2all' => 'Мастерство владения магией', 'mg1' => 'Мастерство владения магией огня', 'mg2' => 'Мастерство владения магией воздуха', 'mg3' => 'Мастерство владения магией воды', 'mg4' => 'Мастерство владения магией земли', 'mg5' => 'Мастерство владения магией Света', 'mg6' => 'Мастерство владения магией Тьмы', 'mg7' => 'Мастерство владения серой магией', 'tj' => 'Тяжелая броня', 'lh' => 'Легкая броня', 'minAtack' => 'Минимальный урон', 'maxAtack' => 'Максимальный урон', 'm10' => 'Мф. мощности урона', 'm11' => 'Мф. мощности магии стихий', 'm11a' => 'Мф. мощности магии', 'pa1' => 'Мф. мощности колющего урона', 'pa2' => 'Мф. мощности рубящего урона', 'pa3' => 'Мф. мощности дробящего урона', 'pa4' => 'Мф. мощности режущего урона', 'pm1' => 'Мф. мощности магии огня', 'pm2' => 'Мф. мощности магии воздуха', 'pm3' => 'Мф. мощности магии воды', 'pm4' => 'Мф. мощности магии земли', 'pm5' => 'Мф. мощности магии Света', 'pm6' => 'Мф. мощности магии Тьмы', 'pm7' => 'Мф. мощности серой магии', 'za' => 'Защита от урона', 'zm' => 'Защита от магии стихий', 'zma' => 'Защита от магии', 'za1' => 'Защита от колющего урона', 'za2' => 'Защита от рубящего урона', 'za3' => 'Защита от дробящего урона', 'za4' => 'Защита от режущего урона', 'zm1' => 'Защита от магии огня', 'zm2' => 'Защита от магии воздуха', 'zm3' => 'Защита от магии воды', 'zm4' => 'Защита от магии земли', 'zm5' => 'Защита от магии Света', 'zm6' => 'Защита от магии Тьмы', 'zm7' => 'Защита от серой магии', 'magic_cast' => 'Дополнительный каст за ход', 'pza' => 'Понижение защиты от урона', 'pzm' => 'Понижение защиты от магии', 'pza1' => 'Понижение защиты от колющего урона', 'min_heal_proc' => 'Эффект лечения (%)', 'notravma' => 'Защита от травм', 'yron_min' => 'Минимальный урон', 'yron_max' => 'Максимальный урон', 'zaproc' => 'Блокировка Физического Урона (%)', 'zmproc' => 'Блокировка Магического Урона (%)', 'zm2proc' => 'Защита от магии Воздуха (%)', 'pza2' => 'Понижение защиты от рубящего урона', 'pza3' => 'Понижение защиты от дробящего урона', 'pza4' => 'Понижение защиты от режущего урона', 'pzm1' => 'Понижение защиты от магии огня', 'pzm2' => 'Понижение защиты от магии воздуха', 'pzm3' => 'Понижение защиты от магии воды', 'pzm4' => 'Понижение защиты от магии земли', 'pzm5' => 'Понижение защиты от магии Света', 'pzm6' => 'Понижение защиты от магии Тьмы', 'pzm7' => 'Понижение защиты от серой магии', 'speedhp' => 'Регенерация здоровья (%)', 'speedmp' => 'Регенерация маны (%)', 'tya1' => 'Колющие атаки', 'tya2' => 'Рубящие атаки', 'tya3' => 'Дробящие атаки', 'tya4' => 'Режущие атаки', 'tym1' => 'Огненные атаки', 'mg2static_points' => 'Уровень заряда (Воздух)', 'tym2' => 'Электрические атаки', 'tym3' => 'Ледяные атаки', 'tym4' => 'Земляные атаки', 'hpProc' => 'Уровень жизни (%)', 'mpProc' => 'Уровень маны (%)', 'tym5' => 'Атаки Света', 'tym6' => 'Атаки Тьмы', 'tym7' => 'Серые атаки', 'min_use_mp' => 'Уменьшает расход маны', 'pog' => 'Поглощение урона', 'pog2' => 'Поглощение урона', 'pog2p' => 'Процент поглощение урона', 'pog2mp' => 'Цена поглощение урона', 'maxves' => 'Увеличивает рюкзак', 'bonusexp' => 'Увеличивает получаемый опыт', 'speeden' => 'Регенерация энергии (%)', + 'antm3' => 'Мф. против мощности крита', 'repair_z' => 'Бесплатное извлечение заточек', 'repair_r' => 'Бесплатное извлечение рун', + 'yza' => 'Уязвимость физическому урона (%)', 'yzm' => 'Уязвимость магии стихий (%)', 'yzma' => 'Уязвимость магии (%)' + , 'yza1' => 'Уязвимость колющему урона (%)', 'yza2' => 'Уязвимость рубящему урона (%)', 'yza3' => 'Уязвимость дробящему урона (%)', 'yza4' => 'Уязвимость режущему урона (%)' + , 'yzm1' => 'Уязвимость магии огня (%)', 'yzm2' => 'Уязвимость магии воздуха (%)', 'yzm3' => 'Уязвимость магии воды (%)', 'yzm4' => 'Уязвимость магии земли (%)', 'yzm5' => 'Уязвимость магии (%)', 'yzm6' => 'Уязвимость магии (%)', 'yzm7' => 'Уязвимость магии (%)', 'rep' => 'Репутация Рыцаря' + , 'repair_discount' => 'Скидка на ремонт вещей', 'hpVinos' => 'Бонус жизни', 'bronze' => 'Bronze Premium Account', 'silvers' => 'Silver Premium Account', 'gold' => 'Благодать Ангела', 'speed_dungeon' => 'Скорость передвижения по подземельям', 'zona' => 'Дополнительная зона атаки' ]; public $items = [ 'tr' => ['sex', 'align', 'lvl', 's1', 's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9', 's10', 's11', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'mg1', 'mg2', 'mg3', 'mg4', 'mg5', 'mg6', 'mg7', 'mall', 'm2all', 'aall', 'rep', 'align_bs'], @@ -72,7 +75,7 @@ class user ]; /* - yrnhealmpprocmg3 - , % ( ) + yrnhealmpprocmg3 - восставнавливает ману от урона по игроку, в % (магия воды) */ public function sys_add($uid, $time, $type, $text, $data, $time_see) @@ -95,20 +98,20 @@ class user $test = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $id . '" AND `vars`= "day_quest" LIMIT 1')); $q = [ - '1' => ' ', - '2' => ' ', - '3' => ' ', - '4' => ' 100 000 ', - '5' => ' ', - '6' => ' ', - '7' => ' 3 ', - '8' => ' ' + '1' => 'Убийство Трупожоров', + '2' => 'Победы в хаотических боях', + '3' => 'Спуск в Подземелия', + '4' => 'Набрать в хаотических поединках 100 000 Опыта', + '5' => 'Открыть Сундук Трупожора', + '6' => 'Посетить Излом Хаоса', + '7' => 'Сдача 3 заданий в пещерах', + '8' => 'Поучаствовать в Башне Смерти' ]; if (!isset($test['id'])) { - $n = " "; + $n = "Получить задание"; } else { - $n = " "; + $n = "Сдать задание"; $n = $n . "
" . $q[$test['vals']] . ""; } @@ -125,7 +128,7 @@ class user } elseif (date('w') == 0 || date('w') == 6) { $r = round($r * 2, 2); } - $r = $r . ' .'; + $r = $r . ' ЕКР.'; } else { $r = $this->info['level']; if (date('m') >= 6 || date('m') <= 8) { @@ -133,7 +136,7 @@ class user } elseif (date('w') == 0 || date('w') == 6) { $r = round($r * 2, 2); } - $r = $r . ' .'; + $r = $r . ' КР.'; } } else { if (($this->info['align'] > 0 || $this->info['clan'] > 0 || $this->info['level'] > 12) && $this->info['align'] != 2) { @@ -178,19 +181,19 @@ class user $r = ''; // if ($this->info['clan'] > 0) { - // + //Нельзя использовать персонажам в клане } elseif ($type == 'test') { - if ($this->room['name'] == ' ' || $this->room['name'] == ' ' || $this->room['name'] == ' ') { + if ($this->room['name'] == 'Зал Света' || $this->room['name'] == 'Зал Нейтралов' || $this->room['name'] == 'Зал Тьмы') { if (isset($_GET['vhp'])) { $v = mysql_fetch_array(mysql_query('SELECT * FROM "vortex" WHERE "uid" = "' . $this->info['id'] . '" AND "type" = 1 ORDER BY "time" DESC LIMIT 1')); if (isset($v['id']) && $v['time'] > time() - 60 * 60) { - // - $this->error = ' ' . $this->timeOut($v['time'] + 60 * 60 - time()); + //Уже юзали + $this->error = 'Необходимо подождать еще ' . $this->timeOut($v['time'] + 60 * 60 - time()); } else { if ($this->stats['hpNow'] < 1) { $this->stats['hpNow'] = 0; } - $this->error = ' ' . round($this->stats['hpAll'] - $this->stats['hpNow']) . ' HP.'; + $this->error = 'Вы успешно восстановили ' . round($this->stats['hpAll'] - $this->stats['hpNow']) . ' HP.'; mysql_query('INSERT INTO `vortex` ( `uid`,`time`,`room`,`val`,`type` ) VALUES ( "' . $this->info['id'] . '","' . time() . '","' . $this->info['room'] . '","' . round($this->stats['hpAll'] - $this->stats['hpNow']) . '","1" )'); @@ -200,13 +203,13 @@ class user } elseif (isset($_GET['vmp'])) { $v = mysql_fetch_array(mysql_query('SELECT * FROM "vortex" WHERE "uid" = "' . $this->info['id'] . '" AND "type" = 2 ORDER BY "time" DESC LIMIT 1')); if (isset($v['id']) && $v['time'] > time() - 60 * 60) { - // - $this->error = ' ' . $this->timeOut($v['time'] + 60 * 60 - time()); + //Уже юзали + $this->error = 'Необходимо подождать еще ' . $this->timeOut($v['time'] + 60 * 60 - time()); } else { if ($this->stats['mpNow'] < 1) { $this->stats['mpNow'] = 0; } - $this->error = ' ' . round($this->stats['mpAll'] - $this->stats['mpNow']) . ' MP.'; + $this->error = 'Вы успешно восстановили ' . round($this->stats['mpAll'] - $this->stats['mpNow']) . ' MP.'; mysql_query('INSERT INTO `vortex` ( `uid`,`time`,`room`,`val`,`type` ) VALUES ( "' . $this->info['id'] . '","' . time() . '","' . $this->info['room'] . '","' . round($this->stats['mpAll'] - $this->stats['mpNow']) . '","2" )'); @@ -217,28 +220,28 @@ class user } } elseif ($type == 'look') { // - if ($this->room['name'] == ' ' || $this->room['name'] == ' ' || $this->room['name'] == ' ') { + if ($this->room['name'] == 'Зал Света' || $this->room['name'] == 'Зал Тьмы' || $this->room['name'] == 'Зал Нейтралов') { $vid = 0; // - if ($this->room['name'] == ' ') { + if ($this->room['name'] == 'Зал Света') { $vid = 6; - } elseif ($this->room['name'] == ' ') { + } elseif ($this->room['name'] == 'Зал Тьмы') { $vid = 7; - } elseif ($this->room['name'] == ' ') { + } elseif ($this->room['name'] == 'Зал Нейтралов') { $vid = 10; } // $v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "' . $this->info['id'] . '" AND `type` = 1 ORDER BY `time` DESC LIMIT 1')); if (isset($v['id']) && $v['time'] + 60 * 60 > time()) { - $r .= ' '; + $r .= ' '; } else { - $r .= ' '; + $r .= ' '; } $v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "' . $this->info['id'] . '" AND `type` = 2 ORDER BY `time` DESC LIMIT 1')); if (isset($v['id']) && $v['time'] + 60 * 60 > time()) { - $r .= ' '; + $r .= ' '; } else { - $r .= ' '; + $r .= ' '; } } // @@ -305,7 +308,7 @@ class user return $val; } - // + //Удаление определенного типа предметов public function deleteItemID($id, $uid, $coldel) { $sp = mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "' . mysql_real_escape_string($id) . '" AND `uid` = "' . mysql_real_escape_string($uid) . '" AND (`delete` = 0 OR `delete` = 1000) ORDER BY `inGroup` DESC LIMIT ' . $coldel); @@ -340,15 +343,15 @@ class user public function repobmen($id, $type) { - //echo ''; + //echo 'обмен'; $pl = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "' . ((int)$id) . '" LIMIT 1;')); $d = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "' . $pl['item_id'] . '" LIMIT 1')); $po = $this->lookStats($pl['data']); //echo $po['dungeon'].' '.$po['tr_lvl']; if ((!isset($po['frompisher']) or $po['tr_lvl'] < 4) and $pl['type'] != 31) { - $e = ' .'; + $e = 'Не удалось обменять предмет на репутацию.'; } else { - $e = ' "' . $pl['name'] . '" apitalcity .'; + $e = 'Обмен предмета "' . $pl['name'] . '" на репутацию Сapitalcity прошел удачно.'; mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); $this->rep['repcapitalcity'] += 1; mysql_query('UPDATE `rep` SET `repcapitalcity` = "' . $this->rep['repcapitalcity'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); @@ -364,33 +367,33 @@ class user $cache = ob_get_contents(); ob_end_clean (); - // + //Добавляем новый if($uid != '') { $uid_f = floor($uid/1000); }else{ $uid_f = '_m'; } - // + //Проверяем существование первой директории if(!is_dir($id.'~a/'.$uid_f.'/') ) { - // + //создаем mkdir($id.'~a/'.$uid_f.'/', 0700); } - // + //Проверяем существование второй директории if(!is_dir($id.'~a/'.$uid_f.'/'.$uid.'/') ) { - // + //создаем mkdir($id.'~a/'.$uid_f.'/'.$uid.'/', 0700); } $id = $id.'~a/'.$uid_f.'/'.$uid.'/'.$mod.'_'.md5($mod).'.cach'; - // + //Удаляем предыдущий экземпляр if(file_exists($id)) { $this->del_buf($id); } - // + //Создаем файл $fp = @fopen ($id, "w"); @fwrite($fp, $cache); @fclose($fp); @@ -404,7 +407,7 @@ class user public function del_buf($id, $uid = null, $mod = null) { /*if($uid != NULL && $mod != NULL) { - // + //генерируем ссылку if((int)$uid > 0 && $uid != '') { $uid_f = floor($uid/1000); }else{ @@ -421,7 +424,7 @@ class user { /*if(file_exists($id)) { if($uid != NULL && $mod != NULL) { - // + //генерируем ссылку if($uid != '') { $uid_f = floor($uid/1000); }else{ @@ -477,20 +480,20 @@ class user public function bsfinish($id, $bu, $di) { if ($bu == true) { - /* */ + /* в этом бою проверяем юзеров */ $i = 0; while ($i < count($bu[$i])) { if ($bu[$i]['lose'] > 0 || $bu[$i]['nich']) { mysql_query('UPDATE `users` SET `lose` = "' . $bu[$i]['lose'] . '", `nick` = "' . $bu[$i]['nich'] . '" WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1'); mysql_query('UPDATE `bs_turnirs` SET `users_finish` = `users_finish` + 1 WHERE `id` = "' . $id['id'] . '" LIMIT 1'); - /* */ + /* удаляем юзера */ if ($bu['inBot'] == 0) { $pls1 = mysql_fetch_array(mysql_query('SELECT `id`, `bsid`, `money`, `finish`, `time`, `inBot`, `uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `finish` = 0 AND `time` = "' . $id['time_start'] . '" AND `inBot` = "' . $bu[$i]['id'] . '" LIMIT 1')); if (isset($pls1['id'])) { mysql_query('DELETE FROM `users` WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1'); mysql_query('DELETE FROM `stats` WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1'); - // + //выкидываем предметы на землю $spi = mysql_query('SELECT `id`,`item_id` FROM `items_users` WHERE `uid` = "' . $bu[$i]['id'] . '" LIMIT 500'); $ins = ''; while ($pli = mysql_fetch_array($spi)) { @@ -518,7 +521,7 @@ class user $ub = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $ur['inUser'] . '" LIMIT 1')); if (isset($ur['id']) && isset($ub['id'])) { if ($ub['lose'] > 0 || $ub['nich'] > 0) { - // + //выкидываем из БС } else { $win = $ub; @@ -527,9 +530,9 @@ class user } } - /* */ + /* завершаем БС */ if (isset($win['id']) && $win['lose'] == 0 && $win['nich'] == 0 && $win['id'] > 0) { - // + //есть победитель $bsep = 0; if ($winr['level'] < 6) { $bsep = 2500; @@ -542,20 +545,20 @@ class user } else { $bsep = 50000; } - /* */ + /* Выдаем приз */ $mn = (round($id['money'] / 100 * 85)); mysql_query('UPDATE `users` SET `money` = `money` + "' . $mn . '" WHERE `id` = "' . $winr['id'] . '" LIMIT 1'); mysql_query('UPDATE `stats` SET `exp` = `exp` + "' . $bsep . '" WHERE `id` = "' . $winr['id'] . '" LIMIT 1'); - /* */ - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','" . $winr['login'] . "','! " "! : " . $bsep . ", : " . $mn . " .','-1','6','0')"); - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','! " ", : " . $winr['login'] . "! !','-1','5','0')"); - $this->addDelo(1, $uid, '"WinTournament.' . $this->info['city'] . '" ( ): "' . $mn . ' ."', time(), $this->info['city'], 'WinTournament.' . $this->info['city'] . '', 0, 0); + /* чат */ + mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','" . $winr['login'] . "','Поздравляем! Вы победили в турнире "Башня Смерти"! Получено опыта: " . $bsep . ", деньги: " . $mn . " кр.','-1','6','0')"); + mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','Внимание! Завершился турнир "Башня Смерти", победитель турнира: " . $winr['login'] . "! Поздравляем!','-1','5','0')"); + $this->addDelo(1, $uid, '"WinTournament.' . $this->info['city'] . '" (Башня Смерти): Получено "' . $mn . ' кр."', time(), $this->info['city'], 'WinTournament.' . $this->info['city'] . '', 0, 0); } else { - // - // + //нет победителя + //Выдаем травму - /* */ - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','! " ", : .','-1','5','0')"); + /* чат */ + mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','Внимание! Завершился турнир "Башня Смерти", победитель турнира: отсутствует.','-1','5','0')"); } $sp = mysql_query('SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `time` = "' . $id['time_start'] . '" ORDER BY `money` DESC LIMIT 100'); @@ -576,24 +579,22 @@ class user } } - // + //вес предметов у юзера public function ves($u) { $r = ['now' => 0, 'max' => 0]; if ($u == null) { - // + //текущий персонаж $r['now'] = mysql_fetch_array(mysql_query('SELECT SUM(`im`.`massa`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "' . $this->info['id'] . '" AND (`iu`.`delete` = "0" OR (`iu`.`delete` = "1000" AND `iu`.`inGroup` > 0)) AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0"')); $r['now'] = 0 + $r['now'][0]; @$r['max'] = 40 + ($this->stats['os7'] * 10) + $this->stats['s4'] + $this->stats['maxves'] + $this->stats['s1'] * 4; $r['items'] = mysql_fetch_array(mysql_query('SELECT COUNT(`im`.`id`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "' . $this->info['id'] . '" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0"')); $r['items'] = $r['items'][0]; - } else { - } return $r; } - // \ + //Переплавка вещей \ рун public function plavka($id, $type) { $e = ''; @@ -610,38 +611,38 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($po['tr_lvl'] < 4 && $pl['item_id'] != 1035) { - $e = ' 4- '; + $e = 'Предмет должен быть 4-го и выше уровня'; } elseif ($pl['type'] != 1 && $pl['type'] != 3 && $pl['type'] != 5 && $pl['type'] != 6 && $pl['type'] != 8 && $pl['type'] != 9 && $pl['type'] != 10 && $pl['type'] != 11 && $pl['type'] != 12 && $pl['type'] != 14 && $pl['type'] != 15 && $pl['type'] != 18 && $pl['type'] != 19 && $pl['type'] != 20 && $pl['type'] != 21 && $pl['type'] != 22 && $pl['type'] != 13 && $pl['item_id'] != 1035) { - $e = ' , ! ? ! - !'; + $e = 'Хрен вам, а не руны! Куда кидаешь предмет? Не подходит он! Приходи как будет что-то стоющее!'; } elseif ($po['tr_lvl'] >= 7 && $this->rep['rep1'] < 0)//100 { - $e = ' 7- '; + $e = 'Для растворения предметов 7-го и старше уровня требуется знак Храма Знаний первого круга'; } elseif ($po['tr_lvl'] >= 9 && $this->rep['rep1'] < 1000) { - $e = ' 9- '; + $e = 'Для растворения предметов 9-го и старше уровня требуется знак Храма Знаний второго круга'; } elseif ($po['tr_lvl'] >= 10 && $this->rep['rep1'] < 10000) { - $e = ' 10- '; + $e = 'Для растворения предметов 10-го и старше уровня требуется знак Храма Знаний третьего круга'; } elseif ($rn > 0) { if (isset($pl['id'], $d['id'])) { $pl['rep'] = 1; - // + //вероятность выпадения руны // mysql_query('UPDATE `rep` SET `rep1` = `rep1` + "'.$pl['rep'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1')); - $e = ' "' . $pl['name'] . '"! : +' . $pl['rep'] . ' .'; + $e = 'Удачно растворен предмет "' . $pl['name'] . '"! Получено репутации: +' . $pl['rep'] . ' ед.'; mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); $this->rep['rep1'] += $pl['rep']; mysql_query('UPDATE `rep` SET `rep1` = "' . $this->rep['rep1'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); } else { - $e = ' , ' . $pl['item_id'] . '...'; + $e = 'Предмет не найден, либо не подходит ' . $pl['item_id'] . '...'; } } else { - $e = ' , ...'; + $e = 'Не удалось переплавить, рецепты рун были потеряны ...'; } return $e; } - // + //Выводим вещи котоыре нужно отремонтировать public function info_remont() { $r = ''; @@ -651,20 +652,20 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid` = "' . ((int)$this->info['id']) . '" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` > "0" AND `iu`.`inOdet` < "18" LIMIT 18'); while ($pl = mysql_fetch_array($sp)) { if ($pl['iznosNOW'] > ceil($pl['iznosMAX'] * 0.80)) { - $r .= '' . $pl['name'] . ' [' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']) . ']
'; + $r .= '' . $pl['name'] . ' [' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']) . '] требуется ремонт
'; } } $r = '
' . $r . '
'; return $r; } - // + //Расчет урона от оружия public function weaponAtc($item, $st, $x) { $tp = 0; if (isset($item['id'])) { $itm = $this->lookStats($item['data']); - // + //начинаем расчет урона if (!isset($st['minAtack'])) { $st['minAtack'] = 0; } @@ -695,26 +696,26 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` //if($x!=0) //{ - // : 0 - , 1 - , 2 - , 3 - , 4 - , 5 - , 6 - , 7 - , 8 - , 9 - , 10 - , 11 - + //Тип урона: 0 - нет урона, 1 - колющий, 2 - рубящий, 3 - дробящий, 4 - режущий, 5 - огонь, 6 - воздух, 7 - вода, 8 - земля, 9 - свет, 10 - тьма, 11 - серая if ($item['type'] == 18) { - // + //колющий $sss = ceil($st['s2'] * 0.75); } elseif ($item['type'] == 19) { - // + //рубящий $sss = ceil($st['s1'] * 0.75); } elseif ($item['type'] == 20) { - // + //дробящий $sss = ceil($st['s4'] * 1.5); } elseif ($item['type'] == 21) { - // + //режущий $sss = ceil($st['s3'] * 1); } else { - // + //без профильного урона $sss = ceil($st['s1'] * 0.1); } - // + //Обычный урон //$p['B'][0] = 5; //$p['B'][1] = 9; @@ -725,37 +726,37 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $p['B'][1] = $p['B'][0] + 3; $p['B']['rnd'] = rand($p['B'][0], $p['B'][1]); - // + //Добавочный минимальный урон $p['W'][0] = $min; $p['W'][1] = $max; $p['W']['rnd'] = rand($p['W'][0], $p['W'][1]); - // . + // Коэф. оружия $p['T'] = 1; - // + //Владения $bn = 0; if ($item['type'] == 21) { - // + // меч $p['M'] = $st['pa4']; $bn = $st['a4']; - // $p['M'] = $st['pa'.$x]; + //ТУТ $p['M'] = $st['pa'.$x]; } elseif ($item['type'] == 20) { - // + // дубина $p['M'] = $st['pa3']; $bn = $st['a3']; } elseif ($item['type'] == 19) { - // + // топор $p['M'] = $st['pa2']; $bn = $st['a2']; } elseif ($item['type'] == 18) { - // + // нож $p['M'] = $st['pa1']; $bn = $st['pa1']; } elseif ($item['type'] == 22) { - // + // посох $p['M'] = $st['pa3']; $bn = $st['a5']; } - // + //Мощнность //if( $x < 5 ) { //$p['M'] = $st['pa'.$x]; //}else{ @@ -779,52 +780,16 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` return $tp; } - public function yronLvl($lvl1, $lvl2) - { - $r = [ - 1 => [0, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200], - 2 => [0, 600, 400, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200], - 3 => [0, 1000, 800, 600, 400, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200], - 4 => [0, 1400, 1200, 1000, 800, 600, 400, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200], - 5 => [0, 1800, 1600, 1400, 1200, 1000, 800, 600, 400, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200], - 6 => [0, 2200, 2000, 1800, 1600, 1400, 1200, 1000, 800, 600, 400, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200], - 7 => [0, 2600, 2400, 2200, 2000, 1800, 1600, 1400, 1200, 1000, 800, 600, 400, 200, 200, 200, 200, 200, 200, 200, 200, 200], - 8 => [0, 3000, 2800, 2600, 2400, 2200, 2000, 1800, 1600, 1400, 1200, 1000, 800, 600, 400, 200, 200, 200, 200, 200, 200, 200], - 9 => [0, 3400, 3200, 3000, 2800, 2600, 2400, 2200, 2000, 1800, 1600, 1400, 1200, 1000, 800, 600, 400, 200, 200, 200, 200, 200], - 10 => [0, 3800, 3600, 3400, 3200, 3000, 2800, 2600, 2400, 2200, 2000, 1800, 1600, 1400, 1200, 1000, 800, 600, 400, 200, 200, 200], - 11 => [0, 4200, 4000, 3800, 3600, 3400, 3200, 3000, 2800, 2600, 2400, 2200, 2000, 1800, 1600, 1400, 1200, 1000, 800, 600, 400, 200], - 12 => [0, 4600, 4400, 4200, 4000, 3800, 3600, 3400, 3200, 3000, 2800, 2600, 2400, 2200, 2000, 1800, 1600, 1400, 1200, 1000, 800, 600], - 13 => [0, 5000, 4800, 4600, 4400, 4200, 4000, 3800, 3600, 3400, 3200, 3000, 2800, 2600, 2400, 2200, 2000, 1800, 1600, 1400, 1200, 1000], - 14 => [0, 5400, 5200, 5000, 4800, 4600, 4400, 4200, 4000, 3800, 3600, 3400, 3200, 3000, 2800, 2600, 2400, 2200, 2000, 1800, 1600, 1400], - 15 => [0, 5800, 5600, 5400, 5200, 5000, 4800, 4600, 4400, 4200, 4000, 3800, 3600, 3400, 3200, 3000, 2800, 2600, 2400, 2200, 2000, 1800], - 16 => [0, 6200, 6000, 5800, 5600, 5400, 5200, 5000, 4800, 4600, 4400, 4200, 4000, 3800, 3600, 3400, 3200, 3000, 2800, 2600, 2400, 2200], - 17 => [0, 6600, 6400, 6200, 6000, 5800, 5600, 5400, 5200, 5000, 4800, 4600, 4400, 4200, 4000, 3800, 3600, 3400, 3200, 3000, 2800, 2600], - 18 => [0, 7000, 6800, 6600, 6400, 6200, 6000, 5800, 5600, 5400, 5200, 5000, 4800, 4600, 4400, 4200, 4000, 3800, 3600, 3400, 3200, 3000], - 19 => [0, 7400, 7200, 7000, 6800, 6600, 6400, 6200, 6000, 5800, 5600, 5400, 5200, 5000, 4800, 4600, 4400, 4200, 4000, 3800, 3600, 3400], - 20 => [0, 7800, 7600, 7400, 7200, 7000, 6800, 6600, 6400, 6200, 6000, 5800, 5600, 5400, 5200, 5000, 4800, 4600, 4400, 4200, 4000, 3800], - 21 => [0, 8200, 8000, 7800, 7600, 7400, 7200, 7000, 6800, 6600, 6400, 6200, 6000, 5800, 5600, 5400, 5200, 5000, 4800, 4600, 4400, 4200] - ]; - $r = floor($r[$lvl1][$lvl2] / 100); - $r = 0; - return $r; - } - - // + //Расчет защиты public function zago($v) { - /*if($v > 1000) { - $v = 1000; - } - $r = (1-( pow(0.5, ($v/250) ) ))*100; - return $r;*/ if ($v > 1700) { $v = 1700; } - $r = round((1 - (pow(0.5, ($v / 399.51)))) * 100, 2); - return $r; + return round((1 - (pow(0.5, ($v / 399.51)))) * 100, 2); } - // () + //Расчет защиты (магия) public function zmgo($v) { if ($v > 1000) { @@ -841,7 +806,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $r = ''; if ($v == 'yrontest' || $v == 'yrontest-krit') { $y = []; - /* */ + /* первое оружие или кулак */ $w1 = 0; $w2 = 0; $i = 0; @@ -878,7 +843,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $r .= '' . $y[0] . '-' . $y[1] . ''; } else { - // + //урон кулаком $y[0] = ceil(2 + $this->info['level'] + $this->stats ['s1'] - round($this->stats['s1'] / 5)) + $this->stats['minAtack'] + $this->stats['yron_min']; $y[1] = ceil($y[0] + 3) + $this->stats['maxAtack'] + $this->stats['yron_max']; if ($y[0] < 1) { @@ -889,7 +854,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $r .= $y[0] . '-' . $y[1]; } - /* */ + /* второе оружие */ if (isset($w2['id'])) { $tp = 0; $t = 0; @@ -918,7 +883,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` /* --- */ } elseif ($v == 'yron') { $y = []; - /* */ + /* первое оружие или кулак */ $w1 = 0; $w2 = 0; $i = 0; @@ -951,7 +916,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $r .= '' . $y[0] . '-' . $y[1] . ''; } else { - // + //урон кулаком $y[0] = ceil($this->stats['s1'] * 1.4) + $this->stats['minAtack'] + $this->stats['yron_min']; $y[1] = ceil(0.4 + $y[0] / 0.9) + $this->stats['maxAtack'] + $this->stats['yron_max']; if ($y[0] < 1) { @@ -962,7 +927,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $r .= $y[0] . '-' . $y[1]; } - /* */ + /* второе оружие */ if (isset($w2['id'])) { $tp = 0; $t = 0; @@ -985,9 +950,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $r .= ' / ' . $y[0] . '-' . $y[1] . ''; } } else { - // + //модификаторы $y = []; - /* */ + /* первое оружие или кулак */ $w1 = 0; $w2 = 0; $i = 0; @@ -1015,11 +980,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $ry = $y; $r .= '' . $y . ''; } else { - // + //кулаком $r .= $this->stats[$v]; $ry = $this->stats[$v]; } - /* */ + /* второе оружие */ if (isset($w2['id'])) { $tp = 0; $t = 0; @@ -1032,7 +997,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $r = str_replace('title="' . $w1['name'] . '"', '', $r); } } - // + //модификаторы } return $r; } @@ -1046,7 +1011,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($tmp > 0) { $id++; if ($id < 3) { - $out .= $tmp . " . "; + $out .= $tmp . " мес. "; } $time_still = $time_still - $tmp * 2592000; } @@ -1054,7 +1019,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($tmp > 0) { $id++; if ($id < 3) { - $out .= $tmp . " . "; + $out .= $tmp . " дн. "; } $time_still = $time_still - $tmp * 86400; } @@ -1062,7 +1027,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($tmp > 0) { $id++; if ($id < 3) { - $out .= $tmp . " . "; + $out .= $tmp . " ч. "; } $time_still = $time_still - $tmp * 3600; } @@ -1070,14 +1035,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($tmp > 0) { $id++; if ($id < 3) { - $out .= $tmp . " . "; + $out .= $tmp . " мин. "; } } if ($out == '') { if ($time_still < 0) { $time_still = 0; } - $out = $time_still . ' .'; + $out = $time_still . ' сек.'; } return $out; } @@ -1085,105 +1050,105 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` public function rep_zv($id, $e) { if ($id == 1) { - // + //Храм знаний if ($e > 9999) { - $r = ' , ' . $e . ' / ??'; + $r = 'Посвященный третьего круга, ' . $e . ' / ??'; } elseif ($e > 999) { - $r = ' , ' . $e . ' / 9999'; + $r = 'Посвященный второго круга, ' . $e . ' / 9999'; } elseif ($e > 99) { - $r = ' , ' . $e . ' / 999'; + $r = 'Посвященный первого круга, ' . $e . ' / 999'; } else { $r = $e . ' / 99'; } } elseif ($id == 2) { //Capital city if ($e > 24999) { - $r = ' , ' . $e . ' / ??'; + $r = 'Рыцарь второго круга, ' . $e . ' / ??'; } elseif ($e > 9999) { - $r = ' , ' . $e . ' / 24999'; + $r = 'Рыцарь первого круга, ' . $e . ' / 24999'; } else { $r = $e . ' / 10000'; } } elseif ($id == 3) { //Angels city if ($e > 24999) { - $r = ' , ' . $e . ' / ??'; + $r = 'Рыцарь второго круга, ' . $e . ' / ??'; } elseif ($e > 9999) { - $r = ' , ' . $e . ' / 24999'; + $r = 'Рыцарь первого круга, ' . $e . ' / 24999'; } else { $r = $e . ' / 10000'; } } elseif ($id == 4) { //Demons city if ($e > 24999) { - $r = ' , ' . $e . ' / ??'; + $r = 'Рыцарь второго круга, ' . $e . ' / ??'; } elseif ($e > 9999) { - $r = ' , ' . $e . ' / 24999'; + $r = 'Рыцарь первого круга, ' . $e . ' / 24999'; } else { $r = $e . ' / 10000'; } } elseif ($id == 5) { - // + //Алтарь Крови if ($e > 99) { - $r = ' ' . $e . ' / 999'; + $r = 'Посвященный первого круга ' . $e . ' / 999'; } else { $r = $e . ' / 99'; } } elseif ($id == 6) { //Sand if ($e > 24999) { - $r = ' , ' . $e . ' / ??'; + $r = 'Рыцарь второго круга, ' . $e . ' / ??'; } elseif ($e > 9999) { - $r = ' , ' . $e . ' / 24999'; + $r = 'Рыцарь первого круга, ' . $e . ' / 24999'; } else { $r = $e . ' / 10000'; } } elseif ($id == 7) { //Sun if ($e > 24999) { - $r = ' , ' . $e . ' / ??'; + $r = 'Рыцарь второго круга, ' . $e . ' / ??'; } elseif ($e > 9999) { - $r = ' , ' . $e . ' / 24999'; + $r = 'Рыцарь первого круга, ' . $e . ' / 24999'; } else { $r = $e . ' / 10000'; } } elseif ($id == 8) { //Moon if ($e > 24999) { - $r = ' , ' . $e . ' / ??'; + $r = 'Рыцарь второго круга, ' . $e . ' / ??'; } elseif ($e > 9999) { - $r = ' , ' . $e . ' / 24999'; + $r = 'Рыцарь первого круга, ' . $e . ' / 24999'; } else { $r = $e . ' / 10000'; } } elseif ($id == 9) { //Dreams city if ($e > 9999) { - $r = ' , [' . $e . ']'; + $r = 'Посвященный третьего круга, [' . $e . ']'; } elseif ($e > 4999) { - $r = ' ,' . $e . ' / 9999'; + $r = 'Посвященный второго круга,' . $e . ' / 9999'; } elseif ($e > 999) { - $r = ' , ' . $e . ' / 4999'; + $r = 'Посвященный первого круга, ' . $e . ' / 4999'; } else { $r = $e . ' / 999'; } } elseif ($id == 10) { - // + //Гора легиона if ($e > 9999) { - $r = ' ,[' . $e . ']'; + $r = 'Посвященный второго круга,[' . $e . ']'; } elseif ($e > 999) { - $r = ' , ' . $e . ' / 4999'; + $r = 'Посвященный первого круга, ' . $e . ' / 4999'; } else { $r = $e . ' / 999'; } } elseif ($id == 11) { - // + //Излом Хаоса if ($e > 9999) { - $r = ' , [' . $e . ']'; + $r = 'Легенда Излома Хаоса, [' . $e . ']'; } elseif ($e > 4999) { - $r = ' ,' . $e . ' / 9999'; + $r = 'Чемпион Излома Хаоса,' . $e . ' / 9999'; } elseif ($e > 999) { - $r = ' , ' . $e . ' / 4999'; + $r = 'Знаток Излома Хаоса, ' . $e . ' / 4999'; } else { $r = $e . ' / 999'; } @@ -1207,7 +1172,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $i = mysql_fetch_array(mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp` FROM `items_main` AS `im` WHERE `im`.`id` = "' . mysql_real_escape_string($id) . '" LIMIT 1')); if (isset($i['id'])) { $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "' . $i['id'] . '" LIMIT 1')); - // + //новая дата $data = $d['data']; if ($i['ts'] > 0) { if ($nosudba == null) { @@ -1217,13 +1182,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } if ($md != null) { $data .= $md; - $data = $this->lookStats($data); // SROK? + $data = $this->lookStats($data); // Если в функции имеются две одинаковых константы SROK? $data = $this->impStats($data); } if ($dn != null) { - // + //предмет с настройками из подземелья if ($dn['dn_delete'] > 0) { $i['dn_delete'] = 1; } @@ -1256,10 +1221,10 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $ads = ''; if ($plavka != null) { - $ads = ' : [' . $plavka . ']'; + $ads = 'Расплавлен предмет : [' . $plavka . ']'; } - // - $ld = $this->addDelo(1, $uid, '"AddItems.' . $this->info['city'] . '": "' . $i['name'] . '" (x1) [#' . $i['iid'] . ']. ' . $ads . '', time(), $this->info['city'], 'AddItems.' . $this->info['city'] . '', 0, 0); + //Записываем в личное дело что предмет получен + $ld = $this->addDelo(1, $uid, '"AddItems.' . $this->info['city'] . '": Получен предмет "' . $i['name'] . '" (x1) [#' . $i['iid'] . ']. ' . $ads . '', time(), $this->info['city'], 'AddItems.' . $this->info['city'] . '', 0, 0); } else { $rt = 0; } @@ -1337,19 +1302,19 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $r .= ' ' . $inf['login'] . ' [' . $inf['level'] . ']'; } else { - $r = ' [??]'; + $r = 'Невидимка [??]'; } return $r; } public function testHome() { - /*----()----*/ + /*----Быстрый(Особенность)----*/ $timeforwait = 3600; if (isset($st['os3']) && $st['os3'] > 0) { $timeforwait = 3600 - (($st['os6'] * 5) * 60); } - /*----()----*/ + /*----Быстрый(Особенность)----*/ $hgo = $this->testAction('`uid` = "' . $this->info['id'] . '" AND `time` >= ' . (time() - $timeforwait) . ' AND `vars` = "go_homeworld" LIMIT 1', 1); if ($this->info['level'] == 0 || $this->info['active'] != '' || $this->info['inTurnir'] > 0 || $this->info['inTurnirnew'] > 0 || $this->info['zv'] > 0 || $this->info['dnow'] > 0) { $hgo['id'] = true; @@ -1389,307 +1354,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` return $r; } - public function functionThisData() + public function addKr($amount) { - // - + Db::sql('update users set money = money + ? where id = ?', [$amount, $this->info['id']]); } - public function rangup($id, $rang, $name) + public function addEkr($amount) { - mysql_query('UPDATE `users_achiv` SET `' . $name . '_n` = "' . $rang . '" WHERE `id` = "' . $id . '" LIMIT 1'); - unset ($name, $rang); - } - - public function achivInf($id, $check = null) - { - $ai = mysql_fetch_array(mysql_query('SELECT * FROM `users_achiv` WHERE `id`="' . $id . '" LIMIT 1')); - if ($ai['zb'] > 0 || $check != null) { - $ai['namezb'] = '.'; - //5/25/50/100/250 - if ($ai['zb'] >= 250) { - $ai['klaszb'] = 5; - $ai['klasPzb'] = 100; - - } elseif ($ai['zb'] >= 100) { - $ai['klaszb'] = 4; - $ai['klasPzb'] = ceil(($ai['zb'] - 100) / 150 * 100); - - } elseif ($ai['zb'] >= 50) { - $ai['klaszb'] = 3; - $ai['klasPzb'] = ceil(($ai['zb'] - 50) / 50 * 100); - } elseif ($ai['zb'] >= 25) { - $ai['klaszb'] = 2; - $ai['klasPzb'] = ceil(($ai['zb'] - 25) / 25 * 100); - } elseif ($ai['zb'] >= 5) { - $ai['klaszb'] = 1; - $ai['klasPzb'] = ceil(($ai['zb'] - 5) / 20 * 100); - } else { - $ai['klaszb'] = 0; - $ai['klasPzb'] = ceil($ai['zb'] / 5 * 100); - } - } - if ($ai['vx'] > 0 || $check != null) { - $ai['namevx'] = ' '; - if ($ai['vx'] >= 1000) { - $ai['klasvx'] = 5; - $ai['klasPvx'] = 100; - - } elseif ($ai['vx'] >= 500) { - $ai['klasvx'] = 4; - $ai['klasPvx'] = ceil(($ai['vx'] - 500) / 500 * 100); - - } elseif ($ai['vx'] >= 400) { - $ai['klasvx'] = 3; - $ai['klasPvx'] = ceil(($ai['vx'] - 400) / 100 * 100); - } elseif ($ai['vx'] >= 300) { - $ai['klasvx'] = 2; - $ai['klasPvx'] = ceil(($ai['vx'] - 300) / 100 * 100); - } elseif ($ai['vx'] >= 50) { - $ai['klasvx'] = 1; - $ai['klasPvx'] = ceil(($ai['vx'] - 50) / 250 * 100); - } else { - $ai['klasvx'] = 0; - $ai['klasPvx'] = ceil($ai['vx'] / 50 * 100); - } - } - if ($ai['snt'] > 0 || $check != null) { - $ai['namesnt'] = ' '; - if ($ai['snt'] >= 250) { - $ai['klassnt'] = 5; - $ai['klasPsnt'] = 100; - - } elseif ($ai['snt'] >= 100) { - $ai['klassnt'] = 4; - $ai['klasPsnt'] = ceil(($ai['snt'] - 100) / 150 * 100); - - } elseif ($ai['snt'] >= 50) { - $ai['klassnt'] = 3; - $ai['klasPsnt'] = ceil(($ai['snt'] - 50) / 50 * 100); - } elseif ($ai['snt'] >= 25) { - $ai['klassnt'] = 2; - $ai['klasPsnt'] = ceil(($ai['snt'] - 25) / 25 * 100); - } elseif ($ai['snt'] >= 5) { - $ai['klassnt'] = 1; - $ai['klasPsnt'] = ceil(($ai['snt'] - 5) / 20 * 100); - } else { - $ai['klassnt'] = 0; - $ai['klasPsnt'] = ceil($ai['snt'] / 5 * 100); - } - } - if ($ai['rp'] > 0 || $check != null) { - $ai['namerp'] = ' 8 .'; - if ($ai['rp'] >= 100) { - $ai['klasrp'] = 5; - $ai['klasPrp'] = 100; - - } elseif ($ai['rp'] >= 50) { - $ai['klasrp'] = 4; - $ai['klasPrp'] = ceil(($ai['rp'] - 50) / 50 * 100); - - } elseif ($ai['rp'] >= 25) { - $ai['klasrp'] = 3; - $ai['klasPrp'] = ceil(($ai['rp'] - 25) / 25 * 100); - } elseif ($ai['rp'] >= 10) { - $ai['klasrp'] = 2; - $ai['klasPrp'] = ceil(($ai['rp'] - 10) / 15 * 100); - } elseif ($ai['rp'] >= 5) { - $ai['klasrp'] = 1; - $ai['klasPrp'] = ceil(($ai['rp'] - 5) / 5 * 100); - } else { - $ai['klasrp'] = 0; - $ai['klasPrp'] = ceil($ai['rp'] / 5 * 100); - } - } - if ($ai['rn'] > 0 || $check != null) { - $ai['namern'] = ' 9 .'; - if ($ai['rn'] >= 50) { - $ai['klasrn'] = 5; - $ai['klasPrn'] = 100; - - } elseif ($ai['rn'] >= 25) { - $ai['klasrn'] = 4; - $ai['klasPrn'] = ceil(($ai['rn'] - 25) / 10 * 100); - - } elseif ($ai['rn'] >= 15) { - $ai['klasrn'] = 3; - $ai['klasPrn'] = ceil(($ai['rn'] - 15) / 5 * 100); - } elseif ($ai['rn'] >= 10) { - $ai['klasrn'] = 2; - $ai['klasPrn'] = ceil(($ai['rn'] - 10) / 5 * 100); - } elseif ($ai['rn'] >= 5) { - $ai['klasrn'] = 1; - $ai['klasPrn'] = ceil(($ai['rn'] - 5) / 5 * 100); - } else { - $ai['klasrn'] = 0; - $ai['klasPrn'] = ceil($ai['rn'] / 5 * 100); - } - } - if ($ai['rb'] > 0 || $check != null) { - $ai['namerb'] = ' 10 '; - if ($ai['rb'] >= 15) { - $ai['klasrb'] = 5; - $ai['klasPrb'] = 100; - - } elseif ($ai['rb'] >= 11) { - $ai['klasrb'] = 4; - $ai['klasPrb'] = ceil(($ai['rb'] - 11) / 4 * 100); - - } elseif ($ai['rb'] >= 8) { - $ai['klasrb'] = 3; - $ai['klasPrb'] = ceil(($ai['rb'] - 8) / 3 * 100); - } elseif ($ai['rb'] >= 5) { - $ai['klasrb'] = 2; - $ai['klasPrb'] = ceil(($ai['rb'] - 5) / 3 * 100); - } elseif ($ai['rb'] >= 2) { - $ai['klasrb'] = 1; - $ai['klasPrb'] = ceil(($ai['rb'] - 2) / 3 * 100); - } else { - $ai['klasrb'] = 0; - $ai['klasPrb'] = ceil($ai['rb'] / 2 * 100); - } - } - if ($ai['pg'] > 0 || $check != null) //100/200/400/600/1000 - { - $ai['namepg'] = '. '; - if ($ai['pg'] >= 1000) { - $ai['klaspg'] = 5; - $ai['klasPpg'] = 100; - - } elseif ($ai['pg'] >= 600) { - $ai['klaspg'] = 4; - $ai['klasPpg'] = ceil(($ai['pg'] - 600) / 400 * 100); - - } elseif ($ai['pg'] >= 400) { - $ai['klaspg'] = 3; - $ai['klasPpg'] = ceil(($ai['pg'] - 400) / 200 * 100); - } elseif ($ai['pg'] >= 200) { - $ai['klaspg'] = 2; - $ai['klasPpg'] = ceil(($ai['pg'] - 200) / 200 * 100); - } elseif ($ai['pg'] >= 100) { - $ai['klaspg'] = 1; - $ai['klasPpg'] = ceil(($ai['pg'] - 100) / 100 * 100); - } else { - $ai['klaspg'] = 0; - $ai['klasPpg'] = ceil($ai['pg'] / 100 * 100); - } - } - if ($ai['bv'] > 0 || $check != null) { - $ai['namebv'] = ' '; - if ($ai['bv'] >= 250) { - $ai['klasbv'] = 5; - $ai['klasPbv'] = 100; - - } elseif ($ai['bv'] >= 100) { - $ai['klasbv'] = 4; - $ai['klasPbv'] = ceil(($ai['bv'] - 100) / 150 * 100); - - } elseif ($ai['bv'] >= 50) { - $ai['klasbv'] = 3; - $ai['klasPbv'] = ceil(($ai['bv'] - 50) / 50 * 100); - } elseif ($ai['bv'] >= 25) { - $ai['klasbv'] = 2; - $ai['klasPbv'] = ceil(($ai['bv'] - 25) / 25 * 100); - } elseif ($ai['bv'] >= 5) { - $ai['klasbv'] = 1; - $ai['klasPbv'] = ceil(($ai['bv'] - 5) / 20 * 100); - } else { - $ai['klasbv'] = 0; - $ai['klasPbv'] = ceil($ai['bv'] / 5 * 100); - } - } - if ($ai['kw'] > 0 || $check != null) { - $ai['namekw'] = ' '; - if ($ai['kw'] >= 250) { - $ai['klaskw'] = 5; - $ai['klasPkw'] = 100; - - } elseif ($ai['kw'] >= 100) { - $ai['klaskw'] = 4; - $ai['klasPkw'] = ceil(($ai['kw'] - 100) / 150 * 100); - - } elseif ($ai['kw'] >= 50) { - $ai['klaskw'] = 3; - $ai['klasPkw'] = ceil(($ai['kw'] - 50) / 50 * 100); - } elseif ($ai['kw'] >= 25) { - $ai['klaskw'] = 2; - $ai['klasPkw'] = ceil(($ai['kw'] - 25) / 25 * 100); - } elseif ($ai['kw'] >= 5) { - $ai['klaskw'] = 1; - $ai['klasPkw'] = ceil(($ai['kw'] - 5) / 20 * 100); - } else { - $ai['klaskw'] = 0; - $ai['klasPkw'] = ceil($ai['kw'] / 5 * 100); - } - } - if ($ai['pa'] > 0 || $check != null) { - $ai['namepa'] = ''; - if ($ai['pa'] >= 250) { - $ai['klaspa'] = 5; - $ai['klasPpa'] = 100; - - } elseif ($ai['pa'] >= 100) { - $ai['klaspa'] = 4; - $ai['klasPpa'] = ceil(($ai['pa'] - 100) / 150 * 100); - - } elseif ($ai['pa'] >= 50) { - $ai['klaspa'] = 3; - $ai['klasPpa'] = ceil(($ai['pa'] - 50) / 50 * 100); - } elseif ($ai['pa'] >= 25) { - $ai['klaspa'] = 2; - $ai['klasPpa'] = ceil(($ai['pa'] - 25) / 25 * 100); - } elseif ($ai['pa'] >= 5) { - $ai['klaspa'] = 1; - $ai['klasPpa'] = ceil(($ai['pa'] - 5) / 20 * 100); - } else { - $ai['klaspa'] = 0; - $ai['klasPbs'] = 0; - } - } - - $aii = mysql_fetch_array(mysql_query('SELECT `win_bs` AS `bs` FROM `users` WHERE `id`="' . $id . '" LIMIT 1')); - $ai['bs'] = $aii['bs'];// - if ($ai['bs'] > 0 || $check != null) { - $ai['namebs'] = ' '; - if ($ai['bs'] >= 500) { - $ai['klasbs'] = 5; - $ai['klasPbs'] = 100; - - } elseif ($ai['bs'] >= 50) { - $ai['klasbs'] = 4; - $ai['klasPbs'] = ceil(($ai['bs'] - 50) / 450 * 100); - if ($ai['klasPbs'] == 100) { - $ai['klasPbs'] = 99; - } - - } elseif ($ai['bs'] >= 10) { - $ai['klasbs'] = 3; - $ai['klasPbs'] = ceil(($ai['bs'] - 10) / 40 * 100); - } elseif ($ai['bs'] >= 5) { - $ai['klasbs'] = 2; - $ai['klasPbs'] = ceil(($ai['bs'] - 5) / 5 * 100); - } elseif ($ai['bs'] >= 1) { - $ai['klasbs'] = 1; - $ai['klasPbs'] = ceil(($ai['bs'] - 1) / 4 * 100); - } else { - $ai['klasbs'] = 0; - $ai['klasPbs'] = 0; - } - } - /* - 1. . - 2. . 100/250/500/1000/5000 - 3. . 10/50/100/250 - 4.S 5/10/25/50/100 - 5.M 5/10/15/25/50 - 6.L 3/5/8/10/15 - 7. . 10/25/50/100/150 - 8. . 5/10/25/50/100 - 9. . 10/25/50/75/100 - 10. . 50/100/250/500/1000 - 11. . - */ - return $ai; + Db::sql('update users set money2 = money2 + ? where id = ?', [$amount, $this->info['id']]); } private function __construct() @@ -1709,11 +1381,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($c['securetime'] > 0) { if (!defined('IP')) { - $dip = ''; - if (!empty($_SERVER['HTTP_CLIENT_IP'])) - $dip = $_SERVER['HTTP_CLIENT_IP']; - else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) - $dip = $_SERVER['HTTP_X_FORWARDED_FOR']; $dip = $_SERVER['REMOTE_ADDR']; define('IP', $dip); } @@ -1771,16 +1438,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` setcookie('btl', $this->info['battle'], time() + 86400); } - // - /*if($this->info['banned'] == 7007001) { - $spm_url = mysql_fetch_array(mysql_query('SELECT * FROM `_spamer` WHERE `host` = "'.$this->info['host'].'" LIMIT 1')); - if(isset($spm_url['id'])) { - die(''); - }else{ - die(''); - } - }*/ - if (!isset($this->info['id'])) { $this->info = mysql_fetch_array(mysql_query('SELECT `u`.`nadmin`,`u`.`id`,`u`.`login`,`u`.`login2`,`u`.`pass`,`u`.`pass2`,`u`.`repass`,`u`.`notrhod`,`u`.`emailconfirmation`,`u`.`securetime`,`u`.`sys`,`u`.`palpro`,`u`.`online`,`u`.`ip`,`u`.`ipreg`,`u`.`joinIP`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`banned`,`u`.`auth`,`u`.`align`,`u`.`align2`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`mod_zvanie`,`u`.`clan`,`u`.`nextMsg`,`u`.`molch1`,`u`.`molch2`,`u`.`molch3`,`u`.`level`,`u`.`money`,`u`.`money2`,`u`.`money4`,`u`.`money3`,`u`.`battle`,`u`.`cityreg`,`u`.`invBlock`,`u`.`allLock`,`u`.`invBlockCode`,`u`.`zag`,`u`.`a1`,`u`.`q1`,`u`.`mail`,`u`.`name`,`u`.`bithday`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`city_real`,`u`.`icq`,`u`.`icq_hide`,`u`.`homepage`,`u`.`deviz`,`u`.`hobby`,`u`.`chatColor`,`u`.`timereg`,`u`.`add_smiles`,`u`.`obraz`,`u`.`win`,`u`.`win_bs`,`u`.`lose`,`u`.`nich`,`u`.`cityreg2`,`u`.`host`,`u`.`info_delete`,`u`.`dateEnter`,`u`.`afk`,`u`.`dnd`,`u`.`timeMain`,`u`.`clan_prava`,`u`.`addpr`,`u`.`marry`,`u`.`city2`,`u`.`invis`,`u`.`bot_id`,`u`.`haos`,`u`.`host_reg`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`jail`,`u`.`animal`,`u`.`vip`,`u`.`catch`,`u`.`frg`,`u`.`no_ip`,`u`.`type_pers`,`u`.`bot_room`,`u`.`clan_delay`,`u`.`bukmeker` @@ -1800,7 +1457,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if (isset($this->info['id'])) { if ($this->info['invis'] == 1 || $this->info['invis'] > time()) { - $this->info['cast_login'] = ''; + $this->info['cast_login'] = 'Невидимка'; } else { $this->info['cast_login'] = $this->info['login']; } @@ -1849,185 +1506,17 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $this->info['login2'] = ''; mysql_query('UPDATE `users` SET `login2` = "" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); } - /* */ - /*$i = $this->testAction('`time` >= "'.(time()-7129).'" AND `vars` = "reclama1" LIMIT 1',1); - if(!isset($i['id'])) - { - $this->addAction(time(),'reclama1',''); - // - $t6 = array('',''); - if(date('N') == 1) { - // - $t6[0] = ' '; - }elseif(date('N') == 2) { - // - $t6[0] = ''; - }elseif(date('N') == 3) { - // - if(date('H')<20) { - $t6[0] = ''; - }else{ - $t6[0] = ' '; - } - }elseif(date('N') == 4) { - // - $t6[0] = ''; - }elseif(date('N') == 5) { - // - if(date('H')<20) { - $t6[0] = ''; - }else{ - $t6[0] = ' '; - } - }elseif(date('N') == 6) { - // - $t6[0] = ''; - }elseif(date('N') == 7) { - // - if(date('H')<20) { - $t6[0] = ''; - }else{ - $t6[0] = ' '; - } - } - $r = '! '.$t6[0].' ( 20:00 ). Alexandr Events.new-combats.com'; - // - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','".$r."','".time()."','6','0')"); - } - */ - /* - // - mysql_query('LOCK TABLES users,stats,chat,room,test_bot,battle WRITE'); - $dasc = array('ASC','DESC'); - $sp = mysql_query('SELECT `u`.`id`,`u`.`bot_room`,`s`.`atack`,`u`.`type_pers`,`s`.`bbexp`,`s`.`timeGo`,`s`.`timeGoL`,`u`.`login`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`align`,`u`.`align2`,`u`.`clan`,`u`.`room`,`u`.`level`,`u`.`battle`,`s`.`hpNow`,`s`.`mpNow`,`s`.`team`,`u`.`city` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`type_pers` > 0 AND `s`.`timeGo` < '.time().' AND `s`.`timeGoL` < '.time().' ORDER BY `s`.`timeGoL` '.$dasc[rand(0,1)].' LIMIT 11'); - while($pl = mysql_fetch_array($sp)) { - if($pl['type_pers']>0 && $pl['battle'] == 0) { - // - if($pl['timeGo'] 0 AND `close` = 0 AND `destroy` = 0 LIMIT 1')); - if(isset($rmgo['id'])) { - $pl['room'] = $rmgo['id']; - mysql_query('UPDATE `users` SET `room` = "'.$rmgo['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `timeGo` = "'.(time()+rand(60,240)).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - } - } - if($pl['type_pers']>1 && $pl['battle'] == 0 && $pl['timeGoL'] 6 AND `u`.`online` > "'.(time()-10).'" AND `u`.`banned` = "0" LIMIT 5'); - while($plu = mysql_fetch_array($spu)) { - if($plu['battle'] == 0) { - $ru[count($ru)] = $plu['id']; - $rs[$plu['id']] = $plu; - } - } - $ru = $ru[rand(0,count($ru)-1)]; - if($ru > 0 && rand(0,10000) < 2500) { - // - if($pl['timeGoL'] < time()) { - // - $atc = $magic->atackUser($pl['id'],$ru,$rs[$ru]['team'],$rs[$ru]['battle'],$pl['bbexp']); - if($atc == 1) { - $rs[$ru] = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`battle`,`s`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`room` = "'.$pl['room'].'" AND `u`.`city` = "'.$pl['city'].'" AND `u`.`type_pers` = 0 AND `s`.`bot` = 0 AND `u`.`id` != "'.$pl['id'].'" AND `u`.`level` > 6 AND `u`.`online` > "'.(time()-60).'" AND `u`.`banned` = "0" AND `u`.`id` = "'.$rs[$ru]['id'].'" LIMIT 1')); - $pl['battle'] = $rs[$ru]['battle']; - if($rs[$ru]['team'] == 1) { - $pl['team'] = 2; - }else{ - $pl['team'] = 1; - } - mysql_query('UPDATE `users` SET `battle` = "'.$pl['battle'].'",`team` = "'.$pl['team'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','! ".$pl['login']." ".$rs[$ru]['login']."...','".time()."','6','0')"); - $sx = ''; - if($pl['sex'] == 1) { - $sx = ''; - } - $rtxt = '[img[items/pal_button8.gif]] "!'.$pl['login'].'" '.$sx.' "'.$rs[$ru]['login'].'".'; - mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('".$pl['city']."','','','','".$rtxt."','".time()."','7','0','1','1')"); - }else{ - //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','! ".$pl['login']." ".$rs[$ru]['login']."...','".time()."','6','0')"); - } - }else{ - // - mysql_query('UPDATE `stats` SET `timeGoL` = "'.(time()+rand(30,520)).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - } - } - - if($pl['type_pers']>2) { - if($pl['battle'] > 0) { - // - $btlu = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `time_over` = 0 AND `id` = "'.$pl['battle'].'" LIMIT 1')); - if(!isset($btlu['id'])) { - // - mysql_query('UPDATE `users` SET `battle` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - //mysql_query('UPDATE `stats` SET `atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }else{ - // - if($pl['atack'] < time()) { - //mysql_query('UPDATE `stats` SET `atack` = "'.(time()+123456789).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - } - }else{ - // - if($pl['atack'] > time()) { - //mysql_query('UPDATE `stats` SET `atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - - // - if($pl['hpNow'] < 1) { - if($pl['bot_room'] > 0) { - // " " - mysql_query('UPDATE `users` SET `room` = "'.$pl['bot_room'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `hpNow` = "1",`mpNow` = "1",`team` = "0",`timeGoL` = "'.(time()+rand(60,240)).'",`atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','! ".$pl['login']." ".$this->city_name[$pl['city']]."...','".time()."','6','0')"); - }else{ - // - mysql_query('UPDATE `stats` SET `hpNow` = "1000000000",`mpNow` = "1000000000",`team` = "0",`timeGoL` = "'.(time()+rand(60,240)).'",`atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - }elseif($pl['bot_room'] > 0 && $pl['room'] == $pl['bot_room']) { - $btst = $this->getStats($pl['id']); - if($btst['hpAll'] <= $btst['hpNow'] && $btst['mpAll'] <= $btst['mpNow']) { - mysql_query('UPDATE `stats` SET `hpNow` = "'.$btst['hpAll'].'",`mpNow` = "'.$btst['mpAll'].'",`team` = "0",`timeGoL` = "'.(time()+rand(60,240)).'",`atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - $nrm = mysql_fetch_array(mysql_query('SELECT `id` FROM `room` WHERE `name` = " " AND `city` = "'.$pl['city'].'" LIMIT 1')); - mysql_query('UPDATE `users` SET `room` = "'.(0+$nrm['id']).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','! ".$pl['login']." " " ".$this->city_name[$pl['city']]."...','".time()."','6','0')"); - unset($nrm); - }else{ - // - - } - unset($btst); - } - } - } - } - mysql_query('UNLOCK TABLES'); - unset($pl,$sp,$plu,$spu,$atc,$ru,$rs); - /* - $upd = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "" AND `online` < '.(time()-604800).' LIMIT 1')); - if(isset($upd['id'])) - { - mysql_query('UPDATE `users` SET `online` = "'.(time()+600).'" WHERE `id` = "'.$upd['id'].'" LIMIT 1'); - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','! Capital City! !','-1','5','0')"); - unset($upd); - } - */ if (isset($_GET['homeworld'])) { if ($this->info['zv'] == 0 && $this->info['battle'] == 0 && $this->info['dnow'] == 0) { $hgo = $this->testHome(); if (!isset($hgo['id']) && $this->info['room'] != 274 && $this->info['align'] != 2 && $this->info['inTurnir'] == 0) { $this->addAction(time(), 'go_homeworld', ''); - $rmt = mysql_fetch_array(mysql_query('SELECT `id`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee` FROM `room` WHERE `name` = " " AND `city` = "' . $this->info['city'] . '" LIMIT 1')); + $rmt = mysql_fetch_array(mysql_query('SELECT `id`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee` FROM `room` WHERE `name` = "Центральная площадь" AND `city` = "' . $this->info['city'] . '" LIMIT 1')); if (isset($rmt['id'])) { - // + //Удаляем все ставки в БС if ($this->room['file'] == 'bsenter') { - // + //Удаляем все ставки в БС $sp_bs = mysql_query('SELECT `id`,`bsid`,`money` FROM `bs_zv` WHERE `uid` = "' . $this->info['id'] . '" AND `inBot` = "0" AND `finish` = "0"'); while ($pl_bs = mysql_fetch_array($sp_bs)) { mysql_query('UPDATE `bs_turnirs` SET `users` = `users` - 1 WHERE `id` = "' . $pl_bs['bsid'] . '" LIMIT 1'); @@ -2039,17 +1528,17 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` mysql_query('UPDATE `users` SET `room` = "' . $this->info['room'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); } else { - $this->error = ' '; + $this->error = 'В этом городе нельзя пользоваться кнопкой возрата'; } unset($rmt); } else { - $this->error = ' '; + $this->error = 'Вам запрещено пользоваться кнопкой возрата'; } unset($hgo); } } - // + //Заносим текст if (isset($_GET['itmid']) && isset($_GET['addtext'])) { $itm = mysql_fetch_array(mysql_query('SELECT `i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl` @@ -2069,46 +1558,46 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` mysql_query('UPDATE `items_users` SET `use_text` = "' . $itm['use_text'] . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'); mysql_query('INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`) VALUES ("' . $itm['id'] . '","' . time() . '","' . $this->info['login'] . '","' . mysql_real_escape_string(htmlspecialchars($txt, null, 'cp1251')) . '","' . $this->info['city'] . '","' . $sx . '")'); - $this->error = ' '; + $this->error = 'Запись успешно произведена'; } else { - $this->error = ' - ...'; + $this->error = 'Нужно что-то написать...'; } } else { - $this->error = ' '; + $this->error = 'Предмет для записи не подходит'; } } else { - $this->error = ' '; + $this->error = 'Предмет для записи не найден'; } } - // + //Кидаем передачу if (isset($_POST['trnLogin'], $_GET['transfer']) && $this->info['battle'] == 0) { if ($this->info['level'] < 4 && $this->info['admin'] == 0) { - $this->error = ' 4- '; + $this->error = 'Передавать предметы могут персонажи старше 4-го уровня'; } elseif ($this->info['align'] == 2 && $this->info['admin'] == 0) { - $this->error = ' '; + $this->error = 'Хаосники не могут передавать предметы другим персонажам'; } else { $t = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`login2`,`pass`,`pass2`,`emailconfirmation`,`securetime`,`sys`,`online`,`ip`,`ipreg`,`joinIP`,`admin`,`city`,`room`,`banned`,`auth`,`align`,`mod_zvanie`,`clan`,`nextMsg`,`molch1`,`molch2`,`molch3`,`level`,`money`,`battle`,`cityreg`,`invBlock`,`invBlockCode`,`zag`,`a1`,`q1`,`mail`,`name`,`bithday`,`sex`,`city_real`,`icq`,`icq_hide`,`homepage`,`deviz`,`hobby`,`chatColor`,`timereg`,`add_smiles`,`obraz`,`win`,`lose`,`nich`,`cityreg2`,`host`,`info_delete`,`dateEnter`,`afk`,`dnd`,`timeMain`,`clan_prava`,`addpr`,`marry`,`city2`,`invis`,`bot_id`,`haos`,`host_reg`,`inUser`,`jail`,`animal`,`vip`,`catch`,`frg`,`no_ip`,`type_pers`,`bot_room` FROM `users` WHERE `login` = "' . mysql_real_escape_string($_POST['trnLogin']) . '" AND `city` = "' . $this->info['city'] . '" LIMIT 1')); if (isset($t['id'])) { if ($this->info['login'] == $t['login']) { - $this->error = ' , ' . $this->microLogin($t['id'], 1) . ''; + $this->error = 'Вы не можете передать самому себе, персонаж ' . $this->microLogin($t['id'], 1) . ''; } elseif ($t['battle'] > 0) { - $this->error = ' '; + $this->error = 'Персонаж находится в бою'; } elseif ($t['level'] < 4 && $this->info['admin'] == 0) { - $this->error = ' 4- '; + $this->error = 'Вы не можете передавать предметы персонажам ниже 4-го уровня'; } elseif ($t['align'] == 2 && $this->info['admin'] == 0) { - $this->error = ' '; + $this->error = 'Вы не можете передавать предметы хаосникам'; } elseif ($t['room'] != $this->info['room']) { - $this->error = ' '; + $this->error = 'Вы должны находится в одной комнате с персонажем'; } else { - // + //создаем передачу $tt = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`uid1`,`uid2`,`city`,`room`,`good1`,`good2`,`cancel1`,`cancel2`,`money1`,`money2`,`start1`,`start2`,`text`,`r0`,`r1`,`r2`,`finish1`,`finish2` FROM `transfers` WHERE (`uid1` = "' . $this->info['id'] . '" OR `uid2` = "' . $this->info['id'] . '") AND (`cancel1` = "0" OR (`finish1` > 0 AND `uid1` = "' . $this->info['id'] . '") OR (`finish2` > 0 AND `uid2` = "' . $this->info['id'] . '")) AND (`cancel2` = "0" OR (`finish2` > 0 AND `uid2` = "' . $this->info['id'] . '") OR (`finish1` > 0 AND `uid1` = "' . $this->info['id'] . '")) ORDER BY `id` DESC LIMIT 1')); if (isset($tt['id'])) { - $this->error = ' '; + $this->error = 'Вы уже находитесь в передаче'; } else { $tt = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`uid1`,`uid2`,`city`,`room`,`good1`,`good2`,`cancel1`,`cancel2`,`money1`,`money2`,`start1`,`start2`,`text`,`r0`,`r1`,`r2`,`finish1`,`finish2` FROM `transfers` WHERE (`uid1` = "' . $t['id'] . '" OR `uid2` = "' . $t['id'] . '") AND (`cancel1` = "0" OR (`finish1` > 0 AND `uid1` = "' . $t['id'] . '") OR (`finish2` > 0 AND `uid2` = "' . $t['id'] . '")) AND (`cancel2` = "0" OR (`finish2` > 0 AND `uid2` = "' . $t['id'] . '") OR (`finish1` > 0 AND `uid1` = "' . $t['id'] . '")) ORDER BY `id` DESC LIMIT 1')); if (isset($tt['id'])) { - $this->error = ' '; + $this->error = 'Персонаж уже проводит сделку'; } else { $ins = mysql_query('INSERT INTO `transfers` (`uid1`,`uid2`,`city`,`room`,`time`,`text`,`start1`) VALUES ("' . $this->info['id'] . '","' . $t['id'] . '","' . $this->info['city'] . '","' . $this->info['room'] . '","' . time() . '","' . mysql_real_escape_string(htmlspecialchars($_POST['textarea'], null, 'cp1251')) . '","' . time() . '")'); if ($ins) { @@ -2118,12 +1607,12 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } } } else { - $this->error = ' '; + $this->error = 'Персонаж не найден в этом городе'; } } } - // + //Выделяем передачи $this->tfer = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`uid1`,`uid2`,`city`,`room`,`good1`,`good2`,`cancel1`,`cancel2`,`money1`,`money2`,`start1`,`start2`,`text`,`r0`,`r1`,`r2`,`finish1`,`finish2` FROM `transfers` WHERE (`uid1` = "' . $this->info['id'] . '" OR `uid2` = "' . $this->info['id'] . '") AND (`cancel1` = "0" OR (`finish1` > 0 AND `uid1` = "' . $this->info['id'] . '") OR (`finish2` > 0 AND `uid2` = "' . $this->info['id'] . '")) AND (`cancel2` = "0" OR (`finish2` > 0 AND `uid2` = "' . $this->info['id'] . '") OR (`finish1` > 0 AND `uid1` = "' . $this->info['id'] . '")) ORDER BY `id` DESC LIMIT 1')); if ($this->tfer['uid1'] == $this->tfer['uid2']) { $this->tfer = false; @@ -2137,7 +1626,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($this->tfer['uid2'] == $this->info['id'] && $this->tfer['start2'] == 0) { $this->tfer = false; } elseif ($this->tfer['time'] < time() - 1800) { - // 30 , + //если передача дольше 30 минут, то отмена $upd = mysql_query('UPDATE `transfers` SET `cancel1` = "' . time() . '",`cancel2` = "' . time() . '" WHERE `id` = "' . $this->tfer['id'] . '" LIMIT 1'); if ($upd) { unset($this->tfer, $upd); @@ -2158,11 +1647,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $upd = mysql_query('UPDATE `transfers` SET `cancel' . $upd . '` = "' . time() . '" WHERE `id` = "' . $this->tfer['id'] . '" LIMIT 1'); if ($upd) { - $this->error = ' .'; + $this->error = 'Вы успешно отказались от передачи.'; mysql_query('UPDATE `items_users` SET `inTransfer` = "0" WHERE (`uid` = "' . $this->tfer['uid1'] . '" OR `uid` = "' . $this->tfer['uid2'] . '") AND `inTransfer` > 0'); - // + //Добавляем сообщение в чат if ($this->tfer['start2'] > 0) { @@ -2171,10 +1660,10 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } } else { if ($this->tfer['uid1'] == $this->info['id']) { - // + //Передаем предметы другому игроку } elseif ($this->tfer['uid2'] == $this->info['id']) { - // + //Принимаем передачу от другого игрока } } @@ -2182,22 +1671,22 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } /* - + автофлудераст */ - // + //Статистика персонажа на сегодня $stat = $this->testAction('`uid` = "' . $this->info['id'] . '" AND `time` >= ' . strtotime('now 00:00:00') . ' AND `vars` = "statistic_today" LIMIT 1', 1); if (!isset($stat['id'])) { $this->addAction(time(), 'statistic_today', 'e=' . $this->info['exp'] . '|w=' . $this->info['win'] . '|l=' . $this->info['lose'] . '|n=' . $this->info['nich']); } - // + //Одеваем боевой комплект if (isset($_GET['usec1']) && $this->info['battle'] == 0) { $cmp = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`type`,`val`,`name`,`time`,`delete` FROM `save_com` WHERE `uid` = "' . $this->info['id'] . '" AND `delete` = "0" AND `id` = "' . mysql_real_escape_string($_GET['usec1']) . '" LIMIT 1')); if (isset($cmp['id'])) { - // + //снимаем все вещи mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE `uid` = "' . $this->info['id'] . '"'); - // , + //одеваем вещи, если они не удалены $cm = $this->lookStats($cmp['val']); $i = 1; while ($i <= 250) { @@ -2220,7 +1709,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if (isset($this->bank)) { mysql_query('UPDATE `bank` SET `useNow` = "' . (time() + 24 * 60 * 60) . '" WHERE `id` = "' . $this->bank['id'] . '" LIMIT 1'); } else { - $this->bank['error'] = ' '; + $this->bank['error'] = 'Неверный пароль от счета'; } } elseif (!isset($_GET['bank_exit'])) { $this->bank = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`block`,`create`,`pass`,`money1`,`money2`,`useNow`,`notmail` FROM `bank` WHERE `uid` = "' . $this->info['id'] . '" AND `block` = "0" AND `useNow` > ' . time() . ' ORDER BY `useNow` DESC LIMIT 1')); @@ -2231,7 +1720,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } if (!isset($_GET['obt_sel']) && $this->info['battle'] == 0 && $this->info['obraz'] != '0.gif') { - // + //Проверяем текущий образ $this->stats = $this->getStats($this->info['id'], 0); $tr = true; $o = mysql_fetch_array(mysql_query('SELECT `id`,`sex`,`tr`,`img`,`login`,`level`,`admin`,`align`,`clan`,`itm` FROM `obraz` WHERE `img` = "' . mysql_real_escape_string($this->info['obraz']) . '" AND `sex` = "' . $this->info['sex'] . '" AND (`login` = "" OR `login` = "' . $this->info['login'] . '") LIMIT 1')); @@ -2308,7 +1797,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $j++; } if ($tritm != '' && $tr == false) { - $this->error = ' : ' . $tritm . ''; + $this->error = 'Необходимы предметы: ' . $tritm . ''; } } while ($x < count($t)) { @@ -2316,7 +1805,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if (isset($po['tr_' . $n])) { if ($po['tr_' . $n] > $this->stats[$n]) { $tr = false; - $this->error = ' '; + $this->error = 'Недостаточно характеристик или параметров персонажа'; } } $x++; @@ -2335,7 +1824,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } } } else { - $this->error = ' , ' . date('d.m.Y H:i', $sm['time'] + 86400) . ''; + $this->error = 'Выбирать образ можно не чаще одного раза в сутки, следующая смена ' . date('d.m.Y H:i', $sm['time'] + 86400) . ''; unset($_GET['obr_sel']); $_GET['inv'] = 1; } @@ -2352,7 +1841,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($this->info['wipe'] != 0) { $this->wipe(); } else { - // + //проверяем статы } @@ -2368,24 +1857,24 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` global $magic; if (isset($_GET['use_snowball'])) { $this->stats = $this->getStats($this->info, 0); - // + //Начинаем лепить снежок на ЦП if (isset($this->stats['items'][$this->stats['wp13id']]['id']) && $this->stats['items'][$this->stats['wp13id']]['item_id'] == 998) { - // , - if ($this->room['name'] != ' ') { - $this->error2 = ' '; + //варежки одеты, все ок + if ($this->room['name'] != 'Центральная площадь') { + $this->error2 = 'Собирать снег можно только на Центральной площади'; } else { $smt = $this->testAction('`uid` = "' . $this->info['id'] . '" AND `time`>=' . (time() - 120) . ' AND `vars` = "create_snowball_cp" LIMIT 1', 1); if (isset($smt['id'])) { - $this->error2 = ' ;)'; + $this->error2 = 'Нельзя лепить несколько снежков одновременно ;)'; } else { $smt = $this->testAction('`uid` = "' . $this->info['id'] . '" AND `time`>=' . strtotime('now 00:00:00') . ' AND `vars` = "create_snowball_cp" LIMIT 25', 2); $smt = $smt[0]; if ($smt < 10) { $this->addAction(time(), 'create_snowball_cp', $this->info['city']); $magic->add_eff($this->info['id'], 24); - $this->error2 = ' , ' . (10 - $smt) . ' ...'; + $this->error2 = 'Начинаем лепить снежок, осталось ' . (10 - $smt) . ' раз на сегодня ...'; } else { - $this->error2 = ' 10 ...'; + $this->error2 = 'Вы уже слепили 10 снежка за сегодня ...'; } } } @@ -2411,20 +1900,20 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $v = 0; } if ($t == 0) { - $names[] = ' '; - $names[] = ' '; - $names[] = ' '; - $names[] = ' '; + $names[] = ' '; + $names[] = ' '; + $names[] = ' '; + $names[] = ' '; } else { - $names[] = ' '; - $names[] = ' '; - $names[] = ' '; - $names[] = ' '; + $names[] = ' '; + $names[] = ' '; + $names[] = ' '; + $names[] = ' '; } $int = $v; do { $mod = $int % 10; - $int = floor($int / 10);// $int = ($int-$mod)/10; + $int = floor($int / 10);//или быстрее $int = ($int-$mod)/10; $r = array_shift($names) . "" . $mod . "" . $r; } while ($int); @@ -2452,7 +1941,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $ekr_add = round($h*0.45,2); $bnks = mysql_fetch_array(mysql_query('SELECT `id`,`money2` FROM `bank` WHERE `uid` = "'.$this->info['id'].'" AND `block` = "0" ORDER BY `id` DESC LIMIT 1')); if( isset($bnks['id']) ) { - $r .= ' '.$ekr_add.' . ( '.$bnks['id'].') '.$h.' . !'; + $r .= ' Вы получили '.$ekr_add.' екр. (Банк №'.$bnks['id'].') за '.$h.' ч. в онлайне!'; $this->info['catch'] += $ekr_add; $bnks['money2'] += $ekr_add; mysql_query('UPDATE `users` SET `catch` = "'.$this->info['catch'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); @@ -2483,7 +1972,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` mysql_query('UPDATE `actions` SET `vals` = "'.$ts['time_all'].'" WHERE `id` = "'.$tf['id'].'" LIMIT 1'); } - // $m . + //Выдаем $m шт. предметов награды за онлайн if($m > 0) { $hrg = 1; //$this->addItem(2130,$this->info['id'],'noodet=1|noremont=1'); @@ -2503,9 +1992,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } /*if($this->info['id'] == 285838 || $this->info['admin'] > 0) { - $r .= '! : '.$enreg.' . ['.$this->stats['enNow'].'/'.$this->stats['enAll'].']'; + $r .= 'Внимание! восстановлено энергии: '.$enreg.' ед. ['.$this->stats['enNow'].'/'.$this->stats['enAll'].']'; - // + //Отправляем сообщение в чат mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$this->info['city']."','".$this->info['room']."','','".$this->info['login']."','".$r."','-1','5','0')"); }*/ //} @@ -2555,15 +2044,15 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($clon != null) { $r = false; if (is_array($clon)) { - // + //уже взяли инфу } else { $clon = $this->takePersInfo('`u`.`id` = "' . ((int)$clon) . '"'); } if (isset($clon['id'])) { if (!isset($clon['loclon'])) { - $clon['login'] .= ' ()'; + $clon['login'] .= ' (Клон)'; } - // + //копируем пользователя $ins1 = mysql_query('INSERT INTO `users` ( `align`, `login`, @@ -2597,7 +2086,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` )'); if ($ins1) { if ($round > 0) { - // . 1 = +10% + //Улучшаем мф. и статы и НР 1 раунд = +10% $statss = $this->lookStats($clon['stats']); // $statss['s1'] = ceil($statss['s1'] * (1 + 0.1 * ($round))); @@ -2619,7 +2108,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` unset($statss); } if ($luser == true && $clon['level'] < 8) { - // , + //Хуже уворот, крит и защита $statss = $this->lookStats($clon['stats']); $statss['m1'] = ceil($statss['m1'] * 0.75); $statss['m2'] = ceil($statss['m2'] * 0.75); @@ -2635,16 +2124,16 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` unset($statss); } $uid = mysql_insert_id(); - // + //копируем статы $ins2 = mysql_query('INSERT INTO `stats` (`clone`,`id`,`stats`,`hpNow`,`upLevel`,`bot`,`priems`) VALUES ("' . $clon['id'] . '","' . $uid . '","' . $clon['stats'] . '","1000000","' . $clon['upLevel'] . '","1","' . $clon['priems'] . '")'); if ($ins2) { - // + //копируем предметы $sp = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `uid` = "' . $clon['id'] . '" AND `inOdet` > 0 AND `delete` = "0" LIMIT 50'); while ($pl = mysql_fetch_array($sp)) { $pl['data'] = str_replace('toclan', 'to_clan_', $pl['data']); mysql_query('INSERT INTO `items_users` (`uid`,`item_id`,`data`,`inOdet`,`iznosMAX`,`kolvo`) VALUES ("' . $uid . '","' . $pl['item_id'] . '","' . $pl['data'] . '","' . $pl['inOdet'] . '","' . $pl['iznosMAX'] . '","' . $pl['kolvo'] . '")'); } - // + //копируем эффекты $sp = mysql_query('SELECT `id`,`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`timeAce`,`user_use`,`delete`,`v1`,`v2`,`img2`,`x`,`hod`,`bj`,`sleeptime`,`no_Ace`,`tr_life_user` FROM `eff_users` WHERE `uid` = "' . $clon['id'] . '" AND `delete` = "0" AND `deactiveTime` < "' . time() . '" AND `v1` != "priem" LIMIT 50'); while ($pl = mysql_fetch_array($sp)) { mysql_query('INSERT INTO `eff_users` (`uid`,`id_eff`,`data`,`name`,`overType`,`timeUse`,`x`) VALUES ("' . $uid . '","' . $pl['id_eff'] . '","' . $pl['data'] . '","' . $pl['name'] . '","' . $pl['overType'] . '","' . $pl['timeUse'] . '","' . $pl['x'] . '")'); @@ -2707,7 +2196,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($ins1) { $uid = mysql_insert_id(); if ($round > 0) { - // . 1 = +20% + //Улучшаем мф. и статы и НР 1 раунд = +20% $statss = $this->lookStats($bot['stats']); // $statss['s1'] = ceil($statss['s1'] * (1 + 0.20 * ($round))); @@ -2734,7 +2223,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $bot['logins_bot'] = $logins_bot; $ret = $bot; - // + //Выдаем предметы //$this->addItem($item_id,$uid); $iu = explode(',', $bot['itemsUse']); $i = 0; @@ -2776,13 +2265,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } /* - * $iid id - * . + * $iid Уникальный id прдемета и одновремено флаг что + * покупка из комка. */ public function buyItem($sid, $itm, $x, $mdata = null, $vip = false) { global $c, $code, $sid; - // sid 700 - 730 ( 10) + // sid 700 - 730 зарезервированный диапазон для кузниц в пещере (АП вешей до 10лвл) $x = round((int)$x); if ($x < 1) { $x = 1; @@ -2798,9 +2287,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $test = $this->testVipItems($i['type']); } if ($vip == true && $test == false) { - $r = ' VIP , '; + $r = 'Данная покупка ограничена VIP аккаунтом, приобретите более дорогой аккаунт'; } elseif ($this->info['allLock'] > time()) { - $r = ' ' . date('d.m.y H:i', $this->info['allLock']) . ''; + $r = 'Вам запрещено совершать покупки до ' . date('d.m.y H:i', $this->info['allLock']) . ''; } elseif (isset($i['id'])) { if ($i['price_4'] <= 0) { $i['price_4'] = $i['price3']; @@ -2846,7 +2335,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $trn = 1; } - if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // + if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // Требуемая репутация для покупки $need_rep = 0; $tr_rep = $this->lookStats($i['tr_reputation']); foreach ($tr_rep as $row) { @@ -2865,21 +2354,21 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } if ($i['max_buy'] < $x && $i['max_buy'] > 0) { - $r = ' ' . $i['max_buy'] . ' .'; + $r = 'Для покупки доступно ' . $i['max_buy'] . ' шт.'; } elseif ($need_rep > 0) { - $r = ' , .'; + $r = 'Вы не заслужили нашего доверия, мы не продадим вам этот товар.'; } elseif ($mxby == -1) { - $r = ' '; + $r = 'Максимальное количество покупок для данного предмета исчерпана'; } elseif ($trn == 0 && $this->info['admin'] == 0) { - $r = ' ( ' . $trnt . ')'; + $r = 'У вас недостаточно требуемых предметов (не хватает ' . $trnt . ')'; } elseif ($i['price_4'] * $x > ($this->rep['rep3'] - $this->rep['rep3_buy'])) { - $r = ' ( ' . ($price - ($this->rep['rep3'] - $this->rep['rep3_buy'])) . ' .)'; + $r = 'У вас недостаточно репутации (не хватает ' . ($price - ($this->rep['rep3'] - $this->rep['rep3_buy'])) . ' репутации.)'; } else { $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "' . $i['id'] . '" LIMIT 1')); $this->rep['rep3_buy'] += $price; $upd = mysql_query('UPDATE `rep` SET `rep3_buy` = "' . mysql_real_escape_string($this->rep['rep3_buy']) . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); if ($upd) { - // + //новая дата $data = ''; $data .= $d['data']; if ($mdata != null) { @@ -2915,36 +2404,36 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $ix++; } if ($ins) { - // + //Записываем в личное дело что предмет получен if ($trnt != '' && $i['tr_items'] != '') { $trnt = ', ' . $trnt; } - $r = ' "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') ' . $price . ' . ' . $trnt . '
.'; + $r = 'Вы приобрели предмет "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') за ' . $price . ' репутации. ' . $trnt . '
Предмет успешно добавлен в инвентарь.'; $j = 0; while ($j < count($detrn)) { $ost = ((int)$detrn[$j][1]); $s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "' . ((int)$detrn[$j][0]) . '" AND `uid` = "' . $this->info['id'] . '" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT ' . ((int)$detrn[$j][1]) . ''); while ($itm = mysql_fetch_array($s4)) { - // + //удаляем предмет mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'); } $j++; } - //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','',' ! ".$this->info['login']." "".$i['name']."" , !','-1','5','0')"); + //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','Артефактный магазин! Персонаж ".$this->info['login']." приобрел предмет "".$i['name']."" , Поздравляем с удачной покупкой!','-1','5','0')"); mysql_query('UPDATE `items_shop` SET `kolvo` = "' . ($i['kolvo'] - $x) . '" WHERE `iid` = "' . $i['iid'] . '" LIMIT 1'); - $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": "' . $i['name'] . '" (x' . $x . ') [#' . $i['iid'] . '] ' . $price . ' .', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); + $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": Приобрел предмет "' . $i['name'] . '" (x' . $x . ') [#' . $i['iid'] . '] за ' . $price . ' репутации.', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); } else { - // - $r = ' "' . $i['name'] . '". "' . $this->city_name[$this->info['city']] . '" ' . $price . ' .
.'; - $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": #' . $i['iid'] . '. : ' . $price . ' . ', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); + //Записываем в личное дело что предмет не получен + $r = 'Вам не удалось приобрести "' . $i['name'] . '". Администрация магазина в "' . $this->city_name[$this->info['city']] . '" должна Вам ' . $price . ' репутации.
Приносим свои извинения за неудобства.'; + $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": не удалось приобрести предмет #' . $i['iid'] . '. К возрату: ' . $price . ' репутации. ', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); if (!$ld) { - echo '
, /db/usersDelo/!
'; + echo '
Ошибка, невозможно добавить запись в /db/usersDelo/!
'; } } } else { - $r = ' ...'; + $r = 'Вам не удалось приобрести предмет...'; } } } elseif ($i['price_3'] > 0) { @@ -2987,7 +2476,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $trn = 1; } - if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // + if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // Требуемая репутация для покупки $need_rep = 0; $tr_rep = $this->lookStats($i['tr_reputation']); foreach ($tr_rep as $row) { @@ -3006,21 +2495,21 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } if ($i['max_buy'] < $x && $i['max_buy'] > 0) { - $r = ' ' . $i['max_buy'] . ' .'; + $r = 'Для покупки доступно ' . $i['max_buy'] . ' шт.'; } elseif ($need_rep > 0) { - $r = ' , .'; + $r = 'Вы не заслужили нашего доверия, мы не продадим вам этот товар.'; } elseif ($mxby == -1) { - $r = ' '; + $r = 'Максимальное количество покупок для данного предмета исчерпана'; } elseif ($trn == 0 && $this->info['admin'] == 0) { - $r = ' ( ' . $trnt . ')'; + $r = 'У вас недостаточно требуемых предметов (не хватает ' . $trnt . ')'; } elseif ($i['price_3'] * $x > $this->info['money3']) { - $r = ' ( ' . ($price - $this->info['money3']) . ' $)'; + $r = 'У вас недостаточно валюты (не хватает ' . ($price - $this->info['money3']) . ' $)'; } else { $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "' . $i['id'] . '" LIMIT 1')); $this->info['money3'] -= $price; $upd = mysql_query('UPDATE `users` SET `money3` = "' . mysql_real_escape_string($this->info['money3']) . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); if ($upd) { - // + //новая дата $data = ''; $data .= $d['data']; if ($mdata != null) { @@ -3056,36 +2545,36 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $ix++; } if ($ins) { - // + //Записываем в личное дело что предмет получен if ($trnt != '' && $i['tr_items'] != '') { $trnt = ', ' . $trnt; } - $r = ' "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') ' . $price . ' $. ' . $trnt . '
.'; + $r = 'Вы приобрели предмет "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') за ' . $price . ' $. ' . $trnt . '
Предмет успешно добавлен в инвентарь.'; $j = 0; while ($j < count($detrn)) { $ost = ((int)$detrn[$j][1]); $s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "' . ((int)$detrn[$j][0]) . '" AND `uid` = "' . $this->info['id'] . '" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT ' . ((int)$detrn[$j][1]) . ''); while ($itm = mysql_fetch_array($s4)) { - // + //удаляем предмет mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'); } $j++; } - //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','',' ! ".$this->info['login']." "".$i['name']."" , !','-1','5','0')"); + //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','Артефактный магазин! Персонаж ".$this->info['login']." приобрел предмет "".$i['name']."" , Поздравляем с удачной покупкой!','-1','5','0')"); mysql_query('UPDATE `items_shop` SET `kolvo` = "' . ($i['kolvo'] - $x) . '" WHERE `iid` = "' . $i['iid'] . '" LIMIT 1'); - $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": "' . $i['name'] . '" (x' . $x . ') [#' . $i['iid'] . '] ' . $price . ' $', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); + $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": Приобрел предмет "' . $i['name'] . '" (x' . $x . ') [#' . $i['iid'] . '] за ' . $price . ' $', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); } else { - // - $r = ' "' . $i['name'] . '". "' . $this->city_name[$this->info['city']] . '" ' . $price . ' $
.'; - $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": #' . $i['iid'] . '. : ' . $price . ' $ ', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); + //Записываем в личное дело что предмет не получен + $r = 'Вам не удалось приобрести "' . $i['name'] . '". Администрация магазина в "' . $this->city_name[$this->info['city']] . '" должна Вам ' . $price . ' $
Приносим свои извинения за неудобства.'; + $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": не удалось приобрести предмет #' . $i['iid'] . '. К возрату: ' . $price . ' $ ', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); if (!$ld) { - echo '
, /db/usersDelo/!
'; + echo '
Ошибка, невозможно добавить запись в /db/usersDelo/!
'; } } } else { - $r = ' ...'; + $r = 'Вам не удалось приобрести предмет...'; } } } elseif ($sid == 2 || $sid == 777) { @@ -3102,14 +2591,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $i['price_2'] = round($i['price_2'] / 20, 2); } - // 5% + //Скидка в государственный магазин 5% if ($this->stats['silver'] >= 1) { if ($sid == 2) { $i['price_1'] = round($i['price_1'] / 100 * 95, 2); } } - // 5% + //Скидка в березку магазин 5% if ($this->stats['silver'] >= 5) { if ($sid == 2) { $i['price_2'] = round($i['price_2'] / 100 * 95, 2); @@ -3126,11 +2615,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } if ($i['max_buy'] < $x && $i['max_buy'] > 0) { - $r = ' ' . $i['max_buy'] . ' .'; + $r = 'Для покупки доступно ' . $i['max_buy'] . ' шт.'; } elseif ($mxby == -1) { - $r = ' '; + $r = 'Максимальное количество покупок для данного предмета исчерпана'; } elseif ($i['price_2'] * $x > $this->info['money2']) { - $r = ' ( ' . ($price - $this->info['money2']) . ' .)'; + $r = 'У вас недостаточно денег на счете (не хватает ' . ($price - $this->info['money2']) . ' екр.)'; } else { $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "' . $i['id'] . '" LIMIT 1')); $this->info['money2'] -= $price; @@ -3138,7 +2627,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($upd) { $this->info['frg'] += $price; mysql_query('UPDATE `users` SET `frg` = "' . floor($this->info['frg']) . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - // + //новая дата $data = ''; $data .= $d['data']; $i['time_create'] = time(); @@ -3181,23 +2670,23 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $ix++; } if ($ins) { - // - $r = ' "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') ' . $price . ' .
.'; + //Записываем в личное дело что предмет получен + $r = 'Вы приобрели предмет "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') за ' . $price . ' екр.
Предмет успешно добавлен в инвентарь.'; mysql_query('UPDATE `items_shop` SET `kolvo` = "' . ($i['kolvo'] - $x) . '" WHERE `iid` = "' . $i['iid'] . '" LIMIT 1'); - $ld = $this->addDelo(1, $this->info['id'], '"EkrShop.' . $this->info['city'] . '": "' . $i['name'] . '" (x' . $x . ',add items ' . $gix . ') [#' . $i['iid'] . '] ' . $price . ' .', time(), $this->info['city'], 'EkrShop.' . $this->info['city'] . '', (int)$price, 0); + $ld = $this->addDelo(1, $this->info['id'], '"EkrShop.' . $this->info['city'] . '": Приобрел предмет "' . $i['name'] . '" (x' . $x . ',add items ' . $gix . ') [#' . $i['iid'] . '] за ' . $price . ' екр.', time(), $this->info['city'], 'EkrShop.' . $this->info['city'] . '', (int)$price, 0); } else { - // - $r = ' "' . $i['name'] . '". "' . $this->city_name[$this->info['city']] . '" ' . $price . ' .
.'; - $ld = $this->addDelo(1, $this->info['id'], '"EkrShop.' . $this->info['city'] . '": #' . $i['iid'] . '. : ' . $price . ' .', time(), $this->info['city'], 'EkrShop.' . $this->info['city'] . '', 0, 0); + //Записываем в личное дело что предмет не получен + $r = 'Вам не удалось приобрести "' . $i['name'] . '". Администрация магазина в "' . $this->city_name[$this->info['city']] . '" должна Вам ' . $price . ' екр.
Приносим свои извинения за неудобства.'; + $ld = $this->addDelo(1, $this->info['id'], '"EkrShop.' . $this->info['city'] . '": не удалось приобрести предмет #' . $i['iid'] . '. К возрату: ' . $price . ' екр.', time(), $this->info['city'], 'EkrShop.' . $this->info['city'] . '', 0, 0); if (!$ld) { - echo '
, /db/usersDelo/!
'; + echo '
Ошибка, невозможно добавить запись в /db/usersDelo/!
'; } } } else { - $r = ' ...'; + $r = 'Вам не удалось приобрести предмет...'; } } - } elseif (($sid >= 700 && $sid <= 730) /*OR ( $sid >= 800 && $sid <=805 )*/) { // nalpva2.php , , . + } elseif (($sid >= 700 && $sid <= 730) /*OR ( $sid >= 800 && $sid <=805 )*/) { // nalpva2.php Покупаем предмет, и перемещаем в него Чарку, Руну и прочее. if ($i['kolvo'] < $x) $x = $i['kolvo']; if ($x < 1) $x = 1; if ($i['price_1'] <= 0 && $i['tr_items'] == '') $i['price_1'] = $i['price1']; @@ -3236,7 +2725,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $trn = 1; } - if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // + if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // Требуемая репутация для покупки $need_rep = 0; $tr_rep = $this->lookStats($i['tr_reputation']); foreach ($tr_rep as $row) { @@ -3255,17 +2744,17 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } if ($i['max_buy'] < $x && $i['max_buy'] > 0) { - $r = ' ' . $i['max_buy'] . ' .'; + $r = 'Для покупки доступно ' . $i['max_buy'] . ' шт.'; } elseif ($need_rep > 0) { - $r = ' , .'; + $r = 'Вы не заслужили нашего доверия, мы не продадим вам этот товар.'; } elseif ($i['price_1'] * $x > $this->info['money4'] && $zuby == 1) { - $r = ' .'; + $r = 'У вас недостаточно денег.'; } elseif ($mxby == -1) { - $r = '
: ' . $i['max_buy'] . ' .'; + $r = 'Максимальное количество покупок для данного предмета исчерпана
Возможно купить: ' . $i['max_buy'] . ' шт.'; } elseif ($trn == 0 && $this->info['admin'] == 0) { - $r = ' ( ' . $trnt . ')'; + $r = 'У вас недостаточно требуемых предметов (не хватает ' . $trnt . ')'; } elseif ($i['price_1'] * $x > $this->info['money'] && $zuby == 0) { - $r = ' ( ' . ($price - $this->info['money']) . ' .)'; + $r = 'У вас недостаточно денег (не хватает ' . ($price - $this->info['money']) . ' кр.)'; } else { $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "' . $i['id'] . '" LIMIT 1')); if ($zuby == 0) { @@ -3273,7 +2762,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $upd = mysql_query('UPDATE `users` SET `money` = "' . mysql_real_escape_string(round($this->info['money'], 2)) . '",`money4` = "' . mysql_real_escape_string(round($this->info['money4'], 2)) . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); if ($upd) { - // + //новая дата $data = ''; $data .= $d['data']; if ($mdata != null) { @@ -3334,11 +2823,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } if ($c_itm > 0) { $data = $this->lookStats($data); - // + // Чарка if (isset($c_itm_data_a['spell_st_name']) && isset($c_itm_data_a['spell_st_val']) && $c_itm_data_a['spell_st_name'] != '' && $c_itm_data_a['spell_st_val'] != '') { $data['add_' . $c_itm_data_a['spell_st_name']] = (int)(isset($data['add_' . $c_itm_data_a['spell_st_name']]) ? (int)$data['add_' . $c_itm_data_a['spell_st_name']] : 0) + (int)$c_itm_data_a['spell_st_val']; } - // + // Руна if (isset($c_itm_data_a['rune']) && $c_itm_data_a['rune'] > 0) { $ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "' . $c_itm_data_a['rune_id'] . '" LIMIT 1')); @@ -3394,15 +2883,15 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $ix++; } if ($ins) { - // + //Записываем в личное дело что предмет получен if ($trnt != '' && $i['tr_items'] != '') { $trnt = ', ' . $trnt; } if ($zuby == 0) { - $r = ' "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') ' . $price . ' . ' . $trnt . '
.'; + $r = 'Вы приобрели предмет "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') за ' . $price . ' кр. ' . $trnt . '
Предмет успешно добавлен в инвентарь.'; } else { - $r = ' "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') ' . $this->zuby($price) . '. ' . $trnt . '
.'; + $r = 'Вы приобрели предмет "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') за ' . $this->zuby($price) . '. ' . $trnt . '
Предмет успешно добавлен в инвентарь.'; } $j = 0; @@ -3410,27 +2899,27 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $ost = ((int)$detrn[$j][1]); $s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "' . ((int)$detrn[$j][0]) . '" AND `uid` = "' . $this->info['id'] . '" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT ' . ((int)$detrn[$j][1]) . ''); while ($itm = mysql_fetch_array($s4)) { - // + //удаляем предмет mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'); } $j++; } mysql_query('UPDATE `items_shop` SET `kolvo` = "' . ($i['kolvo'] - $x) . '" WHERE `iid` = "' . $i['iid'] . '" LIMIT 1'); - $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": "' . $i['name'] . '" (x' . $x . ') [#' . $i['iid'] . '] ' . $price . ' .', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); + $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": Приобрел предмет "' . $i['name'] . '" (x' . $x . ') [#' . $i['iid'] . '] за ' . $price . ' кр.', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); } else { - // - $r = ' "' . $i['name'] . '". "' . $this->city_name[$this->info['city']] . '" ' . $price . ' .
.'; - $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": #' . $i['iid'] . '. : ' . $price . ' .', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); + //Записываем в личное дело что предмет не получен + $r = 'Вам не удалось приобрести "' . $i['name'] . '". Администрация магазина в "' . $this->city_name[$this->info['city']] . '" должна Вам ' . $price . ' кр.
Приносим свои извинения за неудобства.'; + $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": не удалось приобрести предмет #' . $i['iid'] . '. К возрату: ' . $price . ' кр.', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); if (!$ld) { - echo '
, /db/usersDelo/!
'; + echo '
Ошибка, невозможно добавить запись в /db/usersDelo/!
'; } } } else { - $r = ' ...'; + $r = 'Вам не удалось приобрести предмет...'; } } - } else { // + } else { // Стандартная покупка предмета if ($i['kolvo'] < $x) { $x = $i['kolvo']; } @@ -3444,14 +2933,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $i['price_2'] = $i['price2']; } - // 5% + //Скидка в государственный магазин 5% if ($this->stats['silver'] >= 1) { if ($sid == 1) { $i['price_1'] = round($i['price_1'] / 100 * 95, 2); } } - // 5% + //Скидка в березку магазин 5% if ($this->stats['silver'] >= 5) { if ($sid == 2) { $i['price_2'] = round($i['price_2'] / 100 * 95, 2); @@ -3492,7 +2981,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $trn = 1; } - if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // + if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // Требуемая репутация для покупки $need_rep = 0; $tr_rep = $this->lookStats($i['tr_reputation']); foreach ($tr_rep as $key => $val) { @@ -3519,25 +3008,25 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $po = $this->lookStats($d['data']); if ($zuby == 1 && $po['tr_lvl'] > 7) { - $r = ' .'; + $r = 'Данный предмет нельзя приобрести за зубы.'; } elseif (!isset($this->sid_zuby[$sid]) && $zuby == 1) { - $r = ' .'; + $r = 'Данный предмет нельзя приобрести за зубы.'; } elseif ($zuby == 1 && $i['nozuby'] == 1) { - $r = ' .'; + $r = 'Данный предмет нельзя приобрести за зубы.'; } elseif ($i['max_buy'] < $x && $i['max_buy'] > 0) { - $r = ' ' . $i['max_buy'] . ' .'; + $r = 'Для покупки доступно ' . $i['max_buy'] . ' шт.'; } elseif (isset($need_rep) && $need_rep == 0) { - $r = ' , .'; + $r = 'Вы не заслужили нашего доверия, мы не продадим вам этот товар.'; } elseif ($zuby == 1 && $this->info['money4'] < $i['price_1']) { - $r = ' .'; + $r = 'У вас недостаточно зубов.'; } elseif ($i['price_1'] * $x > $this->info['money4'] && $zuby == 1) { - $r = ' .'; + $r = 'У вас недостаточно денег.'; } elseif ($mxby == -1) { - $r = '
: ' . $i['max_buy'] . ' .'; + $r = 'Максимальное количество покупок для данного предмета исчерпана
Возможно купить: ' . $i['max_buy'] . ' шт.'; } elseif ($trn == 0 && $this->info['admin'] == 0) { - $r = ' ( ' . $trnt . ')'; + $r = 'У вас недостаточно требуемых предметов (не хватает ' . $trnt . ')'; } elseif ($i['price_1'] * $x > $this->info['money'] && $zuby == 0) { - $r = ' ( ' . ($price - $this->info['money']) . ' .)'; + $r = 'У вас недостаточно денег (не хватает ' . ($price - $this->info['money']) . ' кр.)'; } else { if ($zuby == 0) { $this->info['money'] -= $price; @@ -3546,7 +3035,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $upd = mysql_query('UPDATE `users` SET `money` = "' . mysql_real_escape_string(round($this->info['money'], 2)) . '",`money4` = "' . mysql_real_escape_string(round($this->info['money4'], 2)) . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); if ($upd) { - // + //новая дата $data = ''; $data .= $d['data']; $data = str_replace('sudba=1', 'sudba=' . $this->info['login'], $data); @@ -3599,15 +3088,15 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $ix++; } if ($ins) { - // + //Записываем в личное дело что предмет получен if ($trnt != '' && $i['tr_items'] != '') { $trnt = ', ' . $trnt; } if ($zuby == 0) { - $r = ' "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') ' . $price . ' . ' . $trnt . '
.'; + $r = 'Вы приобрели предмет "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') за ' . $price . ' кр. ' . $trnt . '
Предмет успешно добавлен в инвентарь.'; } else { - $r = ' "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') ' . $this->zuby($price) . '. ' . $trnt . '
.'; + $r = 'Вы приобрели предмет "' . $i['name'] . '" (x' . $x . ' / ' . $gix . ') за ' . $this->zuby($price) . '. ' . $trnt . '
Предмет успешно добавлен в инвентарь.'; } $zx = 0; @@ -3616,14 +3105,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if (($sid == 1 || $sid == 5) && $i['level'] >= 4 && round($price / $x) > 25) { if ($this->stats['shopSale'] == 0 && $c['nosanich'] == false) { - // - $prmn = 0; // + //Выдаем странички Саныча в гос магазине и канаве + $prmn = 0; //дополнительный бонус $prmn = (1 - (pow(0.5, ($price / $x / 200)))) * 100; $prmn = round(20 / 100 * $prmn); if (rand(0, 100) < 20 + $prmn && rand(0, 100) > 80 - $prmn) { //3143 - 3192 if (rand(0, 100) < 20 + $prmn && rand(0, 100) > 80 - $prmn) { - // + //обложка $gitm = rand(3193, 3195); } else { $gitm = rand(3143, 3192); @@ -3632,7 +3121,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $gitm = 3194; } if ($sid == 5) { - // + //привязываем судьбой } $this->addItem($gitm, $this->info['id']); $rs++; @@ -3644,19 +3133,19 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($rs > 1) { if (rand(0, 1) == 1) { - $r .= ' - . (x' . $rs . ')'; + $r .= ' Предмет был завернут в какую-то бумажку. (x' . $rs . ')'; } elseif (rand(0, 1)) { - $r .= ' . (x' . $rs . ')'; + $r .= ' Предмет был завернут в странный свиток. (x' . $rs . ')'; } else { - $r .= ' - . (x' . $rs . ')'; + $r .= ' К предмету была прикреплена какая-та бумажка. (x' . $rs . ')'; } } elseif ($rs > 0) { if (rand(0, 1) == 1) { - $r .= ' - .'; + $r .= ' Предмет был завернут в какую-то бумажку.'; } elseif (rand(0, 1)) { - $r .= ' .'; + $r .= ' Предмет был завернут в странный свиток.'; } else { - $r .= ' - .'; + $r .= ' К предмету была прикреплена какая-та бумажка.'; } } @@ -3666,7 +3155,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $ost = ((int)$detrn[$j][1]); $s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "' . ((int)$detrn[$j][0]) . '" AND `uid` = "' . $this->info['id'] . '" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT ' . ((int)$detrn[$j][1]) . ''); while ($itm = mysql_fetch_array($s4)) { - // + //удаляем предмет mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'); } $j++; @@ -3676,24 +3165,24 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` mysql_query('UPDATE `items_shop` SET `kolvo` = "' . ($i['kolvo'] - $x) . '" WHERE `iid` = "' . $i['iid'] . '" LIMIT 1'); $zuby_inf = ''; if ($zuby == 1) { - $zuby_inf = ' ( )'; + $zuby_inf = ' (За зубы)'; } - $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": "' . $i['name'] . '" (x' . $x . ') [#' . $i['iid'] . '] ' . $price . ' .' . $zuby_inf . '', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); + $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": Приобрел предмет "' . $i['name'] . '" (x' . $x . ') [#' . $i['iid'] . '] за ' . $price . ' кр.' . $zuby_inf . '', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); } else { - // - $r = ' "' . $i['name'] . '". "' . $this->city_name[$this->info['city']] . '" ' . $price . ' .
.'; - $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": #' . $i['iid'] . '. : ' . $price . ' .', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); + //Записываем в личное дело что предмет не получен + $r = 'Вам не удалось приобрести "' . $i['name'] . '". Администрация магазина в "' . $this->city_name[$this->info['city']] . '" должна Вам ' . $price . ' кр.
Приносим свои извинения за неудобства.'; + $ld = $this->addDelo(1, $this->info['id'], '"Shop.' . $this->info['city'] . '": не удалось приобрести предмет #' . $i['iid'] . '. К возрату: ' . $price . ' кр.', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); if (!$ld) { - echo '
, /db/usersDelo/!
'; + echo '
Ошибка, невозможно добавить запись в /db/usersDelo/!
'; } } } else { - $r = ' ...'; + $r = 'Вам не удалось приобрести предмет...'; } } } } else { - $r = ' '; + $r = 'Предмет не найден на прилавке'; } return '
' . $r . '
'; } @@ -3706,7 +3195,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` mysql_query('INSERT INTO `aaa_bonus` (`uid`,`time`) VALUES ( "'.$this->info['id'].'","'.(time()+1*3600).'" )'); - $this->error = ' 25 .';*/ + $this->error = 'Вам зачислено 25 кр.';*/ } else { if ($_GET['getb1w'] == 3) { $pensia1 = $this->pensia(false); @@ -3723,7 +3212,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $this->info['money2'] += $pensia2[1]; mysql_query('UPDATE `users` SET `money2` = `money2` + "' . $pensia2[1] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); } - $this->error = ' ' . $pensia1 . '! '; + $this->error = 'Вам начислен бонус в размере ' . $pensia1 . '! '; mysql_query('INSERT INTO `aaa_bonus` ( `uid`,`time`,`afk`,`type`,`money` ) VALUES ( @@ -3772,7 +3261,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $price = $i2['1price']; if (isset($i2['id']) && isset($iid) && $sid == 1 && $i2['inShop'] == 30) { if ($price > $this->info['money']) - $r = ' ( ' . ($price - $this->info['money']) . ' .)'; + $r = 'У вас недостаточно денег (не хватает ' . ($price - $this->info['money']) . ' кр.)'; else { $UpdMoney = mysql_query('UPDATE `users` SET `money` = "' . mysql_real_escape_string(round($this->info['money'] - $price, 2)) . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); if ($UpdMoney) { @@ -3786,31 +3275,31 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } else { $UpItems = mysql_query('UPDATE `items_users` SET `uid` = ' . $this->info['id'] . ', `1price` = "' . $i1['price1'] . '", `lastUPD` = "' . time() . '", `inShop` = 0 WHERE `id` = "' . $iid . '" AND `inOdet` = "0" AND `delete` = "0" AND `uid`="' . $i2['uid'] . '" LIMIT 1'); } - // + //Вставляем функцию передачи кредитов владельцу предмета if ($UpItems) { - // - $r = ' "' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '" ' . $price . ' .
.'; - $ld = $this->addDelo(1, $this->info['id'], '"ComissShop.' . $this->info['city'] . '": "' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '" [item:' . $iid . '] ' . $price . ' . [: ' . ($i2['login'] != '' ? '' . $i2['login'] . '' : '(' . $i2['uid'] . ')') . ']', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', $price, 0); + //Записываем в личное дело что предмет получен + $r = 'Вы приобрели предмет "' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '" за ' . $price . ' кр.
Предмет успешно добавлен в инвентарь.'; + $ld = $this->addDelo(1, $this->info['id'], '"ComissShop.' . $this->info['city'] . '": Приобрел предмет "' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '" [item:' . $iid . '] в коммисионном магазине за ' . $price . ' кр. [Продавец: ' . ($i2['login'] != '' ? '' . $i2['login'] . '' : '(' . $i2['uid'] . ')') . ']', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', $price, 0); $u2s = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $i2['uid'] . '" LIMIT 1')); - $ld = $this->addDelo(1, $u2s['id'], '"ComissShop.' . $this->info['city'] . '": "' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '" [item:' . $iid . '] ' . $price . ' . [: ' . $this->info['login'] . ']', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', 0, $price); + $ld = $this->addDelo(1, $u2s['id'], '"ComissShop.' . $this->info['city'] . '": Продал предмет "' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '" [item:' . $iid . '] через коммисионный магазине за ' . $price . ' кр. [Покупатель: ' . $this->info['login'] . ']', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', 0, $price); } else { - // - $r = ' "' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '". "' . $this->city_name[$this->info['city']] . '" ' . $price . ' .
.'; - $ld = $this->addDelo(1, $this->info['id'], '"EkrShop.' . $this->info['city'] . '": #' . $i1['iid'] . '. : ' . $price . ' .', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); - if (!$ld) echo '
, /db/usersDelo/!
'; + //Записываем в личное дело что предмет не получен + $r = 'Вам не удалось приобрести "' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '". Администрация магазина в "' . $this->city_name[$this->info['city']] . '" должна Вам ' . $price . ' екр.
Приносим свои извинения за неудобства.'; + $ld = $this->addDelo(1, $this->info['id'], '"EkrShop.' . $this->info['city'] . '": не удалось приобрести предмет #' . $i1['iid'] . '. К возрату: ' . $price . ' кр.', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0); + if (!$ld) echo '
Ошибка, невозможно добавить запись в /db/usersDelo/!
'; } } else { - $r = ' ...'; + $r = 'Вам не удалось приобрести предмет...'; } } } else - $r = ' '; + $r = 'Предмет не найден на прилавке'; return '
' . $r . '
'; } public function commisonRent($action, $iid, $price = null) { - if ($action == " " && isset($iid) && $price > 0) { + if ($action == "Сдать в магазин" && isset($iid) && $price > 0) { $ChImtem = mysql_fetch_array(mysql_query('SELECT `id`, `item_id`, `data`, `inGroup`, `uid` FROM `items_users` WHERE `id` = ' . $iid . ' LIMIT 1')); $ChSudba = $this->lookStats($ChImtem['data']); if (isset($ChSudba['sudba']) || $ChSudba['sudba'] != 0 || $ChSudba['sudba'] == 1 || isset($ChSudba['toclan'])) { @@ -3827,7 +3316,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` mysql_query('UPDATE `items_users` set `inShop` = 30, `1price` = ' . $price . ' where `uid` = "' . $this->info['id'] . '" AND `id` = "' . $iid . '" AND `inOdet` = "0" AND `delete` = "0" '); } } - } elseif ($action == "" && isset($iid)) { + } elseif ($action == "Забрать" && isset($iid)) { $i = mysql_fetch_array(mysql_query('SELECT `im`.`price1`,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "' . $iid . '" AND `iu`.`inShop` = "30" AND `iu`.`delete` = "0" LIMIT 1')); if (isset($i['inGroup']) and $i['inGroup'] > 0) { $col = $this->itemsX($i['id']); @@ -3891,7 +3380,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` // if( $typeOtdel == 1050 ) { - // + //Просмотр прочего if($preview == "full") { }else{ @@ -3922,7 +3411,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` '); } }else{ - // + //Вывод общего списка предметов if($preview == "full") { }else{ @@ -3941,20 +3430,20 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if($preview == "full") { }else{ - // + //Отоюражение в разделах //$pvr1 = mysql_fetch_array(mysql_query('SELECT `1price` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `1price` ASC LIMIT 1')); //$pvr2 = mysql_fetch_array(mysql_query('SELECT `1price` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `1price` DESC LIMIT 1')); // - $is2 .= ''.$pl['name'].'   (: '.$pl['massa'].')'; - //$is2 .= '
: '.$pvr1[0].'-'.$pvr2[0].' . (: 0)'; + $is2 .= ''.$pl['name'].'   (Масса: '.$pl['massa'].')'; + //$is2 .= '
Цена: '.$pvr1[0].'-'.$pvr2[0].' кр. (количество: 0)'; // //$pvr1 = mysql_fetch_array(mysql_query('SELECT `iznosNOW`,`iznosMAX` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `iznosNOW` ASC LIMIT 1')); //$pvr2 = mysql_fetch_array(mysql_query('SELECT `iznosNOW`,`iznosMAX` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `iznosNOW` DESC LIMIT 1')); // - //$is2 .= '
: '.floor($pvr1[0]).'-'.floor($pvr1[1]).'/'.floor($pvr2[0]).'-'.floor($pvr2[1]).''; + //$is2 .= '
Долговечность: '.floor($pvr1[0]).'-'.floor($pvr1[1]).'/'.floor($pvr2[0]).'-'.floor($pvr2[1]).''; // $is1 .= '
'; - $is1 .= '
'; + $is1 .= 'подробнее
'; } echo ''.$is1.''.$is2.''; if( $cr == 'c8c8c8' ) { @@ -3966,7 +3455,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } // if( $i == 0 ) { - echo ' '; + echo 'Прилавок магазина пуст'; } // //* * * * * * * * * * * @@ -4095,7 +3584,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); $i = 0; $steckCikl = 1; while ($pl = mysql_fetch_array($cl)) { - // + // количетсво одинаковых предметов в комке if ($preview == "preview") { //$steck = mysql_fetch_array(mysql_query('SELECT COUNT(`item_id`) FROM `items_users` WHERE `item_id` = "'.$pl['item_id'].'" AND `inShop` = 30 LIMIT 1')); $steck = ['--', '--', '--', '--']; @@ -4117,7 +3606,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); $po = $this->lookStats($pl['data']); } if (($pl['type'] >= 18 && $pl['type'] <= 24) || $pl['type'] == 26 || $pl['type'] == 27) { - // + + //Зоны блока + if ($pl['inOdet'] != 14) { $po['zonb']++; } @@ -4125,11 +3614,11 @@ ORDER BY `1price`ASC , inGroupCount DESC'); $is2 = ''; $is1 = '
'; if ($preview == "full") { - $is1 .= ' '; + $is1 .= 'купить '; } elseif ($preview == "preview") { - $is1 .= ' '; + $is1 .= 'Просмотреть '; } - // + //название $col = $this->itemsX($pl[0]); if ($col > 1 && $pl['inGroup'] != 0 && $pl['inGroupCount'] > 1) { @@ -4138,41 +3627,41 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } $is2 .= '' . $pl['name'] . '    '; if ($pl['massa'] > 0 && $preview == "full") { - $is2 .= '(: ' . round($pl['massa'], 2) . ')'; + $is2 .= '(Масса: ' . round($pl['massa'], 2) . ')'; if ($pl['gift'] != '') { $ttl = ''; if ($pl['gift'] == 1) { - $ttl = ' -'; + $ttl = 'Вы не можете передать этот предмет кому-либо'; } else { - $ttl = ' ' . $pl['gift'] . '. - '; + $ttl = 'Этот предмет подарил ' . $pl['gift'] . '. Вы не сможете передать этот предмет кому-либо еще'; } $is2 .= ' '; } if (isset($po['art'])) { - $is2 .= ' '; + $is2 .= ' '; } if (isset($po['sudba'])) { if ($po['sudba'] == '0') { - $is2 .= ' '; + $is2 .= ' '; } elseif ($po['sudba'] == '1') { - $is2 .= ' '; + $is2 .= ' '; } else { - $is2 .= ' '; + $is2 .= ' '; } } } - // - $is2 .= '
: '; + //цена + $is2 .= '
Цена: '; if ($steck[0] > 1 && $preview == "preview") { - $is2 .= $steck[3] . '-' . $steck[4] . ' . '; + $is2 .= $steck[3] . '-' . $steck[4] . ' кр.
'; } else { - $is2 .= $pl['1price'] . ' . '; + $is2 .= $pl['1price'] . ' кр. '; } if ($pl['pricerep'] > 0) { - $is2 .= ' (' . round($pl['pricerep'], 2) . ' )'; + $is2 .= ' (' . round($pl['pricerep'], 2) . ' Воинственности)'; } - // + //долговечность if ($pl['iznosMAX'] > 0) { $izcol = ''; if (floor($pl['iznosNOW']) >= (floor($pl['iznosMAX']) - ceil($pl['iznosMAX']) / 100 * 20)) { @@ -4180,41 +3669,41 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } } if ($preview == "preview") { - $is2 .= '
: ' . floor($steck[1]) . '/' . ceil($steck[2]) . ''; + $is2 .= '
Долговечность: ' . floor($steck[1]) . '/' . ceil($steck[2]) . ''; } else { if ($pl['iznosMAXi'] == 999999999) { - $is2 .= '
: '; + $is2 .= '
Долговечность: неразрушимо'; } else { - $is2 .= '
: ' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']) . ''; + $is2 .= '
Долговечность: ' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']) . ''; } } - // + //Срок годности предмета if ($po['srok'] > 0) { $pl['srok'] = $po['srok']; } if ($pl['srok'] > 0 and $preview != "preview") { if ($pl['time_create'] + $pl['srok'] < time()) { - $is2 .= '
: ' . $this->timeOut($pl['srok']) . ' ()'; + $is2 .= '
Срок годности: ' . $this->timeOut($pl['srok']) . ' (испорчен)'; } else { - $is2 .= '
: ' . $this->timeOut($pl['srok']) . ' ( ' . date('d.m.Y H:i', $pl['time_create'] + $pl['srok']) . ')'; + $is2 .= '
Срок годности: ' . $this->timeOut($pl['srok']) . ' (до ' . date('d.m.Y H:i', $pl['time_create'] + $pl['srok']) . ')'; } } elseif ($pl['srok'] > 0) { - $is2 .= '
: ' . $this->timeOut($pl['srok']); + $is2 .= '
Срок годности: ' . $this->timeOut($pl['srok']); } if ($pl['magic_chance'] > 0) { - $is2 .= '
: ' . min([$pl['magic_chance'], 100]) . '%'; + $is2 .= '
Вероятность срабатывания: ' . min([$pl['magic_chance'], 100]) . '%'; } - // : + //Продолжительность действия магии: if ((int)$pl['magic_inci'] > 0) { $efi = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`type1`,`img`,`mdata`,`actionTime`,`type2`,`type3`,`onlyOne`,`oneType`,`noAce`,`see`,`info`,`overch`,`bp`,`noch` FROM `eff_main` WHERE `id2` = "' . ((int)$pl['magic_inci']) . '" LIMIT 1')); if (isset($efi['id2']) && $efi['actionTime'] > 0) { - $is2 .= '
: ' . $this->timeOut($efi['actionTime']); + $is2 .= '
Продолжительность действия: ' . $this->timeOut($efi['actionTime']); } } if ($preview == "full" || $preview == "preview") { - // : + //Требуется минимальное: $tr = ''; $t = $this->items['tr']; $x = 0; @@ -4234,7 +3723,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); $notr++; } } - $tr .= '
'; + $tr .= '
• '; if ($n == 'rep') { $temp = explode('::', $po['tr_' . $n]); $tr .= $this->is[$n] . ' ' . ucfirst(str_replace('city', ' city', $temp[1])) . ': ' . $temp[0]; @@ -4242,9 +3731,9 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } elseif ($n != 'align') { if ($n == 'sex') { if ($po['tr_' . $n] == 1) { - $tr .= $this->is[$n] . ': '; + $tr .= $this->is[$n] . ': Женский'; } else { - $tr .= $this->is[$n] . ': '; + $tr .= $this->is[$n] . ': Мужской'; } } else { $tr .= $this->is[$n] . ': ' . $po['tr_' . $n]; @@ -4262,9 +3751,9 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } if ($tr != '') { - $is2 .= '
:' . $tr; + $is2 .= '
Требуется минимальное:' . $tr; } - // : + //Действует на: $tr = ''; $t = $this->items['add']; $x = 0; @@ -4275,13 +3764,13 @@ ORDER BY `1price`ASC , inGroupCount DESC'); if ($po['add_' . $n] < 0) { $z = ''; } - $tr .= '
' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n]; + $tr .= '
• ' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n]; } $x++; } - // () + //действует на (броня) $i = 1; - $bn = [1 => '', 2 => '', 3 => '', 4 => '']; + $bn = [1 => 'головы', 2 => 'корпуса', 3 => 'пояса', 4 => 'ног']; while ($i <= 4) { if (isset($po['add_mab' . $i])) { if ($po['add_mab' . $i] == $po['add_mib' . $i] && $pl['geniration'] == 1) { @@ -4289,21 +3778,21 @@ ORDER BY `1price`ASC , inGroupCount DESC'); if ($po['add_mab' . $i] < 0) { $z = ''; } - $tr .= '
' . $bn[$i] . ': ' . $z . '' . $po['add_mab' . $i]; + $tr .= '
• Броня ' . $bn[$i] . ': ' . $z . '' . $po['add_mab' . $i]; } else { - $tr .= '
' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i] . ' (' . $this->bronFx([$po['add_mib' . $i], $po['add_mab' . $i]]) . ')'; + $tr .= '
• Броня ' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i] . ' (' . $this->bronFx([$po['add_mib' . $i], $po['add_mab' . $i]]) . ')'; } } $i++; } if ($tr != '') { - $is2 .= '
:' . $tr; + $is2 .= '
Действует на:' . $tr; } - // : + //Свойства предмета: $tr = ''; $t = $this->items['sv']; if (isset($po['sv_yron_min'], $po['sv_yron_max'])) { - $tr .= '
: ' . $po['sv_yron_min'] . ' - ' . $po['sv_yron_max']; + $tr .= '
• Урон: ' . $po['sv_yron_min'] . ' - ' . $po['sv_yron_max']; } $x = 0; while ($x < count($t)) { @@ -4313,18 +3802,18 @@ ORDER BY `1price`ASC , inGroupCount DESC'); if ($po['sv_' . $n] < 0) { $z = ''; } - $tr .= '
' . $this->is[$n] . ': ' . $z . '' . $po['sv_' . $n]; + $tr .= '
• ' . $this->is[$n] . ': ' . $z . '' . $po['sv_' . $n]; } $x++; } if ($pl['2too'] == 1) { - $tr .= '
'; + $tr .= '
• Второе оружие'; } if ($pl['2h'] == 1) { - $tr .= '
'; + $tr .= '
• Двуручное оружие'; } if (isset($po['zonb'])) { - $tr .= '
: '; + $tr .= '
• Зоны блокирования: '; if ($po['zonb'] > 0) { $x = 1; while ($x <= $po['zonb']) { @@ -4332,72 +3821,72 @@ ORDER BY `1price`ASC , inGroupCount DESC'); $x++; } } else { - $tr .= ''; + $tr .= '—'; } } if ($tr != '') { - $is2 .= '
:' . $tr; + $is2 .= '
Свойства предмета:' . $tr; } - // + //Особенности /* $tr = ''; $x = 1; while($x<=4){ if($po['tya'.$x]>0){ - $tyc = ' '; + $tyc = 'Ничтожно редки'; if($po['tya'.$x]>6){ - $tyc = ''; + $tyc = 'Редки'; } if($po['tya'.$x]>14){ - $tyc = ''; + $tyc = 'Малы'; } if($po['tya'.$x]>34){ - $tyc = ''; + $tyc = 'Временами'; } if($po['tya'.$x]>79){ - $tyc = ''; + $tyc = 'Регулярны'; } if($po['tya'.$x]>89){ - $tyc = ''; + $tyc = 'Часты'; } if($po['tya'.$x]>=100){ - $tyc = ''; + $tyc = 'Всегда'; } - $tr .= '
'.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)'; + $tr .= '
• '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)'; } $x++; } $x = 1; while($x<=7){ if($po['tym'.$x]>0){ - $tyc = ' '; + $tyc = 'Ничтожно редки'; if($po['tym'.$x]>6){ - $tyc = ''; + $tyc = 'Редки'; } if($po['tym'.$x]>14){ - $tyc = ''; + $tyc = 'Малы'; } if($po['tym'.$x]>34){ - $tyc = ''; + $tyc = 'Временами'; } if($po['tym'.$x]>79){ - $tyc = ''; + $tyc = 'Регулярны'; } if($po['tym'.$x]>89){ - $tyc = ''; + $tyc = 'Часты'; } if($po['tym'.$x]>=100){ - $tyc = ''; + $tyc = 'Всегда'; } - $tr .= '
'.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)'; + $tr .= '
• '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)'; } $x++; } if($tr!=''){ - $is2 .= '
:'.$tr; + $is2 .= '
Особенности:'.$tr; } */ @@ -4415,12 +3904,12 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } else { $rnc = '#282828'; } - $po['imposed_name'] = str_replace(' ', '', $po['imposed_name']); - $tr .= '
: ' . $po['imposed_name'] . ' '; + $po['imposed_name'] = str_replace('Чары ', '', $po['imposed_name']); + $tr .= '
Наложены заклятия: ' . $po['imposed_name'] . ' '; unset($rnc); } if ($tr != '') { - $is2 .= '
:'; + $is2 .= '
Улучшения предмета:'; $is2 .= $tr; } @@ -4431,24 +3920,24 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } } if (isset($po['free_stats']) && $po['free_stats'] > 0) { - $is2 .= '
:'; - $is2 .= '• : ' . $po['free_stats'] . ''; + $is2 .= '
Распределение статов:'; + $is2 .= '• Возможных распределений: ' . $po['free_stats'] . ''; } if (floor($pl['iznosNOW']) >= ceil($pl['iznosMAX'])) { $d[0] = 0; $d[2] = 0; } if (isset($po['complect']) || isset($po['complect2'])) { - $is2 .= '
:'; + $is2 .= '
Дополнительная информация:'; } if (isset($po['complect'])) { - // - $com1 = ['name' => ' ', 'x' => 0, 'text' => '']; + //не отображается + $com1 = ['name' => 'Неизвестный Комплект', 'x' => 0, 'text' => '']; $spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "' . $po['complect'] . '" ORDER BY `x` ASC LIMIT 20'); while ($plc = mysql_fetch_array($spc)) { $com1['name'] = $plc['name']; $com1['text'] .= '    • ' . $plc['x'] . ': '; - // + //действие комплекта $i1c = 0; $i2c = 0; $i1e = $this->lookStats($plc['data']); @@ -4471,18 +3960,18 @@ ORDER BY `1price`ASC , inGroupCount DESC'); unset($i1c, $i2c, $i3c); $com1['x']++; } - $is2 .= '
• : ' . $com1['name'] . '
'; + $is2 .= '
• Часть комплекта: ' . $com1['name'] . '
'; $is2 .= $com1['text']; $is2 .= ''; } if (isset($po['complect2'])) { - // - $com1 = ['name' => ' ', 'x' => 0, 'text' => '']; + //не отображается + $com1 = ['name' => 'Неизвестный Комплект', 'x' => 0, 'text' => '']; $spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "' . $po['complect2'] . '" ORDER BY `x` ASC LIMIT 20'); while ($plc = mysql_fetch_array($spc)) { $com1['name'] = $plc['name']; $com1['text'] .= '    • ' . $plc['x'] . ': '; - // + //действие комплекта $i1c = 0; $i2c = 0; $i1e = $this->lookStats($plc['data']); @@ -4505,78 +3994,78 @@ ORDER BY `1price`ASC , inGroupCount DESC'); unset($i1c, $i2c, $i3c); $com1['x']++; } - $is2 .= '
• (): ' . $com1['name'] . '
'; + $is2 .= '
• Часть комплекта (подгонка): ' . $com1['name'] . '
'; $is2 .= $com1['text']; $is2 .= ''; } $is2 .= ''; if (isset($po['gravi'])) { - $is2 .= '
: ' . $po['gravi'] . ''; + $is2 .= '
На поверхности выгравирована надпись: ' . $po['gravi'] . ''; } if ($pl['info'] != '') { - $is2 .= '
:
' . $pl['info'] . '
'; + $is2 .= '
Рекомендации:
' . $pl['info'] . '
'; } if ($po['info'] != '') { $is2 .= '
' . $po['info'] . '
'; } if ($pl['max_text'] - $pl['use_text'] > 0) { - $is2 .= '
: ' . ($pl['max_text'] - $pl['use_text']) . '
'; + $is2 .= '
Количество символов: ' . ($pl['max_text'] - $pl['use_text']) . '
'; } if ($pl['maidin'] != '') { - // $is2 .= '
'.$this->city_name[$pl['maidin']].'
'; + // $is2 .= '
Сделано в '.$this->city_name[$pl['maidin']].'
'; } if (isset($po['noremont'])) { - $is2 .= '
'; + $is2 .= '
Предмет не подлежит ремонту
'; } if (isset($po['nosale'])) { - $is2 .= '
'; + $is2 .= '
Предмет нельзя продать
'; } if (isset($po['nomodif'])) { - $is2 .= '
'; + $is2 .= '
Предмет нельзя улучшать
'; } if (isset($po['nodelete'])) { - $is2 .= '
'; + $is2 .= '
Предмет нельзя выбросить
'; } if (isset($po['frompisher']) && $po['frompisher'] > 0) { - $is2 .= '
'; + $is2 .= '
Предмет из подземелья
'; } if (isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0) { - $is2 .= '
'; + $is2 .= '
Предмет не портится во время сна
'; } if (isset($po['fromlaba']) && $po['fromlaba'] > 0) { - $is2 .= '
'; + $is2 .= '
Предмет из лабиринта
'; } if (isset($po['vip_sale']) && $po['vip_sale'] > 0) { - $is2 .= '
10%
'; + $is2 .= '
Предмет куплен за 10% от стоимости
'; } if ($pl['dn_delete'] > 0) { - $is2 .= '
'; + $is2 .= '
Предмет будет удален при выходе из подземелья
'; } if ($this->pokol > $pl['geni']) { - $is2 .= '
'; + $is2 .= '
Предмет устарел
'; } if (isset($po['zazuby']) && $po['zazuby'] > 0) { - $is2 .= '
'; + $is2 .= '
Предмет куплен за зубы
'; } - //$is2 .= '
'.$this->city_name[$this->info['city']].'
'; + //$is2 .= '
Сделано в '.$this->city_name[$this->info['city']].'
'; $is2 .= '
'; } if ($preview == "preview") { - $kolvoprint = ": $steck[0] ."; + $kolvoprint = "Количество: $steck[0] шт."; } echo '' . $is1 . '' . $kolvoprint . $is2 . ''; $i++; } } - if ($i == 0) echo ' '; + if ($i == 0) echo 'Прилавок магазина пуст'; } public $sid_zuby = [ - // - 1 => 1, // - 9 => 1, // - 8 => 1 // + //Кэпитал + 1 => 1, //гос + 9 => 1, //таверна + 8 => 1 //зоо ]; public function shopItems($sid, $plu = '') @@ -4668,7 +4157,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); }*/ if (($pl['type'] >= 18 && $pl['type'] <= 24) || $pl['type'] == 26 || $pl['type'] == 27) { - // + + //Зоны блока + $po['zonb']++; } @@ -4679,28 +4168,28 @@ ORDER BY `1price`ASC , inGroupCount DESC'); $is1 = '
'; } if ($sid == 609) { - $is1 .= ''; + $is1 .= 'купить'; } else { //if($this->info['money']>$pl['price']) //{ if ($sid == 2 || $sid == 777) { - $is1 .= ' '; + $is1 .= 'купить '; } else { - $is1 .= ' '; + $is1 .= 'купить '; } //} if ($sid == 777 && $this->stats['silver'] > 1) { - //$is1 .= '
VIP ('.round($pl['price_2']/20,2).' .) '; + //$is1 .= '
VIP покупка ('.round($pl['price_2']/20,2).' екр.) '; } if ($pl['nozuby'] == 0) { if ($this->info['level'] > 0 && $this->info['level'] < 8) { if ($pl['level'] < 8 && $sid_zuby == 1 && $pl['nozuby'] == 0 && $c['zuby'] == true) { - $is1 .= '
'; + $is1 .= '
купить за зубы'; /*if( $this->info['admin'] > 0 ) { if( isset($_GET['nozbpl']) && $pl['iid'] == $_GET['nozbpl'] ) { mysql_query('UPDATE `items_shop` SET `nozuby` = 1 WHERE `iid` = "'.$pl['iid'].'" LIMIT 1'); } - $is1 .= '

( )'; + $is1 .= '

(Запретить продажу за зубы)'; }*/ } } @@ -4708,31 +4197,31 @@ ORDER BY `1price`ASC , inGroupCount DESC'); if( isset($_GET['nozbpl']) && $pl['iid'] == $_GET['nozbpl'] ) { mysql_query('UPDATE `items_shop` SET `nozuby` = 0 WHERE `iid` = "'.$pl['iid'].'" LIMIT 1'); } - $is1 .= '

( )'; + $is1 .= '

(Разрешить продажу за зубы)'; }*/ } /* if($this->info['admin'] > 0) { - $is1 .= '

:
'. - ' '. - ', '. - ', '. - ', '. - ', '. - ', '. - ',
'; + $is1 .= '

Выберите тип предмета:
'. + ' Отсутствует'. + ', Танк'. + ', Уворот'. + ', Крит'. + ', Силовик'. + ', Универсал'. + ', Маг
'; } if($this->info['admin'] > 0) { - $is1 .= '
:
'. - ' '. - ', '. - ', '. - ', '. - ', '. - ', '. - ',
'; - // + $is1 .= '
Выберите тип доминирования:
'. + ' Отсутствует'. + ', над Танком'. + ', над Уворотом'. + ', над Критом'. + ', над Силовиком'. + ', над Универсалом'. + ', над Магом
'; + //уровень доминирования } @@ -4747,19 +4236,19 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } if($pl['class'] > 0) { - $clnm = array('','','','','','',''); - $is1 .= '

'.$clnm[$pl['class']].''; + $clnm = array('Отсутствует','Танк','Уворот','Крит','Силовик','Универсал','Маг'); + $is1 .= '

Предмет для '.$clnm[$pl['class']].'а'; unset($clnm); } if($pl['anti_class'] > 0) { - $clnm = array('','','','','','',''); - $is1 .= '
'.$clnm[$pl['anti_class']].''; + $clnm = array('Отсутствует','Танк','Уворот','Крит','Силовик','Универсал','Маг'); + $is1 .= '
Доминирует над '.$clnm[$pl['anti_class']].'ом'; unset($clnm); } } */ - // + //название if (isset($po['tr_align']) && !isset($po['tr_align_bs'])) { $pl['name'] .= ''; @@ -4775,7 +4264,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); //$pl['name'] .= ''; } if (isset($po['renameadd']) && $po['renameadd'] != '') { - $pl['name'] .= ' (: ' . $po['renameadd'] . ')'; + $pl['name'] .= ' (Предмет: ' . $po['renameadd'] . ')'; } if (isset($po['icos'])) { $pl['name'] = '' . $pl['name'] . '  ' . $po['icos'] . ' '; @@ -4784,28 +4273,28 @@ ORDER BY `1price`ASC , inGroupCount DESC'); if ($pl['massa'] > 0) { - $is2 .= '(: ' . round($pl['massa'], 2) . ')'; + $is2 .= '(Масса: ' . round($pl['massa'], 2) . ')'; } if (isset($po['art'])) { - $is2 .= ' '; + $is2 .= ' '; } if (isset($po['sudba'])) { if ($po['sudba'] == '0') { - $is2 .= ' '; + $is2 .= ' '; } elseif ($po['sudba'] == '1') { - $is2 .= ' '; + $is2 .= ' '; } else { - $is2 .= ' '; + $is2 .= ' '; } } - // + //цена if ($this->info['admin'] > 0) { $is2 .= '
  ' . $pl['pos'] . '  
'; } - $is2 .= '
: '; + $is2 .= '
Цена: '; if ($this->stats['silver'] >= 1 && $sid == 1) { $is2 .= ''; } elseif ($this->stats['silver'] >= 5 && ($sid == 2 || $sid == 777)) { @@ -4818,7 +4307,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); $is2 .= '' . round($pl['price_4']) . ''; } - $is2 .= ' '; + $is2 .= '
Воинственности '; } elseif ($pl['price_3'] > 0) { if ($pl['price_3'] > $this->info['money3']) { $is2 .= '' . $pl['price_3'] . ''; @@ -4833,14 +4322,14 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } else { $is2 .= $pl['price_2']; } - $is2 .= ' . '; + $is2 .= ' екр. '; } else { if ($pl['price_1'] > $this->info['money']) { $is2 .= '' . $pl['price_1'] . ''; } else { $is2 .= $pl['price_1']; } - $is2 .= ' . '; + $is2 .= ' кр. '; } if ($this->stats['silver'] >= 1 && $sid == 1) { $is2 .= '   '; @@ -4849,7 +4338,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } else { $is2 .= round($pl['price_1'] * 0.95, 2); } - $is2 .= ' . -5%'; + $is2 .= ' кр. Скидка -5%'; } elseif ($this->stats['silver'] >= 5 && ($sid == 2 || $sid == 777)) { $is2 .= '   '; if ($pl['price_2'] > $this->info['money2']) { @@ -4857,15 +4346,15 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } else { $is2 .= round($pl['price_2'] * 0.95, 2); } - $is2 .= ' . -5%'; + $is2 .= ' екр. Скидка -5%'; } if ($pl['pricerep'] > 0) { - $is2 .= ' (' . round($pl['pricerep'], 2) . ' )'; + $is2 .= ' (' . round($pl['pricerep'], 2) . ' Воинственности)'; } if ($pl['kolvo'] < 100000) { - $is2 .= '     (: ' . $pl['kolvo'] . ')'; + $is2 .= '     (количество: ' . $pl['kolvo'] . ')'; } if ($pl['nozuby'] == 0 && $sid != 609 && $c['zuby'] == true) { @@ -4909,7 +4398,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } if ($ttmm != '') { - $ttmm = '
: ' . rtrim($ttmm, ', ') . ' '; + $ttmm = '
Требует предмет: ' . rtrim($ttmm, ', ') . ' '; if ($trn == 0) { $ttmm = '' . $ttmm . ''; } @@ -4920,44 +4409,44 @@ ORDER BY `1price`ASC , inGroupCount DESC'); unset($ttmm); - // + //долговечность if ($pl['iznos'] > 0) { $pl['iznosMAXi'] = $pl['iznos']; } if ($pl['iznosMAXi'] > 0) { if ($pl['iznosMAXi'] == 999999999) { - $is2 .= ':
'; + $is2 .= 'Долговечность: неразрушимо
'; } else { - $is2 .= ': 0/' . $pl['iznosMAXi'] . '
'; + $is2 .= 'Долговечность: 0/' . $pl['iznosMAXi'] . '
'; } } if ($po['battleUseZd'] > 0) { - $is2 .= ' : ' . $this->timeOut($po['battleUseZd']) . '
'; + $is2 .= 'Задержка использования: ' . $this->timeOut($po['battleUseZd']) . '
'; } $is2 = rtrim($is2, '
'); - // + //Срок годности предмета if ($po['srok'] > 0) { $pl['srok'] = $po['srok']; } if ($pl['srok'] > 0) { - $is2 .= '
: ' . $this->timeOut($pl['srok']); + $is2 .= '
Срок годности: ' . $this->timeOut($pl['srok']); } if ($pl['magic_chance'] > 0) { - $is2 .= '
: ' . min([$pl['magic_chance'], 100]) . '%'; + $is2 .= '
Вероятность срабатывания: ' . min([$pl['magic_chance'], 100]) . '%'; } - // : + //Продолжительность действия магии: if ((int)$pl['magic_inci'] > 0) { $efi = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`type1`,`img`,`mdata`,`actionTime`,`type2`,`type3`,`onlyOne`,`oneType`,`noAce`,`see`,`info`,`overch`,`bp`,`noch` FROM `eff_main` WHERE `id2` = "' . ((int)$pl['magic_inci']) . '" LIMIT 1')); if (isset($efi['id2']) && $efi['actionTime'] > 0) { - $is2 .= '
: ' . $this->timeOut($efi['actionTime']); + $is2 .= '
Продолжительность действия: ' . $this->timeOut($efi['actionTime']); } } - // : + //Требуется минимальное: $tr = ''; $t = $this->items['tr']; $x = 0; @@ -4977,7 +4466,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); $notr++; } } - $tr .= '
'; + $tr .= '
• '; if ($n == 'rep') { $temp = explode('::', $po['tr_' . $n]); $tr .= $this->is[$n] . ' ' . ucfirst(str_replace('city', ' city', $temp[1])) . ': ' . $temp[0]; @@ -4985,9 +4474,9 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } elseif ($n != 'align') { if ($n == 'sex') { if ($po['tr_' . $n] == 1) { - $tr .= $this->is[$n] . ': '; + $tr .= $this->is[$n] . ': Женский'; } else { - $tr .= $this->is[$n] . ': '; + $tr .= $this->is[$n] . ': Мужской'; } } else { $tr .= $this->is[$n] . ': ' . $po['tr_' . $n]; @@ -5005,9 +4494,9 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } if ($tr != '') { - $is2 .= '
:' . $tr; + $is2 .= '
Требуется минимальное:' . $tr; } - // : + //Действует на: $tr = ''; $t = $this->items['add']; $x = 0; @@ -5018,13 +4507,13 @@ ORDER BY `1price`ASC , inGroupCount DESC'); if ($po['add_' . $n] < 0) { $z = ''; } - $tr .= '
' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n]; + $tr .= '
• ' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n]; } $x++; } - // () + //действует на (броня) $i = 1; - $bn = [1 => '', 2 => '', 3 => '', 4 => '']; + $bn = [1 => 'головы', 2 => 'корпуса', 3 => 'пояса', 4 => 'ног']; while ($i <= 4) { if (isset($po['add_mab' . $i])) { if ($po['add_mab' . $i] == $po['add_mib' . $i] && $pl['geniration'] == 1) { @@ -5032,22 +4521,22 @@ ORDER BY `1price`ASC , inGroupCount DESC'); if ($po['add_mab' . $i] < 0) { $z = ''; } - $tr .= '
' . $bn[$i] . ': ' . $z . '' . $po['add_mab' . $i]; + $tr .= '
• Броня ' . $bn[$i] . ': ' . $z . '' . $po['add_mab' . $i]; } else { - $tr .= '
' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i]; + $tr .= '
• Броня ' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i]; } } $i++; } if ($tr != '') { - $is2 .= '
:' . $tr; + $is2 .= '
Действует на:' . $tr; } - // : + //Свойства предмета: $tr = ''; $t = $this->items['sv']; if (isset($po['sv_yron_min'], $po['sv_yron_max'])) { - $tr .= '
: ' . $po['sv_yron_min'] . ' - ' . $po['sv_yron_max']; + $tr .= '
• Урон: ' . $po['sv_yron_min'] . ' - ' . $po['sv_yron_max']; } $x = 0; while ($x < count($t)) { @@ -5057,18 +4546,18 @@ ORDER BY `1price`ASC , inGroupCount DESC'); if ($po['sv_' . $n] < 0) { $z = ''; } - $tr .= '
' . $this->is[$n] . ': ' . $z . '' . $po['sv_' . $n]; + $tr .= '
• ' . $this->is[$n] . ': ' . $z . '' . $po['sv_' . $n]; } $x++; } if ($pl['2too'] == 1) { - $tr .= '
'; + $tr .= '
• Второе оружие'; } if ($pl['2h'] == 1) { - $tr .= '
'; + $tr .= '
• Двуручное оружие'; } if (isset($po['zonb'])) { - $tr .= '
: '; + $tr .= '
• Зоны блокирования: '; if ($po['zonb'] > 0) { $x = 1; while ($x <= $po['zonb']) { @@ -5076,46 +4565,46 @@ ORDER BY `1price`ASC , inGroupCount DESC'); $x++; } } else { - $tr .= ''; + $tr .= '—'; } } if ($tr != '') { - $is2 .= '
:' . $tr; + $is2 .= '
Свойства предмета:' . $tr; } - // + //Особенности /*$tr = ''; $x = 1; while($x<=4) { if($po['tya'.$x]>0) { - $tyc = ' '; + $tyc = 'Ничтожно редки'; if($po['tya'.$x]>6) { - $tyc = ''; + $tyc = 'Редки'; } if($po['tya'.$x]>14) { - $tyc = ''; + $tyc = 'Малы'; } if($po['tya'.$x]>34) { - $tyc = ''; + $tyc = 'Временами'; } if($po['tya'.$x]>79) { - $tyc = ''; + $tyc = 'Регулярны'; } if($po['tya'.$x]>89) { - $tyc = ''; + $tyc = 'Часты'; } if($po['tya'.$x]>=100) { - $tyc = ''; + $tyc = 'Всегда'; } - $tr .= '
'.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)'; + $tr .= '
• '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)'; } $x++; } @@ -5124,38 +4613,38 @@ ORDER BY `1price`ASC , inGroupCount DESC'); { if(@$po['tym'.$x]>0) { - $tyc = ' '; + $tyc = 'Ничтожно редки'; if($po['tym'.$x]>6) { - $tyc = ''; + $tyc = 'Редки'; } if($po['tym'.$x]>14) { - $tyc = ''; + $tyc = 'Малы'; } if($po['tym'.$x]>34) { - $tyc = ''; + $tyc = 'Временами'; } if($po['tym'.$x]>79) { - $tyc = ''; + $tyc = 'Регулярны'; } if($po['tym'.$x]>89) { - $tyc = ''; + $tyc = 'Часты'; } if($po['tym'.$x]>=100) { - $tyc = ''; + $tyc = 'Всегда'; } - $tr .= '
'.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)'; + $tr .= '
• '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)'; } $x++; } if($tr!='') { - $is2 .= '
:'.$tr; + $is2 .= '
Особенности:'.$tr; }*/ $tr = ''; @@ -5172,12 +4661,12 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } else { $rnc = '#282828'; } - $po['imposed_name'] = str_replace(' ', '', $po['imposed_name']); - $tr .= '
: ' . $po['imposed_name'] . ' '; + $po['imposed_name'] = str_replace('Чары ', '', $po['imposed_name']); + $tr .= '
Наложены заклятия: ' . $po['imposed_name'] . ' '; unset($rnc); } if ($tr != '') { - $is2 .= '
:'; + $is2 .= '
Улучшения предмета:'; $is2 .= $tr; } @@ -5190,18 +4679,18 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } if (isset($po['free_stats']) && $po['free_stats'] > 0) { - $is2 .= '
:
'; - $is2 .= '• : +' . $po['free_stats'] . ' '; + $is2 .= '
Распределение статов:
'; + $is2 .= '• Возможных распределений: +' . $po['free_stats'] . ' характеристик'; } - // + //Встроенная магия if ($pl['magic_inci'] != '' || $pl['magic_inc'] != '') { if ($pl['magic_inc'] == '') { $pl['magic_inc'] = $pl['magic_inci']; } $mgi = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "' . $pl['magic_inc'] . '" AND `type1` = "12345" LIMIT 1')); if (isset($mgi['id2'])) { - $is2 .= '
' . $mgi['minfo'] . '
'; + $is2 .= '
Встроено заклятие ' . $mgi['minfo'] . '
'; } } @@ -5210,16 +4699,16 @@ ORDER BY `1price`ASC , inGroupCount DESC'); $d[2] = 0; } if (isset($po['complect'])) { - $is2 .= '
:'; + $is2 .= '
Дополнительная информация:'; } if (isset($po['complect'])) { - // - $com1 = ['name' => ' ', 'x' => 0, 'text' => '']; + //не отображается + $com1 = ['name' => 'Неизвестный Комплект', 'x' => 0, 'text' => '']; $spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "' . $po['complect'] . '" ORDER BY `x` ASC LIMIT 20'); while ($plc = mysql_fetch_array($spc)) { $com1['name'] = $plc['name']; $com1['text'] .= '    • ' . $plc['x'] . ': '; - // + //действие комплекта $i1c = 0; $i2c = 0; $i1e = $this->lookStats($plc['data']); @@ -5242,23 +4731,23 @@ ORDER BY `1price`ASC , inGroupCount DESC'); unset($i1c, $i2c, $i3c); $com1['x']++; } - $is2 .= '
• : ' . $com1['name'] . '
'; + $is2 .= '
• Часть комплекта: ' . $com1['name'] . '
'; $is2 .= $com1['text']; $is2 .= ''; } if ($pl['max_text'] - $pl['use_text'] > 0) { - $is2 .= '
: ' . ($pl['max_text'] - $pl['use_text']) . '
'; + $is2 .= '
Количество символов: ' . ($pl['max_text'] - $pl['use_text']) . '
'; } $is2 .= ''; if (isset($po['gravi'])) { - $is2 .= '
: ' . $po['gravi'] . ''; + $is2 .= '
На поверхности выгравирована надпись: ' . $po['gravi'] . ''; } if ($pl['info'] != '') { - $is2 .= '
:
' . $pl['info'] . '
'; + $is2 .= '
Рекомендации:
' . $pl['info'] . '
'; } if ($po['info'] != '') { @@ -5266,61 +4755,61 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } if ($pl['maidin'] != '') { - // $is2 .= '
'.$this->city_name[$pl['maidin']].'
'; + // $is2 .= '
Сделано в '.$this->city_name[$pl['maidin']].'
'; } if (isset($po['noremont'])) { - $is2 .= '
'; + $is2 .= '
Предмет не подлежит ремонту
'; } if (isset($po['nosale'])) { - $is2 .= '
'; + $is2 .= '
Предмет нельзя продать
'; } if (isset($po['nomodif'])) { - $is2 .= '
'; + $is2 .= '
Предмет нельзя улучшать
'; } if (isset($po['nodelete'])) { - $is2 .= '
'; + $is2 .= '
Предмет нельзя выбросить
'; } if (isset($po['frompisher']) && $po['frompisher'] > 0) { - $is2 .= '
'; + $is2 .= '
Предмет из подземелья
'; } if (isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0) { - $is2 .= '
'; + $is2 .= '
Предмет не портится во время сна
'; } if (isset($po['fromlaba']) && $po['fromlaba'] > 0) { - $is2 .= '
'; + $is2 .= '
Предмет из лабиринта
'; } if (isset($po['vip_sale']) && $po['vip_sale'] > 0) { - $is2 .= '
10%
'; + $is2 .= '
Предмет куплен за 10% от стоимости
'; } if ($pl['dn_delete'] > 0) { - $is2 .= '
'; + $is2 .= '
Предмет будет удален при выходе из подземелья
'; } if ($this->pokol > $pl['geni']) { - $is2 .= '
'; + $is2 .= '
Предмет устарел
'; } if (isset($po['zazuby']) && $po['zazuby'] > 0) { - $is2 .= '
'; + $is2 .= '
Предмет куплен за зубы
'; } - //$is2 .= '
'.$this->city_name[$this->info['city']].'
'; + //$is2 .= '
Сделано в '.$this->city_name[$this->info['city']].'
'; $is2 .= '
'; $crd = ''; if ($this->info['admin'] > 0) { - $crd = '  
'; + $crd = 'Редактировать предмет   обновить
'; } echo '' . $is1 . ' ' . $crd . '' . $is2 . ''; @@ -5329,7 +4818,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } if ($i == 0) { - echo ' '; + echo 'Прилавок магазина пуст'; } } @@ -5367,7 +4856,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); $n01 += $pl['ability']; $n02 += $pl['skills']; if ($ll < $pl['nextLevel']) { - $n01 += 1; // + $n01 += 1; //вынос if ($this->info['level'] >= 9) { $n01 += 1; } @@ -5398,12 +4887,12 @@ ORDER BY `1price`ASC , inGroupCount DESC'); public function wipe() { if ($this->info['wipe'] > 0 && $this->info['battle'] == 0) { - //wipe = 1 , + //wipe = 1 , значит обнуляем статы и умения if ($this->info['wipe'] < 4) { $st = $this->lookStats($this->info['stats']); - $n1 = $this->info['ability']; // - $n2 = $this->info['skills']; // - $n3 = $this->info['sskills']; // + $n1 = $this->info['ability']; //способности + $n2 = $this->info['skills']; //владение магией и оружием + $n3 = $this->info['sskills']; //особенности $n4 = $this->info['nskills']; //??? if ($this->info['wipe'] == 1 || $this->info['wipe'] == 2) { $i = 1; @@ -5443,7 +4932,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); $i++; } } - if ($this->info['wipe'] == 1 || $this->info['wipe'] == 3.5)#--- + if ($this->info['wipe'] == 1 || $this->info['wipe'] == 3.5)#---Сброс особенностей { $i = 1; while ($i <= 11) { @@ -5452,7 +4941,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); $i++; } } - // + //сохраняем данные $st = $this->impStats($st); $upd = mysql_query('UPDATE `stats` SET `wipe`="0",`stats`="' . $st . '",`ability`="' . $n1 . '",`skills`="' . $n2 . '",`sskills`="' . $n3 . '",`nskills`="' . $n4 . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); if ($upd) { @@ -5468,10 +4957,10 @@ ORDER BY `1price`ASC , inGroupCount DESC'); public function __clone() { - trigger_error(' .', E_USER_ERROR); + trigger_error('Дублирование не допускается.', E_USER_ERROR); } - // + //Сверяем требования предмета для его использования public function trItem($po) { $tr = ''; @@ -5507,7 +4996,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); mf_mod mf_mib */ - // + //статы if ($_GET['mf'] == 's1' || $_GET['mf'] == 's2' || $_GET['mf'] == 's3' || $_GET['mf'] == 's5') { if (isset($po['mf_stats']) && $po['mf_stats'] > 0 && isset($po['add_' . $_GET['mf']])) { $po['mf_stats'] = (int)$po['mf_stats']; @@ -5582,18 +5071,18 @@ ORDER BY `1price`ASC , inGroupCount DESC'); if ($itm['so'] > 0) { $s = (int)$s; if ($tp == 1) { - // + //статы if ($s == 1 || $s == 2 || $s == 3 || $s == 5) { if (10 + 25 * $po['add_s' . $s] <= $itm['so'] && $itm['so'] > 0) { $itm['so'] -= 10 + 25 * $po['add_s' . $s]; $po['add_s' . $s]++; - $this->error = ' ...'; + $this->error = 'Характеристика улучшена...'; } else { - $this->error = ' ...'; + $this->error = 'Не хватает очков развития...'; } } } elseif ($tp == 2) { - // + //мф if ($s > 0 && $s < 13) { $s2 = 0; if ($s == 9 || $s == 12) { @@ -5641,7 +5130,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); } $po['add_' . $s]++; } else { - $this->error = ' ...'; + $this->error = 'Не хватает очков развития...'; } } } @@ -5655,7 +5144,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); { $itm = mysql_fetch_array(mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "' . ((int)$id) . '" LIMIT 1')); if ($this->info['transfers'] < 1) { - $this->error = ' .'; + $this->error = 'На сегодня лимит передач исчерпан.'; } elseif (isset($itm['id'])) { if (isset($itm['inGroup']) and $itm['inGroup'] > 0) { $col = $this->itemsX($itm['id']); @@ -5671,11 +5160,11 @@ ORDER BY `1price`ASC , inGroupCount DESC'); if($col>1) { $col = ' (x'.$col.')'; }else{ $col = ''; } $this->info['transfers']--; mysql_query('UPDATE `stats` SET `transfers` = "'.$this->info['transfers'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - $this->error = ' "'.$itm['name'].''.$col.'" '; + $this->error = 'Предмет "'.$itm['name'].''.$col.'" перенесен из инвентаря'; */ } } else { - $this->error = ' '; + $this->error = 'Предмет не найден в рюкзаке'; } } @@ -5684,7 +5173,7 @@ ORDER BY `1price`ASC , inGroupCount DESC'); $itm = mysql_fetch_array(mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="1" AND `iu`.`id` = "' . ((int)$id) . '" LIMIT 1')); if ($this->info['transfers'] < 1) { - $this->error = ' .'; + $this->error = 'На сегодня лимит передач исчерпан.'; } elseif (isset($itm['id'])) { if (isset($itm['inGroup']) && $itm['inGroup'] > 0) { $col = $this->itemsX($itm['id']); @@ -5698,13 +5187,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } if ($upd) { /* if($col>1) { $col = ' (x'.$col.')'; }else{ $col = ''; } - $this->error = ' "'.$itm['name'].''.$col.'" '; + $this->error = 'Предмет "'.$itm['name'].''.$col.'" перенесен в инвентаря'; $this->info['transfers']--; mysql_query('UPDATE `stats` SET `transfers` = "'.$this->info['transfers'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); */ } } else { - $this->error = ' '; + $this->error = 'Предмет не найден в сундуке'; } } @@ -5728,13 +5217,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $mx1 += $this->info['skills']; if ($mx1 > 0) { - // + //умения $s = $s - 100; if ($s > 5 && $s <= 12) { - // + //магия $po['add_mg' . ($s - 5)]++; } elseif ($s > 0) { - // + //оружие $po['add_a' . $s]++; } } @@ -5826,7 +5315,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($vi > 0) { $itm_inv = $this->genInv(80, ' ' . rtrim($vid, 'OR') . ' '); - echo ' "' . $rune['name'] . '":

' . $itm_inv[2] . '
'; + echo 'Выберите предмет для использования "' . $rune['name'] . '":

' . $itm_inv[2] . '
'; die(); } else { unset($rune); @@ -5844,9 +5333,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` `i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl` ,`m`.`name`,`m`.`type`,`m`.`level` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE `i`.`id` = "' . mysql_real_escape_string($ruid) . '" AND `i`.`uid` = "' . $this->info['id'] . '" AND `i`.`delete` = "0" AND `i`.`inShop` = "0" LIMIT 1')); if ($rune['level'] > $this->info['level'] && $rune['type'] == 31) { - $this->error = ' '; + $this->error = 'У вас слишком маленький уровень чтобы использовать эту руну'; } elseif ($rune['type'] == 31) { - // + //Встраиваем руну if ($idt['type'] == 7) { $idt['type'] = 6; } @@ -5858,19 +5347,19 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $data = $this->lookStats($id['data']); $type_rune = [ - '' => 9, // - '' => 10, // - '' => 11, // - '' => 12, // - '' => 14, // - '' => 15, // - '' => 1, // - '' => 3, // - '' => 6, // - '' => 8 // + 'хи' => 9, //Серьги + 'хэ' => 10, //Ожерелье + 'ви' => 11, //Кольцо + 'во' => 12, //Перчатки + 'кэ' => 14, //Поножи + 'ки' => 15, //Обувь + 'ми' => 1, //Шлем + 'си' => 3, //Наручи + 'мо' => 6, //Броня + 'со' => 8 //Пояс ]; if ($rune['type'] == 5) { - $type_rune[''] = 5; + $type_rune['мо'] = 5; } // //$idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT` 1')); @@ -5880,22 +5369,22 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $type_rune = $type_rune[substr($rune['name'], -2, 2)]; if ($type_rune != $id['type'] && $type_rune != '') { $type_rune2 = [ - '' => '', // - '' => '', // - '' => '', // - '' => '', // - '' => '', // - '' => '', // - '' => '', // - '' => '', // - '' => '', // - '' => '' // + 'хи' => 'серьги', //Серьги + 'хэ' => 'ожерелья', //Ожерелье + 'ви' => 'кольцо', //Кольцо + 'во' => 'перчатки', //Перчатки + 'кэ' => 'поножи', //Поножи + 'ки' => 'обувь', //Обувь + 'ми' => 'шлем', //Шлем + 'си' => 'наручи', //Наручи + 'мо' => 'броню', //Броня + 'со' => 'пояс' //Пояс ]; - $this->error = ' ' . $type_rune2[substr($rune['name'], -2, 2)] . ' ( : ' . $id['type'] . '. : ' . $type_rune . ')'; + $this->error = 'Встроить данную руну возможно только в ' . $type_rune2[substr($rune['name'], -2, 2)] . ' (Тип предмета: ' . $id['type'] . '. Требуемый тип: ' . $type_rune . ')'; } elseif (isset($data['nomodif'])) { - $this->error = ' '; + $this->error = 'Улучшить данный предмет невозможно'; } elseif (isset($data['art']) && $data['tr_lvl'] < 0) { - $this->error = ' 10- '; + $this->error = 'Встраивание усилений в артефакты ниже 10-го уровня недоступно'; } else { if (isset($data['rune']) && $data['rune'] > 0) { $ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "' . $data['rune_id'] . '" LIMIT 1')); @@ -5912,7 +5401,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $data['rune_id'] = $rune['item_id']; $data['rune_name'] = $rune['name']; $data['rune_lvl'] = $rune['level']; - // + //Добавляем характеристики руны $add = $this->lookStats($rune['data']); $i = 0; while ($i < count($this->items['add'])) { @@ -5929,14 +5418,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` mysql_query('UPDATE `items_users` SET `data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); - $this->error = ' '; + $this->error = 'Встраивание руны прошло успешно'; } } else { $rune = mysql_fetch_array(mysql_query('SELECT `i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl` ,`m`.`name`,`m`.`level`,`m`.`type` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE `i`.`id` = "' . mysql_real_escape_string($ruid) . '" AND `i`.`uid` = "' . $this->info['id'] . '" AND `i`.`delete` = "0" AND `i`.`inShop` = "0" LIMIT 1')); if (!isset($rune['id'])) { - $this->error = ' '; + $this->error = 'Усиление которое вы использовали не найдено'; } elseif ($rune['type'] == 62 && $rune['item_id'] == 6167) { //----------------------------------------------- $idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "' . $id['item_id'] . '" LIMIT` 1')); @@ -5944,9 +5433,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $data = $this->lookStats($id['data']); $add = $this->lookStats($rune['data']); if (isset($data['nomodif'])) { - $this->error = ' '; + $this->error = 'Улучшить данный предмет невозможно'; } elseif (isset($data['art']) && $data['tr_lvl'] < 0) { - $this->error = ' 10- '; + $this->error = 'Встраивание усилений в артефакты ниже 10-го уровня недоступно'; } else { if (isset($data['spell']) && $data['spell'] > 0) { @@ -5982,7 +5471,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } } - // + //Новая чарка $srune = mysql_query('SELECT * FROM `new_charov` WHERE 1'); $irun = 0; @@ -6003,7 +5492,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if (!isset($data['sudba'])) { $data['sudba'] = '0'; } - $data['spell_name'] = ''; //$info + $data['spell_name'] = 'Зачарованно'; //$info $data['spell_st_name'] = $addrune['gname']; $data['spell_st_val'] = $addrunes; $data['spell_id'] = $rune['item_id']; @@ -6016,9 +5505,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $tid = mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `items_users` SET `data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); if (isset($tid)) { - $this->error = ' !'; + $this->error = 'Чарование прошло успешно!'; } else { - $this->error = ' !'; + $this->error = 'Что то пошло не так!'; } unset($tid); } @@ -6037,18 +5526,18 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $idt['type'] = 6; } //$id['type'] = $idt['type']; - // + //Встраиваем руну $data = $this->lookStats($id['data']); $add = $this->lookStats($rune['data']); if (isset($data['nomodif'])) { - $this->error = ' '; + $this->error = 'Улучшить данный предмет невозможно'; } elseif (isset($data['art']) && $data['tr_lvl'] < 0) { - $this->error = ' 10- '; + $this->error = 'Встраивание усилений в артефакты ниже 10-го уровня недоступно'; /*}elseif(isset($data['spell_id']) && $data['spell_id'] == 6167) { - $this->error = ' ';*/ + $this->error = 'Эту чарку использовать нелязя';*/ } elseif (isset($add['onimposed'])) { - // - // + //Встраиваем магию + //Новая чарка $i = 0; $j = 0; $utp = explode(',', $add['onItemType']); @@ -6085,13 +5574,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `items_users` SET `data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); - $this->error = ' "' . $add['onSpellName'] . '" "' . $id['name'] . '"'; + $this->error = 'Наложены чары "' . $add['onSpellName'] . '" на предмет "' . $id['name'] . '"'; } else { - $this->error = ' "' . $id['name'] . '" .,.'; + $this->error = 'Предмет "' . $id['name'] . '" не подходит для усиления.,.'; } } else { if (isset($data['spell']) && $data['spell'] > 0) { - // + //Отнимаем эффект от прошлых чарок $litm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "' . $id['item_id'] . '" LIMIT 1')); $data_l = $this->lookStats($litm['data']); @@ -6163,12 +5652,12 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` //} } } - // + //Новая чарка $i = 0; $utp = explode(',', $add['onItemType']); while ($i < count($utp)) { if ($utp[$i] == $id['type']) { - // . + // Определили нужный тип оружия. $itm_twohand = mysql_fetch_array(mysql_query('SELECT `2h` FROM `items_main` WHERE `id` = "' . $id['item_id'] . '" LIMIT 1')); if (isset($itm_twohand['2h']) && $itm_twohand['2h'] == 1) $tw = '2'; else $tw = ''; $j = 0; @@ -6181,12 +5670,12 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if (isset($add['imposed']) && $add['imposed'] != '') { $imposed = [ - 'imposed' => '1', // - 'imposed_id' => $rune['id'], // ID - 'imposed_name' => $rune['name'], // , - 'imposed_level' => $rune['level'], // . : 0; - 'bm_a1' => $add['imposed'], // . - 'sudba' => $this->info['login'] // . : 0; + 'imposed' => '1', // Активно + 'imposed_id' => $rune['id'], // ID чарки свитка + 'imposed_name' => $rune['name'], // Наименование чар, которое отображается на предмете + 'imposed_level' => $rune['level'], // Цвет подсветки заклинания при отображении. По умолчанию: 0; + 'bm_a1' => $add['imposed'], // Имя файла заклинания. + 'sudba' => $this->info['login'] // Цвет подсветки заклинания при отображении. По умолчанию: 0; ]; if (isset($add['imposed_name'])) $imposed['imposed_name'] = $add['imposed_name']; if (isset($add['imposed_level'])) $imposed['imposed_level'] = $add['imposed_level']; @@ -6204,13 +5693,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `items_users` SET `data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); - $this->error = ' "' . $imposed['imposed_name'] . '" "' . $id['name'] . '"'; + $this->error = 'Наложены чары "' . $imposed['imposed_name'] . '" на предмет "' . $id['name'] . '"'; } elseif (!isset($this->is[$rnda]) && $rnda != 'mib1' && $rnda != 'mib2' && $rnda != 'mib3' && $rnda != 'mib4' && $rnda != 'mab1' && $rnda != 'mab2' && $rnda != 'mab3' && $rnda != 'mab4' ) { - $this->error = ' . ( ' . $rnda . ' )'; + $this->error = 'Попробуйте зачарить предмет снова. ( ' . $rnda . ' )'; } else { $data['add_' . $rnda] += $add[$tw . 'add' . $utp[$i] . '_' . $rnda]; if ($rnda == 'mab1' || $rnda == 'mab2' || $rnda == 'mab3' || $rnda == 'mab4') { @@ -6248,7 +5737,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($data['add_' . $data['spell_st_name']] == 0) { unset($data['add_' . $data['spell_st_name']]); } - //die(' : '.$data['spell_st_name'].' +'.$data['spell_st_val'].'
...'); + //die('Прошлое усиление: '.$data['spell_st_name'].' +'.$data['spell_st_val'].'
Попробуйте позже...'); } $data['spell_id'] = $rune['item_id']; @@ -6264,13 +5753,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $data = $this->impStats($data); - $this->is['mab1'] = ' '; - $this->is['mab2'] = ' '; - $this->is['mab3'] = ' '; - $this->is['mab4'] = ' '; - $this->error = ' "' . $id['name'] . '", ' . $this->is[$rnda] . ': +' . $add[$tw . 'add' . $utp[$i] . '_' . $rnda]; + $this->is['mab1'] = 'Броня головы'; + $this->is['mab2'] = 'Броня корпуса'; + $this->is['mab3'] = 'Броня пояса'; + $this->is['mab4'] = 'Броня ног'; + $this->error = 'Увеличина характеристика предмета "' . $id['name'] . '", ' . $this->is[$rnda] . ': +' . $add[$tw . 'add' . $utp[$i] . '_' . $rnda]; - //$this->error = '


"'.$id['name'].'", '.$this->is[$rnda].': +'.$add['add'.$utp[$i].'_'.$rnda]."

$:".$idt['2h']."<"; + //$this->error = '


Увеличина характеристика предмета "'.$id['name'].'", '.$this->is[$rnda].': +'.$add['add'.$utp[$i].'_'.$rnda]."

$:".$idt['2h']."<"; unset($this->is['mab1'], $this->is['mab2'], $this->is['mab3'], $this->is['mab4']); @@ -6278,14 +5767,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` mysql_query('UPDATE `items_users` SET `data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); } } else { - $this->error = '- , '; + $this->error = 'Что-то не так, невозможно зачаровать данным свитком'; } $i = 100499; } $i++; } if ($i < 100500) { - $this->error = ' ...'; + $this->error = 'Данный предмет не подходит для зачарования...'; } } @@ -6300,12 +5789,12 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $id['iznosNOW'] . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); - $this->error = ' ' . $id['name'] . ' .'; + $this->error = 'Предмет ' . $id['name'] . ' успешно отремонтирован.'; } else { - $this->error = ' ...'; + $this->error = 'Предмет не нуждаеться в ремонте...'; } } else { - $this->error = ' ...'; + $this->error = 'Свиток ремонтирует только артефакты...'; } } elseif ($rune['type'] == 46) { $idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "' . $id['item_id'] . '" LIMIT` 1')); @@ -6322,9 +5811,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $data['srok'] = $id['srok']; } if ($data['srok'] + $id['time_create'] - time() > 86400 + 30) { - $this->error = ' 30 .'; + $this->error = 'Нельзя использовать на предметы с сроком годности 30 и более дней.'; } elseif ($id['inslot'] > 0 && $id['inslot'] < 20) { - $this->error = ' "' . $id['name'] . '" ' . $this->timeOut($add['uptimeitem']) . '.'; + $this->error = 'Срок годности предмета "' . $id['name'] . '" продлен на ' . $this->timeOut($add['uptimeitem']) . '.'; if (isset($data['sleep_moroz'])) { unset($data['sleep_moroz']); @@ -6336,24 +5825,24 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` mysql_query('UPDATE `items_users` SET `data` = "' . $data . '",`time_create` = `time_create` + ' . floor($add['uptimeitem']) . ' WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); } else { - $this->error = ' ...'; + $this->error = 'Предмет данного типа нельзя продлить...'; } } else { - $this->error = ' ...'; + $this->error = 'Это работает только на предметы с сроком годности...'; } } else { - $this->error = ' ...'; + $this->error = 'Затачивать можно только оружие...'; } } else { - // + //Заточка $data = $this->lookStats($id['data']); $add = $this->lookStats($rune['data']); if (isset($data['upatack_id'])) { - $this->error = ' , .'; + $this->error = 'Предмет уже заточен, вытащите заточку в Ремонтной мастерской.'; } elseif (isset($data['nomodif'])) { - $this->error = ' '; + $this->error = 'Улучшить данный предмет невозможно'; } elseif ($add['uptype'] != $id_type || $add['uptype'] == 0) { - $this->error = ' ...'; + $this->error = 'Заточка не подходит к данному предмету...'; } else { if (isset($data['upatack_id']) && $data['upatack_id'] > 0) { @@ -6381,7 +5870,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` //$data['base_price2'] = $id['2price']; } - // + //Добавляем характеристики руны $i = 0; while ($i < count($this->items['add'])) { if (isset($add['add_' . $this->items['add'][$i]])) { @@ -6398,7 +5887,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $data['sv_yron_min'] += $add['upatack']; $data['sv_yron_max'] += $add['upatack']; //print_r($data); - //die(' .'); + //die('Посохи временно не точатся.'); } elseif ($id['2h'] == 1) { $data['sv_yron_min'] += $add['upatack']; $data['sv_yron_max'] += $add['upatack']; @@ -6412,27 +5901,27 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` //$id['2price'] = $data['base_price2']+$rune['2price']; } - $this->addDelo(2, $this->info['id'], '"System.remont.upatack": "' . $data['upatack_name'] . '" "' . $id['name'] . '" [itm:' . $id['id'] . ']', time(), $this->info['city'], 'System.remont.upatack', 0, 0); + $this->addDelo(2, $this->info['id'], '"System.remont.upatack": Заточка "' . $data['upatack_name'] . '" была успешно встроена в предмет "' . $id['name'] . '" [itm:' . $id['id'] . ']', time(), $this->info['city'], 'System.remont.upatack', 0, 0); $data = $this->impStats($data); mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `items_users` SET `1price` = "' . $id['1price'] . '",`2price` = "' . $id['2price'] . '",`data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); - $this->error = ' "' . $id['name'] . '" '; + $this->error = 'Заточка "' . $id['name'] . '" прошла успешно'; } } } elseif ($rune['type'] == 48) { - // + //Профиль $data = $this->lookStats($id['data']); $add = $this->lookStats($rune['data']); if ($data['tya1'] >= 90 || $data['tya2'] >= 90 || $data['tya3'] >= 90 || $data['tya4'] >= 90) { - $this->error = ' 90 '; + $this->error = 'Предмет уже имеет 90 своего профиля'; } elseif (isset($data['nomodif'])) { - $this->error = ' '; + $this->error = 'Улучшить данный предмет невозможно'; } elseif ($add['uptype'] != $id_type || $add['uptype'] == 0) { - $this->error = ' ...'; + $this->error = 'Заточка не подходит к данному предмету...'; } else { if ($add['tya1'] == 1) { @@ -6466,16 +5955,16 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } - $this->addDelo(2, $this->info['id'], '"System.remont.upatack": "' . $data['upatack_name'] . '" "' . $id['name'] . '" [itm:' . $id['id'] . ']', time(), $this->info['city'], 'System.remont.upatack', 0, 0); - $this->error = ' "' . $id['name'] . '" ! :' . $data['tya1'] . ' :' . $data['tya2'] . ' :' . $data['tya3'] . ' :' . $data['tya4'] . ' '; + $this->addDelo(2, $this->info['id'], '"System.remont.upatack": Заточка "' . $data['upatack_name'] . '" была успешно встроена в предмет "' . $id['name'] . '" [itm:' . $id['id'] . ']', time(), $this->info['city'], 'System.remont.upatack', 0, 0); + $this->error = 'Заточка "' . $id['name'] . '" прошла успешно! Колка:' . $data['tya1'] . ' Руб:' . $data['tya2'] . ' Дробь:' . $data['tya3'] . ' Реж:' . $data['tya4'] . ' '; $data = $this->impStats($data); mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `items_users` SET `1price` = "' . $id['1price'] . '",`2price` = "' . $id['2price'] . '",`data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); - //$this->error = ' "'.$id['name'].'" ! :'.$data['tya1'].' :'.$data['tya2'].' :'.$data['tya3'].' :'.$data['tya4'].' '; + //$this->error = 'Заточка "'.$id['name'].'" прошла успешно! Колка:'.$data['tya1'].' Руб:'.$data['tya2'].' Дробь:'.$data['tya3'].' Реж:'.$data['tya4'].' '; } } elseif ($rune['type'] == 50) { - // + //Страничка саныча //$id['data']; //$rune['data']; //$id['item_id'] @@ -6484,14 +5973,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($id['iznosNOW'] > 0) { $id['iznosNOW']--; - $this->error = ' "' . $id['name'] . '" ! [' . round($id['iznosNOW']) . '/' . round($id['iznosMAX']) . ']'; + $this->error = 'Восстановление "' . $id['name'] . '" прошла успешно! [' . round($id['iznosNOW']) . '/' . round($id['iznosMAX']) . ']'; mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $id['iznosNOW'] . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); } else { - $this->error = ' "' . $id['name'] . '" ! [' . round($id['iznosNOW']) . '/' . round($id['iznosMAX']) . ']'; + $this->error = 'Предмет "' . $id['name'] . '" имеет макисмальное значение прочности! [' . round($id['iznosNOW']) . '/' . round($id['iznosMAX']) . ']'; } } else { - $this->error = ' !!'; + $this->error = 'Данный предмет не подходит для восстановления!!'; } @@ -6502,13 +5991,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $id['type'] = $idt['type']; - // + //Встраиваем руну $data = $this->lookStats($id['data']); $add = $this->lookStats($rune['data']); if (isset($data['nomodif'])) { - $this->error = ' '; + $this->error = 'Улучшить данный предмет невозможно'; } elseif (!isset($data['close']) && $data['close'] != 0) { - $this->error = ' , ...'; + $this->error = 'Не подходит к данному предмету, он не закрыт...'; } else { $data['unopen'] = $rune['id']; $data['unopen_id'] = $rune['item_id']; @@ -6522,7 +6011,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); mysql_query('UPDATE `items_users` SET `data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'); - $this->error = ' "' . $id['name'] . '" '; + $this->error = 'Открытие "' . $id['name'] . '" прошло успешно'; } } elseif ($rune['type'] == 37) { @@ -6534,16 +6023,16 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` // if ($id['gift'] == '' || $id['gift'] == '0') { if (isset($data['notransfer'])) { - $this->error = ' ...'; + $this->error = 'Предмет нельзя передавать...'; } elseif (isset($data['sudba']) && $data['sudba'] != 0) { - $this->error = ' ...'; + $this->error = 'Предмет связан общей судьбой...'; } else { if (isset($add['item_inbox']) && $add['item_inbox'] > 0) { - $this->error = ' - , !'; + $this->error = 'В упаковке уже что-то есть, осталось сделать подарок!'; } elseif ($id['inTransfer'] > 0 || $id['inShop'] > 0 || $id['inGroup'] > 0) { - $this->error = ' , , ...'; + $this->error = 'Нельзя передать этот предмет, он в передаче, на прилавке или в группе...'; } else { - // + //Закидываем предмет в упаковку $add['item_inbox'] = $id['id']; $add['open'] = 1; $add['nosale'] = 1; @@ -6552,23 +6041,23 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` mysql_query('UPDATE `items_users` SET `inGroup` = 0,`data` = "' . $add . '" WHERE `id` = "' . $rune['id'] . '" LIMIT 1'); mysql_query('UPDATE `items_users` SET `uid` = -1 WHERE `id` = "' . $id['id'] . '" LIMIT 1'); // - $this->error = ' "' . $idt['name'] . '" .'; + $this->error = 'Предмет "' . $idt['name'] . '" упакован в коробку.'; // } } } else { - $this->error = ' ...'; + $this->error = 'Даренное не дарят...'; } // } else { - $this->error = ' ...'; + $this->error = 'Вы не сможете упаковать упаковку...'; } } else { - $this->error = '(' . $rune['type'] . ') ...'; + $this->error = '(' . $rune['type'] . ') Усиление которое вы использовали не найдено...'; } } } else { - $this->error = ' ...'; + $this->error = 'Подходящего предмета не нашлось...'; } } @@ -6614,22 +6103,22 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $v = count($slot[9]) + count($slot[10]) + count($slot[11]); $a = count($itm) - $l - $v; if ($this->stats['silver'] == 2) { - // 3 (1 ) + // 3 Артефакта (1оружие и все кроме ювелирки) if ($j > 3 || $l > 1 || $v > 0) { $r = false; } } elseif ($this->stats['silver'] == 3) { - // 6 (1 , 1 4 ) + // 6 Артефактов (1 оружие, 1 ювелирка и 4 вещи на выбор) if ($j > 6 || $l > 1 || $v > 1) { $r = false; } } elseif ($this->stats['silver'] == 4) { - // 9 (2 , 2 5 ) + // 9 Артефактов (2 оружия, 2 ювелирки и 5 вещей на выбор) if ($j > 9 || $l > 2 || $v > 2) { $r = false; } } elseif ($this->stats['silver'] == 5) { - // + // сколько угодно } return $r; } @@ -6643,7 +6132,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $r = $r / 100; } $r = $c['shop_type2']; - //$r = 1; // 100% + //$r = 1; //скупка 100% $r = round(($r / 100), 2); return $r; } @@ -6652,11 +6141,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` { global $c, $code; - $i = 0; // , . - $j = 0; // while ++ - $k = 1; // 0 1 - $rt = [0 => 0, 1 => 0, 2 => '']; // ? - $clr = [0 => 'c8c8c8', 1 => 'd4d4d4']; // + $i = 0; // счетчик, просто обнуняем. + $j = 0; // Всего предметов while ++ + $k = 1; // 0 или 1 + $rt = [0 => 0, 1 => 0, 2 => '']; // Количество? Непонятно + $clr = [0 => 'c8c8c8', 1 => 'd4d4d4']; // Цвет фона для предметов $sort = explode('ORDER BY', $sort); if (isset($sort[0], $sort[1])) { $where = $sort[0]; @@ -6683,28 +6172,28 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $is1 = ''; $is2 = ''; $d = []; - // + //тест $d[0] = 0; $d[1] = 1; $d[2] = 0; $po = $this->lookStats($pl['data']); $see1 = 1; - if ($type == 15) { // + if ($type == 15) { //кормушка зверя if ($anm['type'] == 3 && substr_count($pl['img'], 'wisp') == 0) { - $see1 = 0; // + $see1 = 0; //светляк } elseif ($anm['type'] == 2 && substr_count($pl['img'], 'owl') == 0) { - $see1 = 0; // + $see1 = 0; //сова } elseif ($anm['type'] == 1 && substr_count($pl['img'], 'cat') == 0) { - $see1 = 0; // + $see1 = 0; //кот } elseif ($anm['type'] == 4 && substr_count($pl['img'], 'chrt') == 0) { - $see1 = 0; // + $see1 = 0; //чертяка } elseif ($anm['type'] == 5 && substr_count($pl['img'], 'dog') == 0) { - $see1 = 0; // + $see1 = 0; //собака } elseif ($anm['type'] == 6 && substr_count($pl['img'], 'pig') == 0) { - $see1 = 0; // + $see1 = 0; //свинья } elseif ($anm['type'] == 7 && substr_count($pl['img'], 'dragon') == 0) { - $see1 = 0; // + $see1 = 0; //дракон } } elseif (isset($po['nosale']) && $type == 2) { $see1 = 0; @@ -6727,7 +6216,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $see1 = 0; } elseif ($type == 67 && $pl['gift'] != '') { $see1 = 0; - } elseif ($type == 11) { // ( ) + } elseif ($type == 11) { // Храм Знаний (плавка предметов) if ( $pl['inTransfer'] > 0 || (!empty($po['sudba']) && $po['sudba'] != $this->info['login']) || @@ -6736,8 +6225,8 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` ) { $see1 = 0; } - } elseif ($type == 14) { // ( ) - if ($pl['inTransfer'] > 0 || !in_array($pl['type'], [31, 6001, 6002, 6003]) { + } elseif ($type == 14) { // Храм Знаний (плавка рун) + if ($pl['inTransfer'] > 0 || !in_array($pl['type'], [31, 6001, 6002, 6003])) { $see1 = 0; } } elseif ($type == 12) { @@ -6752,12 +6241,12 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } elseif (isset($po['musor']) && $po['musor'] > 0 && $pl['iznosNOW'] >= $pl['iznosMAX']) { $see1 = 0; } elseif ($type == 57) { - // + //Подгонка if ($pl['type'] < 18 || $pl['type'] > 28 || $pl['type'] == 25) { $see1 = 0; } } elseif ($type == 58) { - // + //Вытаскивание рун if (!isset($po['rune_id'])) { $see1 = 0; } @@ -6810,19 +6299,19 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } else { $k = 1; } - if (($pl['type'] >= 18 && $pl['type'] <= 24) || $pl['type'] == 26 || $pl['type'] == 27) { // + + if (($pl['type'] >= 18 && $pl['type'] <= 24) || $pl['type'] == 26 || $pl['type'] == 27) { //Зоны блока + if (!isset($po['zonb'])) { $po['zonb'] = 0; } $po['zonb']++; } - // + //правая часть $mx = ''; if (isset($po['upatack_lvl'])) { $mx .= ' +' . $po['upatack_lvl']; } if (isset($po['modif'])) { - $mx .= ' ()'; + $mx .= ' (мф)'; } $col = $this->itemsX($pl['id']); if ($col > 1 && $pl['inGroup'] != 0) { @@ -6839,7 +6328,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } } if (isset($po['renameadd']) && $po['renameadd'] != '') { - $pl['name'] .= ' (: ' . $po['renameadd'] . ')'; + $pl['name'] .= ' (Предмет: ' . $po['renameadd'] . ')'; } if (isset($po['icos'])) { $pl['name'] = '' . $pl['name'] . '  ' . $po['icos'] . ' '; @@ -6847,72 +6336,72 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $is2 = '' . $pl['name'] . '' . $mx . ''; $is2 .= '  '; if ($pl['massa'] > 0) { - $is2 .= ' (: ' . ($pl['massa'] * $col) . ')'; + $is2 .= ' (Масса: ' . ($pl['massa'] * $col) . ')'; } if ($pl['gift'] != '') { $ttl = ''; if ($pl['gift'] == 1) { - $ttl = ' -'; + $ttl = 'Вы не можете передать этот предмет кому-либо'; } else { - $ttl = ' ' . $pl['gift'] . '. - '; + $ttl = 'Этот предмет вам подарил ' . $pl['gift'] . '. Вы не сможете передать этот предмет кому-либо еще'; } $is2 .= ' '; } if (isset($po['art'])) { - $is2 .= ' '; + $is2 .= ' '; } if (isset($po['sudba'])) { if ($po['sudba'] == '0') { - $is2 .= ' '; + $is2 .= ' '; } elseif ($po['sudba'] == '1') { - $is2 .= ' '; + $is2 .= ' '; } else { - $is2 .= ' '; + $is2 .= ' '; } } - if ($pl['price1'] > 0) { // + if ($pl['price1'] > 0) { //цена $pex = explode('.', $pl['price1']); if ($pex[1] == '00') { $pl['price1'] = $pex[0]; } if ($_GET['toRent'] == 2) { - $is2 .= '
: ' . ($pl['price1']) . ' .'; + $is2 .= '
Цена: ' . ($pl['price1']) . ' кр.'; } else { - $is2 .= '
: ' . ($pl['price1'] * $col) . ' .'; + $is2 .= '
Цена: ' . ($pl['price1'] * $col) . ' кр.'; } } if ($pl['pricerep'] > 0) { - $is2 .= ' (' . round($pl['pricerep'] * $col, 2) . ' )'; + $is2 .= ' (' . round($pl['pricerep'] * $col, 2) . ' Воинственности)'; } - if ($pl['iznosMAX'] > 0) { // + if ($pl['iznosMAX'] > 0) { //долговечность $izcol = ''; if (floor($pl['iznosNOW']) >= (floor($pl['iznosMAX']) - ceil($pl['iznosMAX']) / 100 * 20)) { $izcol = 'brown'; } if ($pl['iznosMAXi'] == 999999999) { - $is2 .= '
: '; + $is2 .= '
Долговечность: неразрушимо'; } else { - $is2 .= '
: ' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']) . ''; + $is2 .= '
Долговечность: ' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']) . ''; } } if ($po['battleUseZd'] > 0) { - $is2 .= '
: ' . $this->timeOut($po['battleUseZd']) . ''; + $is2 .= '
Задержка использования: ' . $this->timeOut($po['battleUseZd']) . ''; } if (isset($po['srok']) && $po['srok'] > 0) { $pl['srok'] = $po['srok']; } - if ($pl['srok'] > 0) { // - $is2 .= '
: ' . $this->timeOut($pl['srok']) . ' ( ' . date('d.m.Y H:i', $pl['time_create'] + $pl['srok']) . ')'; + if ($pl['srok'] > 0) { //Срок годности предмета + $is2 .= '
Срок годности: ' . $this->timeOut($pl['srok']) . ' (до ' . date('d.m.Y H:i', $pl['time_create'] + $pl['srok']) . ')'; } if ($pl['magic_chance'] > 0) { - $is2 .= '
: ' . min([$pl['magic_chance'], 100]) . '%'; + $is2 .= '
Вероятность срабатывания: ' . min([$pl['magic_chance'], 100]) . '%'; } - if ((int)$pl['magic_inci'] > 0) { // : + if ((int)$pl['magic_inci'] > 0) { //Продолжительность действия магии: $efi = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`type1`,`img`,`mdata`,`actionTime`,`type2`,`type3`,`onlyOne`,`oneType`,`noAce`,`see`,`info`,`overch`,`bp`,`noch` FROM `eff_main` WHERE `id2` = "' . ((int)$pl['magic_inci']) . '" LIMIT 1')); if (isset($efi['id2']) && $efi['actionTime'] > 0) { - $is2 .= '
: ' . $this->timeOut($efi['actionTime']); + $is2 .= '
Продолжительность действия: ' . $this->timeOut($efi['actionTime']); } } @@ -6920,7 +6409,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if (isset($po['sudba']) && $po['sudba'] != '0' && $po['sudba'] != $this->info['login']) { $notr++; } - // : + //Требуется минимальное: $tr = ''; $t = $this->items['tr']; $x = 0; @@ -6963,7 +6452,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $notr++; } } - $tr .= '
'; + $tr .= '
• '; if ($n == 'rep') { $temp = explode('::', $po['tr_' . $n]); $tr .= $this->is[$n] . ' ' . ucfirst(str_replace('city', ' city', $temp[1])) . ': ' . $temp[0]; @@ -6971,9 +6460,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } elseif ($n != 'align' && $n != 'align_bs') { if ($n == 'sex') { if ($po['tr_' . $n] == 1) { - $tr .= $this->is[$n] . ': '; + $tr .= $this->is[$n] . ': Женский'; } else { - $tr .= $this->is[$n] . ': '; + $tr .= $this->is[$n] . ': Мужской'; } } else { $tr .= $this->is[$n] . ': ' . $po['tr_' . $n]; @@ -6996,19 +6485,19 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $x++; } if ($tr != '') { - $is2 .= '
:' . $tr; + $is2 .= '
Требуется минимальное:' . $tr; } - // : + //Действует на: $tr = ''; $t = $this->items['add']; if (isset($po['mf_stats']) && $po['mf_stats'] > 0) { - $tr .= '
: ' . $po['mf_stats']; + $tr .= '
Свободные характеристики: ' . $po['mf_stats']; } if (isset($po['mf_mod']) && $po['mf_mod'] > 0) { - $tr .= '
: ' . $po['mf_mod']; + $tr .= '
Свободные модификаторы: ' . $po['mf_mod']; } if (isset($po['mf_mib']) && $po['mf_mib'] > 0) { - $tr .= '
: ' . $po['mf_mib']; + $tr .= '
Свободные улучшения брони: ' . $po['mf_mib']; } $x = 0; @@ -7019,7 +6508,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($po['add_' . $n] < 0) { $z = ''; } - $tr .= '
' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n]; + $tr .= '
• ' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n]; if (isset($po['mf_stats']) && $po['mf_stats'] > 0) { if ($n == 's1' || $n == 's2' || $n == 's3' || $n == 's5') { $tr .= ' '; @@ -7033,9 +6522,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $x++; } - // () + //действует на (броня) $i = 1; - $bn = [1 => '', 2 => '', 3 => '', 4 => '']; + $bn = [1 => 'головы', 2 => 'корпуса', 3 => 'пояса', 4 => 'ног']; while ($i <= 4) { if (isset($po['add_mab' . $i])) { if ($po['add_mab' . $i] == $po['add_mib' . $i] && $pl['geniration'] == 1) { @@ -7043,9 +6532,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($po['add_mab' . $i] < 0) { $z = ''; } - $tr .= '
' . $bn[$i] . ': ' . $z . '' . $po['add_mab' . $i]; + $tr .= '
• Броня ' . $bn[$i] . ': ' . $z . '' . $po['add_mab' . $i]; } else { - $tr .= '
' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i]; + $tr .= '
• Броня ' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i]; } if (isset($po['mf_mib']) && $po['mf_mib'] > 0) { $tr .= ' '; @@ -7055,13 +6544,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } if ($tr != '') { - $is2 .= '
:' . $tr; + $is2 .= '
Действует на:' . $tr; } - // : + //Свойства предмета: $tr = ''; $t = $this->items['sv']; if (isset($po['sv_yron_min'], $po['sv_yron_max'])) { - $tr .= '
: ' . $po['sv_yron_min'] . ' - ' . $po['sv_yron_max']; + $tr .= '
• Урон: ' . $po['sv_yron_min'] . ' - ' . $po['sv_yron_max']; } $x = 0; while ($x < count($t)) { @@ -7071,18 +6560,18 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($po['sv_' . $n] < 0) { $z = ''; } - $tr .= '
' . $this->is[$n] . ': ' . $z . '' . $po['sv_' . $n]; + $tr .= '
• ' . $this->is[$n] . ': ' . $z . '' . $po['sv_' . $n]; } $x++; } if ($pl['2too'] == 1) { - $tr .= '
'; + $tr .= '
• Второе оружие'; } if ($pl['2h'] == 1) { - $tr .= '
'; + $tr .= '
• Двуручное оружие'; } if (isset($po['zonb'])) { - $tr .= '
: '; + $tr .= '
• Зоны блокирования: '; if ($po['zonb'] > 0) { $x = 1; while ($x <= $po['zonb']) { @@ -7090,69 +6579,69 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $x++; } } else { - $tr .= ''; + $tr .= '—'; } } if ($tr != '') { - $is2 .= '
:' . $tr; + $is2 .= '
Свойства предмета:' . $tr; } - // + //Особенности /*$tr = ''; $x = 1; while($x<=4){ if(isset($po['tya'.$x]) && $po['tya'.$x]>0){ - $tyc = ' '; + $tyc = 'Ничтожно редки'; if($po['tya'.$x]>6){ - $tyc = ''; + $tyc = 'Редки'; } if($po['tya'.$x]>14){ - $tyc = ''; + $tyc = 'Малы'; } if($po['tya'.$x]>34){ - $tyc = ''; + $tyc = 'Временами'; } if($po['tya'.$x]>79){ - $tyc = ''; + $tyc = 'Регулярны'; } if($po['tya'.$x]>89){ - $tyc = ''; + $tyc = 'Часты'; } if($po['tya'.$x]>=100){ - $tyc = ''; + $tyc = 'Всегда'; } - $tr .= '
'.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)'; + $tr .= '
• '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)'; } $x++; } $x = 1; while($x<=7){ if(isset($po['tym'.$x]) && $po['tym'.$x]>0){ - $tyc = ' '; + $tyc = 'Ничтожно редки'; if($po['tym'.$x]>6){ - $tyc = ''; + $tyc = 'Редки'; } if($po['tym'.$x]>14){ - $tyc = ''; + $tyc = 'Малы'; } if($po['tym'.$x]>34){ - $tyc = ''; + $tyc = 'Временами'; } if($po['tym'.$x]>79){ - $tyc = ''; + $tyc = 'Регулярны'; } if($po['tym'.$x]>89){ - $tyc = ''; + $tyc = 'Часты'; } if($po['tym'.$x]>=100){ - $tyc = ''; + $tyc = 'Всегда'; } - $tr .= '
'.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)'; + $tr .= '
• '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)'; } $x++; } if($tr!=''){ - $is2 .= '
:'.$tr; + $is2 .= '
Особенности:'.$tr; }*/ if ($notr == 0) { $d[0] = 1; @@ -7167,34 +6656,34 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $d[0] = 0; $d[2] = 0; } - // + //Апгрейды вещей $tr = ''; - // + //Встроенная магия if ($pl['magic_inci'] != '' || $pl['magic_inc'] != '') { if ($pl['magic_inc'] == '') { $pl['magic_inc'] = $pl['magic_inci']; } $mgi = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "' . $pl['magic_inc'] . '" AND `type1` = "12345" LIMIT 1')); if (isset($mgi['id2'])) { - $is2 .= '
' . $mgi['minfo'] . '
'; + $is2 .= '
Встроено заклятие ' . $mgi['minfo'] . '
'; } } if (isset($po['rune']) && $po['rune'] > 0) { $rnc = explode(' ', $po['rune_name']); - if ($rnc[0] == '') { + if ($rnc[0] == 'Игнис') { $rnc = '#9b5d40'; - } elseif ($rnc[0] == '') { + } elseif ($rnc[0] == 'Аква') { $rnc = '#3a2b64'; - } elseif ($rnc[0] == '') { + } elseif ($rnc[0] == 'Аура') { $rnc = '#20a3b0'; - } elseif ($rnc[0] == '') { + } elseif ($rnc[0] == 'Тера') { $rnc = '#4c7718'; } else { $rnc = '#4c4c4c'; } - $tr .= '
• : ' . $po['rune_name'] . ''; + $tr .= '
• Встроенная руна: ' . $po['rune_name'] . ''; unset($rnc); } @@ -7211,12 +6700,12 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } else { $rnc = '#d99800'; } - $po['spell_name'] = str_replace(' ', '', $po['spell_name']); - $this->is['mab1'] = ' '; - $this->is['mab2'] = ' '; - $this->is['mab3'] = ' '; - $this->is['mab4'] = ' '; - $tr .= '
• : ' . $po['spell_name'] . ' (' . $this->is[$po['spell_st_name']] . ': +' . $po['spell_st_val'] . ')'; + $po['spell_name'] = str_replace('Зачаровать ', '', $po['spell_name']); + $this->is['mab1'] = 'Броня головы'; + $this->is['mab2'] = 'Броня корпуса'; + $this->is['mab3'] = 'Броня пояса'; + $this->is['mab4'] = 'Броня ног'; + $tr .= '
• Встроенно зачарование: ' . $po['spell_name'] . ' (' . $this->is[$po['spell_st_name']] . ': +' . $po['spell_st_val'] . ')'; unset($this->is['mab1'], $this->is['mab2'], $this->is['mab3'], $this->is['mab4']); unset($rnc); } @@ -7233,60 +6722,60 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } else { $rnc = '#282828'; } - $po['imposed_name'] = str_replace(' ', '', $po['imposed_name']); - $tr .= '
: ' . $po['imposed_name'] . ' '; + $po['imposed_name'] = str_replace('Чары ', '', $po['imposed_name']); + $tr .= '
Наложены заклятия: ' . $po['imposed_name'] . ' '; unset($rnc); } if ($tr != '') { - $is2 .= '
:'; + $is2 .= '
Улучшения предмета:'; $is2 .= $tr; } /* if($pl['lvl_itm']>0) { - $is2 .= '
: ['.$pl['blvl'].'/100]'; + $is2 .= '
Уровень развития: ['.$pl['blvl'].'/100]'; } if($pl['so']>0) { - $is2 .= '
• :'; + $is2 .= '
• Очки развития предмета:'; $is2 .= '
-: '.(0+$po['add_s1']).' '.(10+25*$po['add_s1']).' -
: '.$po['add_s2'].' '.(10+25*$po['add_s2']).' -
: '.$po['add_s3'].' '.(10+25*$po['add_s3']).' -
: '.$po['add_s5'].' '.(10+25*$po['add_s5']).' +Сила: '.(0+$po['add_s1']).' '.(10+25*$po['add_s1']).' ОР +
Ловкость: '.$po['add_s2'].' '.(10+25*$po['add_s2']).' ОР +
Интуиция: '.$po['add_s3'].' '.(10+25*$po['add_s3']).' ОР +
Интеллект: '.$po['add_s5'].' '.(10+25*$po['add_s5']).' ОР -
. . : '.$po['add_m1'].' '.(1+2*$po['add_m1']).' -
. . : '.$po['add_m2'].' '.(1+2*$po['add_m2']).' -
. : '.$po['add_m4'].' '.(1+2*$po['add_m4']).' -
. : '.$po['add_m5'].' '.(1+2*$po['add_m5']).' +
Мф. крит. удара: '.$po['add_m1'].' '.(1+2*$po['add_m1']).' ОР +
Мф. против крит. удара: '.$po['add_m2'].' '.(1+2*$po['add_m2']).' ОР +
Мф. увертывания: '.$po['add_m4'].' '.(1+2*$po['add_m4']).' ОР +
Мф. против увертывания: '.$po['add_m5'].' '.(1+2*$po['add_m5']).' ОР -
: '.(0+$po['add_mib1']).'-'.(0+$po['add_mab1']).' '.(5+5*$po['add_mab1']).' -
: '.(0+$po['add_mib2']).'-'.(0+$po['add_mab2']).' '.(5+5*$po['add_mab2']).' -
: '.(0+$po['add_mib3']).'-'.(0+$po['add_mab3']).' '.(5+5*$po['add_mab3']).' -
: '.(0+$po['add_mib4']).'-'.(0+$po['add_mab4']).' '.(5+5*$po['add_mab4']).' +
Броня головы: '.(0+$po['add_mib1']).'-'.(0+$po['add_mab1']).' '.(5+5*$po['add_mab1']).' ОР +
Броня головы: '.(0+$po['add_mib2']).'-'.(0+$po['add_mab2']).' '.(5+5*$po['add_mab2']).' ОР +
Броня головы: '.(0+$po['add_mib3']).'-'.(0+$po['add_mab3']).' '.(5+5*$po['add_mab3']).' ОР +
Броня головы: '.(0+$po['add_mib4']).'-'.(0+$po['add_mab4']).' '.(5+5*$po['add_mab4']).' ОР -
: '.$po['add_m10'].' '.(4+4*$po['add_m10']).' -
: '.$po['add_m11a'].' '.(5+5*$po['add_m11a']).' +
Мощность урона: '.$po['add_m10'].' '.(4+4*$po['add_m10']).' ОР +
Мощность магии: '.$po['add_m11a'].' '.(5+5*$po['add_m11a']).' ОР -
: '.$po['add_za'].' '.(5+5*$po['add_za']).' -
: '.$po['add_zm'].' '.(4+4*$po['add_zm']).' +
Защита от урона: '.$po['add_za'].' '.(5+5*$po['add_za']).' ОР +
Защита от магии: '.$po['add_zm'].' '.(4+4*$po['add_zm']).' ОР
'; - $is2 .= '• : '.$pl['so'].''; + $is2 .= '• Осталось очков развития: '.$pl['so'].''; } */ if (isset($po['free_stats']) && $po['free_stats'] > 0) { - $is2 .= '
:'; - $is2 .= '
: ' . $po['add_s1'] . '
: ' . $po['add_s2'] . '
: ' . $po['add_s3'] . '
: ' . $po['add_s5'] . '
'; - $is2 .= '• : ' . $po['free_stats'] . ''; + $is2 .= '
Распределение статов:'; + $is2 .= '
Сила: ' . $po['add_s1'] . '
Ловкость: ' . $po['add_s2'] . '
Интуиция: ' . $po['add_s3'] . '
Интеллект: ' . $po['add_s5'] . '
'; + $is2 .= '• Осталось распределений: ' . $po['free_stats'] . ''; } if (isset($po['sm_abil'])) { - // + //Возможно сохранять и распределять скилы $mx2 = 1; $mx1 = 0; $mx3 = $this->lookStats($this->info['stats']); @@ -7296,27 +6785,27 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $mx1 += $this->info['ability']; if ($mx1 > 0) { - $is2 .= '
:'; + $is2 .= '
Распределение характеристик:'; if (isset($po['sudba']) && $po['sudba'] == '0') { $mx1 = 0; - $is2 .= '
'; + $is2 .= '
• Распределение характеристик будет доступно после первого одевания
'; } else { $is2 .= '
- : ' . (0 + $po['add_s1']) . '
- : ' . (0 + $po['add_s2']) . '
- : ' . (0 + $po['add_s3']) . '
- : ' . (0 + $po['add_s4']) . '
- : ' . (0 + $po['add_s5']) . '
- : ' . (0 + $po['add_s6']) . '
+ Сила: ' . (0 + $po['add_s1']) . '
+ Ловкость: ' . (0 + $po['add_s2']) . '
+ Интуиция: ' . (0 + $po['add_s3']) . '
+ Выносливость: ' . (0 + $po['add_s4']) . '
+ Интеллект: ' . (0 + $po['add_s5']) . '
+ Мудрость: ' . (0 + $po['add_s6']) . '
'; - $is2 .= ' : ' . $mx1; + $is2 .= 'Осталось распределений: ' . $mx1; } } unset($mx1, $mx2, $mx3); } if (isset($po['sm_skill'])) { - // + //Возможно сохранять и распределять скилы $mx2 = 1; $mx1 = 0; $mx3 = $this->lookStats($this->info['stats']); @@ -7326,42 +6815,42 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $mx1 += $this->info['skills']; if ($mx1 > 0) { - $is2 .= '
:'; + $is2 .= '
Распределение владений оружием и магией:'; if (isset($po['sudba']) && $po['sudba'] == '0') { $mx1 = 0; - $is2 .= '
'; + $is2 .= '
• Распределение владений будет доступно после первого одевания
'; } else { $is2 .= '
- : ' . (0 + $po['add_a1']) . '
- , : ' . (0 + $po['add_a2']) . '
- , : ' . (0 + $po['add_a3']) . '
- , : ' . (0 + $po['add_a4']) . '
- : ' . (0 + $po['add_a5']) . '
- : ' . (0 + $po['add_mg1']) . '
- : ' . (0 + $po['add_mg2']) . '
- : ' . (0 + $po['add_mg3']) . '
- : ' . (0 + $po['add_mg4']) . '
- : ' . (0 + $po['add_mg5']) . '
- : ' . (0 + $po['add_mg6']) . '
- : ' . (0 + $po['add_mg7']) . '
+ Мастерство владения мечами: ' . (0 + $po['add_a1']) . '
+ Мастерство владения дубинами, булавами: ' . (0 + $po['add_a2']) . '
+ Мастерство владения ножами, кастетами: ' . (0 + $po['add_a3']) . '
+ Мастерство владения топорами, секирами: ' . (0 + $po['add_a4']) . '
+ Мастерство владения магическими посохами: ' . (0 + $po['add_a5']) . '
+ Мастерство владения стихией Огня: ' . (0 + $po['add_mg1']) . '
+ Мастерство владения стихией Воздуха: ' . (0 + $po['add_mg2']) . '
+ Мастерство владения стихией Воды: ' . (0 + $po['add_mg3']) . '
+ Мастерство владения стихией Земли: ' . (0 + $po['add_mg4']) . '
+ Мастерство владения магией Света: ' . (0 + $po['add_mg5']) . '
+ Мастерство владения магией Тьмы: ' . (0 + $po['add_mg6']) . '
+ Мастерство владения серой магией: ' . (0 + $po['add_mg7']) . '
'; - $is2 .= ' : ' . $mx1; + $is2 .= 'Осталось распределений: ' . $mx1; } } unset($mx1, $mx2, $mx3); } if (isset($po['complect']) || isset($po['complect2'])) { - $is2 .= '
:'; + $is2 .= '
Дополнительная информация:'; } if (isset($po['complect'])) { - // - $com1 = ['name' => ' ', 'x' => 0, 'text' => '']; + //не отображается + $com1 = ['name' => 'Неизвестный Комплект', 'x' => 0, 'text' => '']; $spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "' . $po['complect'] . '" ORDER BY `x` ASC LIMIT 20'); while ($plc = mysql_fetch_array($spc)) { $com1['name'] = $plc['name']; $com1['text'] .= '    • ' . $plc['x'] . ': '; - // + //действие комплекта $i1c = 0; $i2c = 0; $i1e = $this->lookStats($plc['data']); @@ -7384,18 +6873,18 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` unset($i1c, $i2c, $i3c); $com1['x']++; } - $is2 .= '
• : ' . $com1['name'] . '
'; + $is2 .= '
• Часть комплекта: ' . $com1['name'] . '
'; $is2 .= $com1['text']; $is2 .= ''; } if (isset($po['complect2'])) { - // - $com1 = ['name' => ' ', 'x' => 0, 'text' => '']; + //не отображается + $com1 = ['name' => 'Неизвестный Комплект', 'x' => 0, 'text' => '']; $spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "' . $po['complect2'] . '" ORDER BY `x` ASC LIMIT 20'); while ($plc = mysql_fetch_array($spc)) { $com1['name'] = $plc['name']; $com1['text'] .= '    • ' . $plc['x'] . ': '; - // + //действие комплекта $i1c = 0; $i2c = 0; $i1e = $this->lookStats($plc['data']); @@ -7418,13 +6907,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` unset($i1c, $i2c, $i3c); $com1['x']++; } - $is2 .= '
• (): ' . $com1['name'] . '
'; + $is2 .= '
• Часть комплекта (подгонка): ' . $com1['name'] . '
'; $is2 .= $com1['text']; $is2 .= ''; } if ($pl['max_text'] > 0) { - // + //Инвентарь $sm_sp = mysql_query('SELECT `id`,`item_id`,`time`,`login`,`type`,`text`,`city`,`x` FROM `items_text` WHERE `item_id` = "' . $pl['id'] . '" ORDER BY `id` ASC LIMIT 500'); $sma = 0; $smt = ''; @@ -7443,10 +6932,10 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $smt .= ''; if ($pl['max_text'] - $pl['use_text'] > 0) { - $is2 .= '
: ' . ($pl['max_text'] - $pl['use_text']) . '
'; + $is2 .= '
Количество символов: ' . ($pl['max_text'] - $pl['use_text']) . '
'; } if ($sma > 0) { - $is2 .= '
:
+ $is2 .= '
На предмете записан текст:
@@ -7457,7 +6946,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } unset($sm_sp, $sma, $sm_pl); } elseif (isset($po['onitm_text'])) { - $is2 .= '
:
+ $is2 .= '
На предмете записан текст:
' . $smt . '
@@ -7467,13 +6956,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } if (isset($po['gravi'])) { - $is2 .= '
: ' . $po['gravi'] . ''; + $is2 .= '
На поверхности выгравирована надпись: ' . $po['gravi'] . ''; } $is2 .= ''; if ($pl['info'] != '') { - $is2 .= '
:
' . $pl['info'] . '
'; + $is2 .= '
Рекомендации:
' . $pl['info'] . '
'; } if (isset($po['info']) && $po['info'] != '') { @@ -7481,17 +6970,17 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } if ($pl['maidin'] != '') { - //$is2 .= '
'.$this->city_name[$pl['maidin']].'
'; + //$is2 .= '
Сделано в '.$this->city_name[$pl['maidin']].'
'; } if (isset($po['toclan'])) { $po['toclan1'] = explode('#', $po['toclan']); $clpo = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $po['toclan1'][0] . '" LIMIT 1')); if (isset($clpo['id'])) { - $is2 .= '
' . $clpo['name'] . ''; + $is2 .= '
Предмет принадлежит клану ' . $clpo['name'] . ''; $plpo = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`cityreg` FROM `users` WHERE `id` = "' . $po['toclan1'][1] . '" LIMIT 1')); if (isset($plpo['id'])) { - $is2 .= ' ( ' . $plpo['login'] . ')'; + $is2 .= ' (Дар игрока ' . $plpo['login'] . ')'; if ($plpo['login'] == $this->info['login']) { if (isset($_GET['backmyitm'])) { $pl['inOdet'] = 0; @@ -7500,33 +6989,33 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $pl['data'] = $this->impStats($po); mysql_query('UPDATE `items_users` SET `data` = "' . mysql_real_escape_string($pl['data']) . '",`inOdet` = 0,`uid` = "' . $pl['uid'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } - $is2 .= '
( : )'; + $is2 .= '
(Вы владелец предмета: Вернуть предмет себе)'; } } $is2 .= '
'; } } if (isset($po['noremont'])) { - $is2 .= '
'; + $is2 .= '
Предмет не подлежит ремонту
'; } if (isset($po['nosale'])) { - $is2 .= '
'; + $is2 .= '
Предмет нельзя продать
'; } if (isset($po['nomodif'])) { - $is2 .= '
'; + $is2 .= '
Предмет нельзя улучшать
'; } if (isset($po['nodelete'])) { - $is2 .= '
'; + $is2 .= '
Предмет нельзя выбросить
'; } if (isset($po['frompisher'])) { - $is2 .= '
'; + $is2 .= '
Предмет из подземелья
'; } if (isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0) { - $is2 .= '
'; + $is2 .= '
Предмет не портится во время сна
'; } if (isset($po['fromlaba']) && $po['fromlaba'] > 0) { - $is2 .= '
'; + $is2 .= '
Предмет из лабиринта
'; } if (isset($po['vip_sale']) && $po['vip_sale'] > 0) { @@ -7535,28 +7024,28 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $pl['time_create'] = $this->stats['slvtm']; mysql_query('UPDATE `items_users` SET `time_create` = "' . $pl['time_create'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'); } - $is2 .= '
' . $this->timeOut($pl['time_create'] - time()) . '
'; - //$is2 .= '
'.$this->timeOut($pl['time_create']-time()+86400*30).'
'; + $is2 .= '
Предмет будет недоступен через ' . $this->timeOut($pl['time_create'] - time()) . '
'; + //$is2 .= '
Предмет исчезнет через '.$this->timeOut($pl['time_create']-time()+86400*30).'
'; } else { - $is2 .= '
, VIP
'; + $is2 .= '
Предмет недоступен, приобретите конкретный VIP
'; if (($pl['time_create'] - time() + 86400 * 30) < 1) { - $is2 .= '
...
'; + $is2 .= '
Предмет рассыпался у Вас на глазах...
'; } else { - $is2 .= '
' . $this->timeOut($pl['time_create'] - time() + 86400 * 30) . '
'; + $is2 .= '
Предмет исчезнет через ' . $this->timeOut($pl['time_create'] - time() + 86400 * 30) . '
'; } } } if ($pl['dn_delete'] > 0) { - $is2 .= '
'; + $is2 .= '
Предмет будет удален при выходе из подземелья
'; } if ($this->pokol > $pl['geni']) { - $is2 .= '
'; + $is2 .= '
Предмет устарел
'; } if (isset($po['zazuby']) && $po['zazuby'] > 0) { - $is2 .= '
'; + $is2 .= '
Предмет куплен за зубы
'; } $is2 .= '
'; @@ -7581,18 +7070,18 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($type == 81) { - $is1 .= ' '; + $is1 .= 'Выбрать данный предмет'; } elseif ($type == 80) { //$this->lookStats($itm['data']); //$pl['id'] $itemrun = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `id` ="' . $pl['id'] . '" LIMIT 1')); $it = $this->lookStats($itemrun['data']); - if (!isset($it['rune_name']) || $_GET['otdel'] == 2) // 2() + if (!isset($it['rune_name']) || $_GET['otdel'] == 2) //отдел 2(заточки) { - $is1 .= ' '; + $is1 .= 'Выбрать данный предмет'; } else { - $is1 .= ':
' . $it['rune_name'] . '
'; + $is1 .= 'Установленна:
' . $it['rune_name'] . '
'; } unset($itemrun, $it); } elseif ($type == 69) { @@ -7604,61 +7093,61 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } $prs1 = $this->floordec($po['hprs'] * $col, 2); $rps1 = $this->floordec($po['hprp'] * $col); - $is1 .= ' ' . $prs1 . ' .
' . $rps1 . ' . '; + $is1 .= 'Обменять на ' . $prs1 . ' кр.
Обменять на ' . $rps1 . ' ед. репутации'; $is1 .= '
'; } elseif ($type == 68) { - $is1 .= '
'; + $is1 .= 'Забрать
Отказаться'; if ($pl['lastUPD'] > 0) { $is1 .= '

(' . $this->timeOut(($pl['lastUPD'] + 7 * 24 * 60 * 60) - time()) . ')'; } $is1 .= '
'; } elseif ($type == 67) { - $is1 .= ' ' . (round(1 + $pl['price1'] / 100 * 7) * $col) . ' .'; + $is1 .= 'передать за ' . (round(1 + $pl['price1'] / 100 * 7) * $col) . ' кр.'; } elseif ($type == 66) { $pos = explode('#', $po['toclan']); $us_1 = $pos[1]; if ($pl['uid'] < 1) { - $is1 .= ' '; + $is1 .= 'Взять предмет'; } else { $yui = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`cityreg` FROM `users` WHERE `id` = "' . mysql_real_escape_string($pl['uid']) . '" LIMIT 1')); - $is1 .= '
' . $yui['login'] . '
'; + $is1 .= 'Предмет у игрока
' . $yui['login'] . '
'; if ($this->info['tt'][14][0] == 1 || ($this->info['id'] == $us_1)) { - $is1 .= '
'; + $is1 .= '
Изъять предмет'; } } } elseif ($type == 65) { if (!isset($po['toclan'])) { - $is1 .= ''; + $is1 .= 'Пожертвовать'; } else { - $is1 .= ''; + $is1 .= 'Вернуть'; } } elseif ($type == 62) { $upgitm = mysql_fetch_array(mysql_query('SELECT * FROM `items_upgrade` WHERE `iid` = "' . $pl['item_id'] . '" LIMIT 1')); if (!isset($upgitm['id'])) { - $is1 .= ' '; + $is1 .= 'Улучшение невозможно'; } else { $prcup = ''; if ($upgitm['price1'] > 0) { - $prcup .= $upgitm['price1'] . ' .'; + $prcup .= $upgitm['price1'] . ' кр.'; } if ($upgitm['price2'] > 0) { if ($prcup != '') { - $prcup .= ' '; + $prcup .= ' и '; } - $prcup .= $upgitm['price2'] . ' .'; + $prcup .= $upgitm['price2'] . ' екр.'; } - $is1 .= ' ' . $prcup . ''; + $is1 .= 'Улучшить за ' . $prcup . ''; unset($prcup); } } elseif ($type == 63) { $prcup = ''; - $is1 .= ''; + $is1 .= 'комплект'; unset($prcup); } elseif ($type == 64) { $prcup = ''; - $is1 .= ' '; + $is1 .= 'Выбрать другой предмет'; unset($prcup); - } elseif ($type == 61) { // + } elseif ($type == 61) { //улучшение предмета if ($pl['price1'] > $pl['1price']) { $pl['1price'] = $pl['price1']; } @@ -7674,8 +7163,8 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $prpod = $prpod / 2.37; } $prpod = round($prpod + $prpod / 100 * (37.795 * ($po['upgrade'] + 1))); - $is1 .= ' ' . $prpod . ' .'; - } elseif ($type == 60) { // + $is1 .= 'Усилить за ' . $prpod . ' кр.'; + } elseif ($type == 60) { //модифицирование if ($pl['price1'] > $pl['1price']) { $pl['1price'] = $pl['price1']; } @@ -7691,24 +7180,24 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $prpod = $prpod / 2; } $prpod = round($prpod); - $is1 .= ' ' . $prpod . ' .'; + $is1 .= 'Модифицировать за ' . $prpod . ' кр.'; - } elseif ($type == 59) { // + } elseif ($type == 59) { //дезинтеграция if ($po['tr_lvl'] > $pl['level']) { $pl['level'] = $po['tr_lvl']; } //$prpod = $pl['level']*200; $prpod = 250; $prpod_ekr = $pl['level'] * 0.25; - //$is1 .= ' '.$prpod.' .'; + //$is1 .= 'Дезинтегрировать за '.$prpod.' кр.'; if ($this->stats['repair_z'] >= 1) { - $is1 .= ' '; + $is1 .= 'Бесплатная дезинтеграция'; } else { - $is1 .= ' ' . $prpod . ' . - '; + $is1 .= 'Дезинтегрировать за ' . $prpod . ' Кр. + '; } - } elseif ($type == 58) { // + } elseif ($type == 58) { //вытаскивание рун if ($po['tr_lvl'] > $pl['level']) { $pl['level'] = $po['tr_lvl']; } @@ -7716,10 +7205,10 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $prpod = 2500; $prpod_ekr = $pl['level'] * 0.15; if ($this->stats['repair_r'] >= 1) { - $is1 .= ' '; + $is1 .= 'Бесплатно извлечь руны'; } else { - $is1 .= ' ' . $prpod . ' .
- '; } } elseif ($type == 57) { @@ -7730,19 +7219,19 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $prpod = 15; } if (isset($po['gravi'])) { - $is1 .= ' ' . $prpod . ' .'; + $is1 .= 'Изменить надпись за ' . $prpod . ' кр.'; } else { - $is1 .= ' ' . $prpod . ' .'; + $is1 .= 'Выгравировать надпись за ' . $prpod . ' кр.'; } - } elseif ($type == 56) { // + } elseif ($type == 56) { //Подгонка if ($po['tr_lvl'] > $pl['level']) { $pl['level'] = $po['tr_lvl']; } $prpod = 5 * $pl['level'] + 10; $prhp = 6 * $pl['level'] + 6; - $is1 .= ' ' . $prpod . ' .'; - } elseif ($type == 15) { // - $is1 .= ''; + $is1 .= 'Подогнать за ' . $prpod . ' кр.'; + } elseif ($type == 15) { //кормушка зверя + $is1 .= 'Кормить'; } elseif ($type == 11) { $pl['rep'] = 0; if ($this->rep['rep1'] < 100) { @@ -7771,49 +7260,49 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $pl['rep'] = 2; } } - $is1 .= ''; + $is1 .= 'Выбрать'; } elseif ($type == 14) { - $is1 .= ''; + $is1 .= 'Выбрать'; } elseif ($type == 12) { - $is1 .= ''; + $is1 .= 'Выбрать'; } elseif ($type == 10) { - // ( ( )) - $is1 .= ' '; + //Общага (отображение предметов в общаге (под стеклом)) + $is1 .= 'В рюкзак'; } elseif ($type == 9) { - // ( ( )) - $is1 .= ' '; + //Общага (отображение предметов в инвентаре (под стеклом)) + $is1 .= 'Под стекло'; } elseif ($type == 8) { - // ( ) - $is1 .= ' '; + //Общага (отображение предметов в инвентаре) + $is1 .= 'В сундук'; } elseif ($type == 7) { - // ( ) - $is1 .= ' '; + //Общага (отображение предметов в общаге) + $is1 .= 'В рюкзак'; } elseif ($type == 6) { - // - $is1 .= ''; + //Цветочный магазин + $is1 .= 'Добавить'; } elseif ($type == 5) { - // - $is1 .= '

(: 1 .)'; + //передача + $is1 .= 'подарить
передать
(налог: 1 кр.)'; } elseif ($type == 12) { - // + //передача почта $skcd = round($col * ($pl['price1'] * 0.06 - 0.01 * $this->stats['os1']), 2); if ($skcd < 0.06) { $skcd = 0.06; } - $is1 .= '  ' . (1 + $skcd) . ' .'; + $is1 .= 'передать за ' . (1 + $skcd) . ' кр.'; } elseif ($type == 13) { - // + //Забираем шмот if ($pl['1price'] > 0) { - $mess = " ? !"; - $pl['name'] = ' ' . $pl['1price'] . ' .'; + $mess = "Отказаться от предмета? Предмет будет уничтожен!"; + $pl['name'] = 'Деньги ' . $pl['1price'] . ' кр.'; } else { - $mess = " ? "; + $mess = "Отказаться от предмета? Предмет будет возвращен отправителю"; } $date1 = $pl['delete'] - time(); - $is1 .= '
-


(' . date("j . H .", $date1) . ' )
'; + $is1 .= '
Забрать +
Отказаться

(' . date("j дн. H ч.", $date1) . ' )
'; } elseif ($type == 4) { - // + //ремонт $r1 = round($pl['price1'] * 0.1 / 100, 2); $r2 = round($pl['price1'] * 0.1 / 10, 2); $r3 = round($pl['price1'] * $pl['iznosNOW'] * 0.10 / 100, 2); @@ -7833,22 +7322,22 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($r3 < 0.01) { $r3 = 0.01; } - $is1 .= ' 1 . ' . $r1 . ' .
'; + $is1 .= 'Ремонт 1 ед. за ' . $r1 . ' кр.
'; if ($pl['iznosNOW'] >= 10) { - $is1 .= ' 10 . ' . $r2 . ' .
'; + $is1 .= 'Ремонт 10 ед. за ' . $r2 . ' кр.
'; } - $is1 .= ' ' . $r3 . ' .
'; + $is1 .= 'Полный ремонт за ' . $r3 . ' кр.
'; if ($c['zuby'] == true) { if ($this->info['level'] < 8) { - $is1 .= '
1 . ' . $this->zuby($r1) . '
'; + $is1 .= '
Ремонт 1 ед. за ' . $this->zuby($r1) . '
'; if ($pl['iznosNOW'] >= 10) { - $is1 .= ' 10 . ' . $this->zuby($r2) . '
'; + $is1 .= 'Ремонт 10 ед. за ' . $this->zuby($r2) . '
'; } - $is1 .= ' ' . $this->zuby($r3) . '
'; + $is1 .= 'Полный ремонт за ' . $this->zuby($r3) . '
'; } } } elseif ($type == 3) { - $is1 .= ''; + $is1 .= ''; } elseif ($type == 2) { global $shopProcent; $shpCena = $pl['1price']; @@ -7891,13 +7380,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } else { $d_s = true; } - if ($d_s == true) { // - $is1 .= ' ' . $shpCena . ' .'; + if ($d_s == true) { // Продать за кр тут + $is1 .= 'Продать за ' . $shpCena . ' кр.'; if ($pl['pricerep'] > 0) { - $is1 .= '
' . floor($pl['pricerep'] * $pl['kolvo'] / 2) . ' c. '; + $is1 .= '
Обменять на ' . floor($pl['pricerep'] * $pl['kolvo'] / 2) . ' Воинc. '; } } else { - $is1 .= ' .'; + $is1 .= 'Это не ваш предмет.'; } } elseif ($type == 16) { $shpCena = $pl['price2']; @@ -7923,11 +7412,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` if ($pl['iznosMAX'] > 0 && $pl['iznosMAXi'] > 0 && $pl['iznosMAXi'] > $pl['iznosMAX']) { $shpCena = $shpCena / 100 * ($pl['iznosMAX'] / $pl['iznosMAXi'] * 100); } - //$shpCena = $this->round2($shpCena*0.5); // + //$shpCena = $this->round2($shpCena*0.5); // Цена предметов if (isset($po['art'])) { - $shpCena = $this->round2($shpCena * $this->berezCena()); // + $shpCena = $this->round2($shpCena * $this->berezCena()); // Цена арта } else { - $shpCena = $this->round2($shpCena * $this->berezCena()); // + $shpCena = $this->round2($shpCena * $this->berezCena()); // Цена } if ($shpCena < 0) { $shpCena = 0; @@ -7944,9 +7433,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $d_s = true; } if ($d_s == true) { - $is1 .= ' ' . $shpCena . ' .'; + $is1 .= 'Продать за ' . $shpCena . ' екр.'; } else { - $is1 .= ' .'; + $is1 .= 'Это не ваш предмет.'; } } elseif ($type == 30) { if (isset($po['toclan'])) { @@ -7961,40 +7450,40 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` $d_s = true; } if ($d_s == true) { - $is1 .= '
'; + $is1 .= '
'; } else { - $is1 .= ' .'; + $is1 .= 'Это не ваш предмет.'; } } elseif ($type == 31) { - $is1 .= '
'; + $is1 .= '
'; } else { - if ($d[2] == 1) { // + if ($d[2] == 1) { //можно использовать $inv1 = ''; if (isset($_GET['inv'])) { $inv1 = 'inv=1&'; } if ($pl['item_id'] == 74) { - $is1 .= '-'; + $is1 .= 'исп-ть'; } else { $useUrl = ''; if ($pl['magic_inc'] == '') { $pl['magic_inc'] = $pl['magic_inci']; } if ($pl['magic_inc'] && $pl['type'] == 30) { - // - $pldate = '
' . $po['onitm_text'] . '
"' . $pl['name'] . '"
?
'; + //используем эликсир + $pldate = '
"' . $pl['name'] . '"
Использовать сейчас?
'; $useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\');'; - } elseif ($pl['magic_inc'] && $pl['type'] == 29) { // - if (isset($po['useOnLogin']) && !isset($po['zazuby'])) { // + } elseif ($pl['magic_inc'] && $pl['type'] == 29) { //используем заклятие + if (isset($po['useOnLogin']) && !isset($po['zazuby'])) { //на персонажа $useUrl = 'top.useMagic(\'' . $pl['name'] . '\',' . (0 + $pl['id']) . ',\'' . $pl['img'] . '\',1,\'main.php?' . $inv1 . 'otdel=' . ((int)$_GET['otdel']) . '&use_pid=' . $pl['id'] . '&rnd=' . $code . '\');'; - } else { // ( , \) - $pldate = '
"' . $pl['name'] . '"
?
'; + } else { //просто использование (на себя, либо без указания предмета\логина) + $pldate = '
"' . $pl['name'] . '"
Использовать сейчас?
'; $useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\',' . (0 + $_GET['otdel']) . ');'; } - // + //на предмет } if ($useUrl != '') { - $is1 .= '-'; + $is1 .= 'исп-ть'; } else { $d[2] = 0; } @@ -8002,46 +7491,46 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } if ($pl['max_text'] > 0 && $pl['max_text'] - $pl['use_text'] > 0) { - $is1 .= '
'; + $is1 .= 'Записать
'; } if ($pl['type'] == 31 || $pl['type'] == 46 || $pl['type'] == 48 || $pl['type'] == 50 || $pl['type'] == 62 || $pl['type'] == 68 || $pl['type'] == 37 || $pl['type'] == 47) { if ($d[2] == 1) { $is1 .= '
'; } if (($pl['type'] != 37 || !isset($po['item_inbox']) || $po['item_inbox'] == 0) && $pl['item_id'] != 10038 && $pl['item_id'] != 10039 && $pl['item_id'] != 10040) { - $is1 .= '-'; + $is1 .= 'исп-ть'; } } - if ($d[0] == 1 && $pl['type'] != 30 && $pl['type'] != 31 && (($pl['type'] != 38 && $pl['type'] != 39 && $pl['type'] != 37) || $pl['gift'] != '')) {// + if ($d[0] == 1 && $pl['type'] != 30 && $pl['type'] != 31 && (($pl['type'] != 38 && $pl['type'] != 39 && $pl['type'] != 37) || $pl['gift'] != '')) {//можно одеть if (!isset($po['noodet']) && $pl['inslot'] > 0) { if ($d[2] == 1) { $is1 .= '
'; } - $is1 .= ''; + $is1 .= 'надеть'; } } if (isset($po['open']) && $d[0] == 1) { if ($d[2] == 1) { $is1 .= '
'; } - $is1 .= ''; + $is1 .= 'Открыть'; } if (isset($po['close'])) { if ($d[2] == 1) { $is1 .= '
'; } - $is1 .= ' '; + $is1 .= 'Предмет закрыт'; } if ($pl['group'] > 0) { $is1 .= '
'; if ($this->itemsX($pl['id']) < $pl['group_max']) { - $is1 .= ''; + $is1 .= ''; } if ($this->itemsX($pl['id']) > 1) { $is1 .= ' ' . $script; + onClick="top.unstack(' . $pl['id'] . ',\'' . $pl['img'] . '\',\'' . $pl['name'] . '\',1,\'
Разделить предмет ' . $pl['name'] . '?
\',\'' . intval($_GET['otdel']) . '\'); return false;" + href="main.php?inv=1&otdel=' . ((int)$_GET['otdel']) . '&unstack=' . $pl['id'] . '&rnd=' . $code . '" title="Разделить">' . $script; } } if (isset($po['toclan'])) { @@ -8052,17 +7541,17 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } } - $is1 .= ' '; + $is1 .= ' '; - if ($d[1] == 1) { // + if ($d[1] == 1) { //можно выкинуть if (!isset($po['nodelete'])) { - $is1 .= ' '; + $is1 .= ' '; } - //$is1 .= ' '; + //$is1 .= ' '; } } - // (: + //собираем все в одно (: $rt[2] .= '
' . $is1 . '
' . $is2 . '
'; $rt[1] += $pl['massa']; $i++; @@ -8093,7 +7582,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` } private function stackGroupCheck($uid, $group, $item) - { // ID . + { // Находит неиспользованный ID группы предметов. $g = 0; $i = 0; do { @@ -8119,15 +7608,15 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.` LEFT JOIN `items_users` as `iuu` ON (`iuu`.inGroup = `iu`.inGroup AND `iuu`.item_id = `im`.id AND `iuu`.inShop = 0) WHERE `iu`.`id` = "' . mysql_real_escape_string((int)$id) . '" AND `iu`.`uid` = "' . $this->info['id'] . '" AND `iuu`.`uid` = "' . $this->info['id'] . '" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `iu`.`inShop` = "0" AND `im`.`group` = "1" LIMIT 1')); - if (isset($itm['id']) && $itm['iznosNOW'] == 0) { // - // - if ($itm['inGroup'] == 0) { // , . + if (isset($itm['id']) && $itm['iznosNOW'] == 0) { //группируем похожие свободные предметы с этим + // создаем группу + if ($itm['inGroup'] == 0) { // Если предмет не в группе, собираем все похожие предметы по группам. $items = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0"AND `iu`.`inGroup`="0" AND `iu`.item_id="' . $itm['item_id'] . '"')); $items = ceil($items / $itm['group_max']); - } else { // , inGroup == 0 - $curG = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0"AND `iu`.`inGroup`="' . $itm['inGroup'] . '" AND `iu`.item_id="' . $itm['item_id'] . '"')); // - $curNG = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0"AND `iu`.`inGroup`="0" AND `iu`.item_id="' . $itm['item_id'] . '"')); // - $needG = $itm['group_max'] - $curG; // , 0 + } else { // Добираем предметы в группу до полного количества, из предметов с inGroup == 0 + $curG = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0"AND `iu`.`inGroup`="' . $itm['inGroup'] . '" AND `iu`.item_id="' . $itm['item_id'] . '"')); // Текущее количество предметов в выбранной группе + $curNG = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0"AND `iu`.`inGroup`="0" AND `iu`.item_id="' . $itm['item_id'] . '"')); // Текущее количество предметов которые без группы + $needG = $itm['group_max'] - $curG; // Задаем требуемое количество для добора, если нужно больше 0 и требуемое количество меньше if ($needG > 0 and $curNG == 0) { $curItem = mysql_fetch_array(mysql_query('SELECT `iu`.id, `iu`.inGroup, count(`iu`.inGroup) as itemsInGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`inGroup`!="' . $itm['inGroup'] . '" AND `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.item_id="' . $itm['item_id'] . '" GROUP BY `iu`.inGroup HAVING itemsInGroup <= "' . $needG . '" ORDER BY itemsInGroup DESC LIMIT 1')); @@ -8177,7 +7666,7 @@ ORDER BY `iu`.lastUPD DESC LIMIT 1')); if (isset($itm['id']) && $itm['inGroup'] > 0 && $itm['inGroupCount'] > 0) { if ($x == 0 or $x == null) { - $x = $this->itemsX($itm['id']); //- + $x = $this->itemsX($itm['id']); //кол-во распада $inGroup = 0; } elseif ($x != 0) { $inGroup = $this->stackGroupCheck($this->info['id'], $itm['inGroup'], $itm['item_id']); @@ -8247,7 +7736,7 @@ LIMIT 1')); } if (isset($u['id'])) { $snIt = 0; - // + //Проверяем одетые вещи и вещи с сроком годности $cl = mysql_query('SELECT `iu`.`id` AS `iduid`, `iu`.`time_sleep`,`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, @@ -8257,7 +7746,7 @@ LIMIT 1')); $po = []; $po = $this->lookStats($itm['data']); $po['lvl'] = $u['level']; - // + //проверяем требования $t = $this->items['tr']; $x = 0; $notr = 0; @@ -8282,11 +7771,11 @@ LIMIT 1')); $x++; } if ($this->info['twink'] > 0) { - // 100 . + //Не дороже 100 екр. if ($itm['price2'] > 1 || $itm['2price'] > 1) { $notr++; } - // + + //Нельзя руны + чарки if (isset($po['rune']) && $po['rune'] > 0) { $notr++; } @@ -8300,7 +7789,7 @@ LIMIT 1')); mysql_query('UPDATE `items_users` SET `data` = "' . $itm['data'] . '" WHERE `id` = "' . $itm['iduid'] . '" AND `uid` = "' . $u['id'] . '" LIMIT 1'); } if (isset($po['zazuby']) && !isset($po['srok']) && ($itm['type'] == 29 || $itm['type'] == 30 || $itm['type'] == 36 || $itm['type'] == 49 || $itm['type'] == 46 || $itm['type'] == 34)) { - // + //Предметы за зубы со сроком годности $po['srok'] = 86400 * 7; $itm['data'] = $this->impStats($po); mysql_query('UPDATE `items_users` SET `data` = "' . $itm['data'] . '" WHERE `id` = "' . $itm['iduid'] . '" AND `uid` = "' . $u['id'] . '" LIMIT 1'); @@ -8321,13 +7810,13 @@ LIMIT 1')); $notr++; } if ($notr > 0 && $itm['inOdet'] != 0) { - // + //снимаем предмет $this->snatItem($itm['id'], $u['id']); $snIt++; } - // + //проверяем срок годности if ($itm['iznosNOW'] >= ceil($itm['iznosMAX']) && $itm['iznosMAXi'] != 999999999) { - // + //предмет сломался if (isset($po['musor'])) { if ($po['musor'] > 0) { $this->recr($itm['id'], $itm['type'], $u['id'], (int)$po['musor']); @@ -8339,7 +7828,7 @@ LIMIT 1')); $this->snatItem($itm['id'], $u['id']); $snIt++; } - // + //удаляем предмет if ($itm['item_id'] == 4704) { $po['musor2'] = 4708; } @@ -8369,9 +7858,9 @@ LIMIT 1')); } $upd = mysql_query('UPDATE `items_users` SET `delete`="' . time() . '" WHERE `id` = "' . $id . '" ' . $uid2 . ' LIMIT 1'); if ($upd) { - $this->addDelo(2, $uid, '"System.inventory": [itm:' . $it . '] .', time(), $this->info['city'], 'System.inventory', 0, 0); + $this->addDelo(2, $uid, '"System.inventory": Предмет [itm:' . $it . '] был сломан.', time(), $this->info['city'], 'System.inventory', 0, 0); if ($id2 > 1) { - // + //Добавляем пустую бутылку $this->addItem($id2, $uid, 'noodet=1|noremont=1'); } } @@ -8392,9 +7881,9 @@ LIMIT 1')); $upd = mysql_query('UPDATE `items_users` SET `delete`="' . time() . '",`timeOver`="1" WHERE `id` = "' . $it . '" ' . $uid2 . ' LIMIT 1'); if ($upd) { $upd = mysql_query('UPDATE `items_users` SET `inGroup`="0",`timeOver`="' . time() . '" WHERE `inGroup` = "' . $it . '" ' . $uid2 . ''); - $this->addDelo(2, $uid, '"System.inventory": ' . $name . ' [itm:' . $it . '] .', time(), $this->info['city'], 'System.inventory', 0, 0); + $this->addDelo(2, $uid, '"System.inventory": Предмет ' . $name . ' [itm:' . $it . '] был испорчен.', time(), $this->info['city'], 'System.inventory', 0, 0); if ($tp != 0) { - // , + //Добавляем испорченый предмет в инвентарь, в зависимости от типа $zzba = ''; if ($zub > 0) { $zzba = '|zazuby=1'; @@ -8408,7 +7897,7 @@ LIMIT 1')); } } else { if ($type == 30) { - // + //испорченный эликсир $this->addItem(4036, $uid, '|renameadd=' . $name . '|noodet=1' . $zzba); } } @@ -8423,7 +7912,7 @@ LIMIT 1')); $i = 1; $sv = []; while ($i <= 10) { - $sv[$i] = ''; + $sv[$i] = ''; $i++; } $i = 0; @@ -8440,7 +7929,7 @@ LIMIT 1')); } $vl = 'style="cursor:pointer" onclick="' . $useUrl . '"'; } - $sv[$this->stats['items'][$i]['inOdet'] - 39] = ''; + $sv[$this->stats['items'][$i]['inOdet'] - 39] = ''; } $i++; } @@ -8472,18 +7961,18 @@ LIMIT 1')); //if( $this->info['admin'] > 0 ) { if (isset($po['rune']) && $po['rune'] > 0) { $rnc = explode(' ', $po['rune_name']); - if ($rnc[0] == '') { + if ($rnc[0] == 'Игнис') { $rnc = '#9b5d40'; - } elseif ($rnc[0] == '') { + } elseif ($rnc[0] == 'Аква') { $rnc = '#3a2b64'; - } elseif ($rnc[0] == '') { + } elseif ($rnc[0] == 'Аура') { $rnc = '#20a3b0'; - } elseif ($rnc[0] == '') { + } elseif ($rnc[0] == 'Тера') { $rnc = '#4c7718'; } else { $rnc = '#4c4c4c'; } - $r .= '
: ' . $po['rune_name'] . ''; + $r .= '
Руна: ' . $po['rune_name'] . ''; unset($rnc); } if (isset($po['spell'])) { @@ -8516,7 +8005,7 @@ LIMIT 1')); { $td['add_hpAll'] = '+'.$td['add_hpAll']; } - $lvar .= '
: '.$td['add_hpAll'].''; + $lvar .= '
Уровень жизни: '.$td['add_hpAll'].''; } if(isset($td['add_mpAll']) && $td['add_mpAll']!=0) { @@ -8524,10 +8013,10 @@ LIMIT 1')); { $td['add_mpAll'] = '+'.$td['add_mpAll']; } - $lvar .= '
: '.$td['add_mpAll'].''; + $lvar .= '
Уровень маны: '.$td['add_mpAll'].''; }*/ if (isset($td['sv_yron_max']) && $td['sv_yron_max'] > 0) { - $lvar .= '
: ' . $td['sv_yron_min'] . '-' . $td['sv_yron_max'] . ''; + $lvar .= '
Урон: ' . $td['sv_yron_min'] . '-' . $td['sv_yron_max'] . ''; } if (isset($td['add_mab1']) && $td['add_mab1'] > 0) { if ($td['add_mib1'] == $td['add_mab1'] && $pl['geniration'] == 1) { @@ -8535,9 +8024,9 @@ LIMIT 1')); if ($td['add_mab1'] < 0) { $m1l = ''; } - $lvar .= '
: ' . $m1l . '' . (0 + $td['add_mab1']) . ''; + $lvar .= '
Броня головы: ' . $m1l . '' . (0 + $td['add_mab1']) . ''; } else { - $lvar .= '
: ' . (0 + $td['add_mib1']) . '-' . (0 + $td['add_mab1']) . ''; + $lvar .= '
Броня головы: ' . (0 + $td['add_mib1']) . '-' . (0 + $td['add_mab1']) . ''; } } // @@ -8570,10 +8059,10 @@ LIMIT 1')); $x++; } if ($pl['2h'] == 1) { - $lvar .= '
'; + $lvar .= '
• Двуручное оружие'; } if (isset($po['zonb'])) { - $lvar .= '
: '; + $lvar .= '
Зоны блокирования: '; if ($lvar['zonb'] > 0) { $x = 1; while ($x <= $td['zonb']) { @@ -8581,7 +8070,7 @@ LIMIT 1')); $x++; } } else { - $lvar .= ''; + $lvar .= '—'; } } @@ -8592,9 +8081,9 @@ LIMIT 1')); if ($td['add_mab2'] < 0) { $m1l = ''; } - $lvar .= '
: ' . $m1l . '' . (0 + $td['add_mab2']) . ''; + $lvar .= '
Броня корпуса: ' . $m1l . '' . (0 + $td['add_mab2']) . ''; } else { - $lvar .= '
: ' . (0 + $td['add_mib2']) . '-' . (0 + $td['add_mab2']) . ''; + $lvar .= '
Броня корпуса: ' . (0 + $td['add_mib2']) . '-' . (0 + $td['add_mab2']) . ''; } } if (isset($td['add_mab3']) && $td['add_mab3'] > 0) { @@ -8603,9 +8092,9 @@ LIMIT 1')); if ($td['add_mab3'] < 0) { $m1l = ''; } - $lvar .= '
: ' . $m1l . '' . (0 + $td['add_mab3']) . ''; + $lvar .= '
Броня пояса: ' . $m1l . '' . (0 + $td['add_mab3']) . ''; } else { - $lvar .= '
: ' . (0 + $td['add_mib3']) . '-' . (0 + $td['add_mab3']) . ''; + $lvar .= '
Броня пояса: ' . (0 + $td['add_mib3']) . '-' . (0 + $td['add_mab3']) . ''; } } if (isset($td['add_mab4']) && $td['add_mab4'] > 0) { @@ -8614,21 +8103,21 @@ LIMIT 1')); if ($td['add_mab4'] < 0) { $m1l = ''; } - $lvar .= '
: ' . $m1l . '' . (0 + $td['add_mab4']) . ''; + $lvar .= '
Броня ног: ' . $m1l . '' . (0 + $td['add_mab4']) . ''; } else { - $lvar .= '
: ' . (0 + $td['add_mib4']) . '-' . (0 + $td['add_mab4']) . ''; + $lvar .= '
Броня ног: ' . (0 + $td['add_mib4']) . '-' . (0 + $td['add_mab4']) . ''; } } if ($pl['iznosMAX'] > 0) { if ($pl['iznosMAXi'] >= 909999999) { - //$lvar .= '
: '; + //$lvar .= '
Долговечность: неразрушимо '; } else { - $lvar .= '
: ' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']); + $lvar .= '
Долговечность: ' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']); } } if ($po['battleUseZd'] > 0) { - $lvar .= '
: ' . $this->timeOut($po['battleUseZd']) . ''; + $lvar .= '
Задержка использования: ' . $this->timeOut($po['battleUseZd']) . ''; } if (isset($td['gravi'])) { @@ -8676,8 +8165,8 @@ LIMIT 1')); 10 => 13, 9 => 14, 8 => 15, - 11 => 17, // 2 - 12 => 18 // 3 + 11 => 17, //кольцо 2 + 12 => 18 //кольцо 3 ]; if (isset($u['id'], $u['stats'])) { @@ -8690,29 +8179,29 @@ LIMIT 1')); $st['login'] = $u['login']; $st['lvl'] = $u['level']; - // + //Характеристики от предметов и их изображение $witm = []; - $witm[1] = ''; - $witm[2] = ''; - $witm[3] = ''; - $witm[4] = ''; - $witm[7] = ''; - $witm[8] = ''; - $witm[9] = ''; - $witm[10] = ''; - $witm[11] = ''; - $witm[12] = ''; - $witm[13] = ''; - $witm[14] = ''; - $witm[16] = ''; - $witm[17] = ''; - //40-52 - $witm[53] = ''; - $witm[54] = ''; - $witm[55] = ''; - $witm[56] = ''; - $witm[57] = ''; - $witm[58] = ''; + $witm[1] = ''; + $witm[2] = ''; + $witm[3] = ''; + $witm[4] = ''; + $witm[7] = ''; + $witm[8] = ''; + $witm[9] = ''; + $witm[10] = ''; + $witm[11] = ''; + $witm[12] = ''; + $witm[13] = ''; + $witm[14] = ''; + $witm[16] = ''; + $witm[17] = ''; + //40-52 слот под магию + $witm[53] = ''; + $witm[54] = ''; + $witm[55] = ''; + $witm[56] = ''; + $witm[57] = ''; + $witm[58] = ''; $cl = mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, `iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` @@ -8724,7 +8213,7 @@ LIMIT 1')); $td = $this->lookStats($pl['data']); if (isset($td['modif'])) { - $pl['name'] = $pl['name'] . ' ()'; + $pl['name'] = $pl['name'] . ' (мф)'; } if (isset($td['upatack_lvl'])) { @@ -8748,20 +8237,20 @@ LIMIT 1')); { $td['add_hpAll'] = '+'.$td['add_hpAll']; } - $lvar .= '
: '.$td['add_hpAll'].''; + $lvar .= '
Уровень жизни: '.$td['add_hpAll'].''; } if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0) { - $lvar .= '
: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; + $lvar .= '
Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; } if(isset($td['add_mab1']) && $td['add_mab1']>0) { if($td['add_mib1']==$td['add_mab1'] && $pl['geniration']==1) { $m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; } - $lvar .= '
: '.$m1l.''.(0+$td['add_mab1']).''; + $lvar .= '
Броня головы: '.$m1l.''.(0+$td['add_mab1']).''; }else{ - $lvar .= '
: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; + $lvar .= '
Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; } } if(isset($td['add_mab2']) && $td['add_mab2']>0) @@ -8769,9 +8258,9 @@ LIMIT 1')); if($td['add_mib2']==$td['add_mab2'] && $pl['geniration']==1) { $m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; } - $lvar .= '
: '.$m1l.''.(0+$td['add_mab2']).''; + $lvar .= '
Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).''; }else{ - $lvar .= '
: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; + $lvar .= '
Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; } } if(isset($td['add_mab3']) && $td['add_mab3']>0) @@ -8779,9 +8268,9 @@ LIMIT 1')); if($td['add_mib3']==$td['add_mab3'] && $pl['geniration']==1) { $m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; } - $lvar .= '
: '.$m1l.''.(0+$td['add_mab3']).''; + $lvar .= '
Броня пояса: '.$m1l.''.(0+$td['add_mab3']).''; }else{ - $lvar .= '
: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; + $lvar .= '
Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; } } if(isset($td['add_mab4']) && $td['add_mab4']>0) @@ -8789,38 +8278,38 @@ LIMIT 1')); if($td['add_mib4']==$td['add_mab4'] && $pl['geniration']==1) { $m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; } - $lvar .= '
: '.$m1l.''.(0+$td['add_mab4']).''; + $lvar .= '
Броня ног: '.$m1l.''.(0+$td['add_mab4']).''; }else{ - $lvar .= '
: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; + $lvar .= '
Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; } } if($pl['iznosMAX']>0) { if($pl['iznosMAXi'] == 999999999) { - $lvar .= '
: '; + $lvar .= '
Долговечность: неразрушимо '; }else{ - $lvar .= '
: '.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']); + $lvar .= '
Долговечность: '.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']); } } if( $po['battleUseZd'] > 0 ) { - $is2 .= '
: '.$this->timeOut($po['battleUseZd']).''; + $is2 .= '
Задержка использования: '.$this->timeOut($po['battleUseZd']).''; } if(isset($td['gravi'])) { $td['gravitp'] = array( - 18 => '', - 19 => '', - 20 => '', - 21 => '', - 22 => '', - 23 => '', - 24 => '', - 26 => '', - 27 => '', - 28 => '' + 18 => 'кинжале', + 19 => 'топоре', + 20 => 'молоте', + 21 => 'клинке', + 22 => 'посохе', + 23 => 'луке', + 24 => 'арбалете', + 26 => 'рукоятке', + 27 => 'предмете', + 28 => 'предмете' ); - $lvar .= '
'.$td['gravitp'][$pl['type']].' : '.$td['gravi'].''; + $lvar .= '
На '.$td['gravitp'][$pl['type']].' выгравирована надпись: '.$td['gravi'].''; unset($td['gravitp']); }*/ @@ -8829,10 +8318,10 @@ LIMIT 1')); if( $pl['2h'] == 1 ) { if(@isset($sn['items_img'][$tp_img[14]])) { $uimg2 = 'rimg/r'.$sn['items_img'][$tp_img[14]]; - $witm[14] = ''; + $witm[14] = ''; }else{ $uimg2 = 'i/items/'.$pl['img'].''; - $witm[14] = ''; + $witm[14] = ''; } unset($uimg2); } @@ -8858,12 +8347,12 @@ LIMIT 1')); $pl['magic_inc'] = $pl['magic_inci']; } if ($pl['magic_inc'] && $pl['type'] == 30) { - // - $pldate = '
"' . $pl['name'] . '"
?
'; + //используем эликсир + $pldate = '
"' . $pl['name'] . '"
Использовать сейчас?
'; $useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\');'; } elseif ($pl['magic_inc'] && $pl['type'] == 29) { - // - // + //используем заклятие + //на персонажа if (isset($td['useOnLogin'])) { $inv1 = ''; if (isset($_GET['inv'])) { @@ -8871,21 +8360,21 @@ LIMIT 1')); } $useUrl = 'top.useMagic(\'' . $pl['name'] . '\',' . (0 + $pl['id']) . ',\'' . $pl['img'] . '\',1,\'main.php?' . $inv1 . 'use_pid=' . $pl['id'] . '&rnd=' . $code . '\');'; } else { - // ( , \) - $pldate = '
"' . $pl['name'] . '"
?
'; + //просто использование (на селя, либо без указания предмета\логина) + $pldate = '
"' . $pl['name'] . '"
Использовать сейчас?
'; $useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\');'; } } $witm[$pl['inOdet']] = '' . $witm[$pl['inOdet']] . ''; } elseif ($pl['item_id'] == 998 && !isset($_GET['inv'])) { - // + //варежки $witm[$pl['inOdet']] = '' . $witm[$pl['inOdet']] . ''; } else { $witm[$pl['inOdet']] = '' . $witm[$pl['inOdet']] . ''; } } } - //, + //Шлем,Венок $wj1i = ''; $br = '
'; if ($wj[1] != false) { @@ -8904,20 +8393,20 @@ LIMIT 1')); { $td['add_hpAll'] = '+'.$td['add_hpAll']; } - $wj1i .= '
: '.$td['add_hpAll'].''; + $wj1i .= '
Уровень жизни: '.$td['add_hpAll'].''; } if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0) { - $wj1i .= '
: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; + $wj1i .= '
Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; } if(isset($td['add_mab1']) && $td['add_mab1']>0) { if($td['add_mib1']==$td['add_mab1'] && $wj[1]['geniration']==1) { $m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; } - $wj1i .= '
: '.$m1l.''.(0+$td['add_mab1']).''; + $wj1i .= '
Броня головы: '.$m1l.''.(0+$td['add_mab1']).''; }else{ - $wj1i .= '
: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; + $wj1i .= '
Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; } } if(isset($td['add_mab2']) && $td['add_mab2']>0) @@ -8925,9 +8414,9 @@ LIMIT 1')); if($td['add_mib2']==$td['add_mab2'] && $wj[1]['geniration']==1) { $m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; } - $wj1i .= '
: '.$m1l.''.(0+$td['add_mab2']).''; + $wj1i .= '
Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).''; }else{ - $wj1i .= '
: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; + $wj1i .= '
Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; } } if(isset($td['add_mab3']) && $td['add_mab3']>0) @@ -8935,9 +8424,9 @@ LIMIT 1')); if($td['add_mib3']==$td['add_mab3'] && $wj[1]['geniration']==1) { $m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; } - $wj1i .= '
: '.$m1l.''.(0+$td['add_mab3']).''; + $wj1i .= '
Броня пояса: '.$m1l.''.(0+$td['add_mab3']).''; }else{ - $wj1i .= '
: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; + $wj1i .= '
Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; } } if(isset($td['add_mab4']) && $td['add_mab4']>0) @@ -8945,18 +8434,18 @@ LIMIT 1')); if($td['add_mib4']==$td['add_mab4'] && $wj[1]['geniration']==1) { $m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; } - $wj1i .= '
: '.$m1l.''.(0+$td['add_mab4']).''; + $wj1i .= '
Броня ног: '.$m1l.''.(0+$td['add_mab4']).''; }else{ - $wj1i .= '
: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; + $wj1i .= '
Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; } } if($wj[1]['iznosMAX']>0) { if($wj[1]['iznosMAXi'] == 999999999) { - $wj1i .= '
: '; + $wj1i .= '
Долговечность: неразрушимо '; }else{ - $wj1i .= '
: '.floor($wj[1]['iznosNOW']).'/'.ceil($wj[1]['iznosMAX']).''; + $wj1i .= '
Долговечность: '.floor($wj[1]['iznosNOW']).'/'.ceil($wj[1]['iznosMAX']).''; } }*/ } @@ -8968,9 +8457,9 @@ LIMIT 1')); if($wj[52]['iznosMAX']>0) { if($wj[52]['iznosMAXi'] == 999999999) { - $wj1i = '
:
'.$wj1i; + $wj1i = '
Долговечность: неразрушимо
'.$wj1i; }else{ - $wj1i = '
: '.floor($wj[52]['iznosNOW']).'/'.ceil($wj[52]['iznosMAX']).''.$wj1i; + $wj1i = '
Долговечность: '.floor($wj[52]['iznosNOW']).'/'.ceil($wj[52]['iznosMAX']).''.$wj1i; } } @@ -8979,9 +8468,9 @@ LIMIT 1')); if($td['add_mib4']==$td['add_mab4'] && $wj[1]['geniration']==1) { $m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; } - $wj1i = '
: '.$m1l.''.(0+$td['add_mab4']).''.$wj1i; + $wj1i = '
Броня ног: '.$m1l.''.(0+$td['add_mab4']).''.$wj1i; }else{ - $wj1i = '
: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''.$wj1i; + $wj1i = '
Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''.$wj1i; } } @@ -8990,9 +8479,9 @@ LIMIT 1')); if($td['add_mib3']==$td['add_mab3'] && $wj[1]['geniration']==1) { $m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; } - $wj1i = '
: '.$m1l.''.(0+$td['add_mab3']).''.$wj1i; + $wj1i = '
Броня пояса: '.$m1l.''.(0+$td['add_mab3']).''.$wj1i; }else{ - $wj1i = '
: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''.$wj1i; + $wj1i = '
Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''.$wj1i; } } @@ -9001,9 +8490,9 @@ LIMIT 1')); if($td['add_mib2']==$td['add_mab2'] && $wj[1]['geniration']==1) { $m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; } - $wj1i = '
: '.$m1l.''.(0+$td['add_mab2']).''.$wj1i; + $wj1i = '
Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).''.$wj1i; }else{ - $wj1i = '
: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''.$wj1i; + $wj1i = '
Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''.$wj1i; } } @@ -9012,9 +8501,9 @@ LIMIT 1')); if($td['add_mib1']==$td['add_mab1'] && $wj[1]['geniration']==1) { $m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; } - $wj1i = '
: '.$m1l.''.(0+$td['add_mab1']).''.$wj1i; + $wj1i = '
Броня головы: '.$m1l.''.(0+$td['add_mab1']).''.$wj1i; }else{ - $wj1i = '
: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''.$wj1i; + $wj1i = '
Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''.$wj1i; } } @@ -9024,12 +8513,12 @@ LIMIT 1')); { $td['add_hpAll'] = '+'.$td['add_hpAll']; } - $wj1i = '
: '.$td['add_hpAll'].''.$wj1i; + $wj1i = '
Уровень жизни: '.$td['add_hpAll'].''.$wj1i; } if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0) { - $wj1i = '
: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''.$wj1i; + $wj1i = '
Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''.$wj1i; }*/ @@ -9039,7 +8528,7 @@ LIMIT 1')); $wj[1]['id'] = $wj[52]['id']; $wj[1]['inRazdel'] = $wj[52]['inRazdel']; } - //,, + //Рубаха,Броня,Плащ $wj4idd = $wj[5]['item_id']; $wj4i = ''; if ($wj[6] != false) { @@ -9053,20 +8542,20 @@ LIMIT 1')); { $td['add_hpAll'] = '+'.$td['add_hpAll']; } - $wj4i .= '
: '.$td['add_hpAll'].''; + $wj4i .= '
Уровень жизни: '.$td['add_hpAll'].''; } if($td['sv_yron_max']>0) { - $wj4i .= '
: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; + $wj4i .= '
Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; } if($td['add_mab1']>0) { if($td['add_mib1']==$td['add_mab1'] && $wj[6]['geniration']==1) { $m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab1']).''; + $wj4i .= '
Броня головы: '.$m1l.''.(0+$td['add_mab1']).''; }else{ - $wj4i .= '
: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; + $wj4i .= '
Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; } } if($td['add_mab2']>0) @@ -9074,9 +8563,9 @@ LIMIT 1')); if($td['add_mib2']==$td['add_mab2'] && $wj[6]['geniration']==1) { $m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab2']).''; + $wj4i .= '
Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).''; }else{ - $wj4i .= '
: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; + $wj4i .= '
Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; } } if($td['add_mab3']>0) @@ -9084,9 +8573,9 @@ LIMIT 1')); if($td['add_mib3']==$td['add_mab3'] && $wj[6]['geniration']==1) { $m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab3']).''; + $wj4i .= '
Броня пояса: '.$m1l.''.(0+$td['add_mab3']).''; }else{ - $wj4i .= '
: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; + $wj4i .= '
Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; } } if($td['add_mab4']>0) @@ -9094,18 +8583,18 @@ LIMIT 1')); if($td['add_mib4']==$td['add_mab4'] && $wj[6]['geniration']==1) { $m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab4']).''; + $wj4i .= '
Броня ног: '.$m1l.''.(0+$td['add_mab4']).''; }else{ - $wj4i .= '
: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; + $wj4i .= '
Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; } } if($wj[6]['iznosMAX']>0) { if($wj[6]['iznosMAXi'] == 999999999) { - $wj4i .= '
: '; + $wj4i .= '
Долговечность: неразрушимо '; }else{ - $wj4i .= '
: '.floor($wj[6]['iznosNOW']).'/'.ceil($wj[6]['iznosMAX']).''; + $wj4i .= '
Долговечность: '.floor($wj[6]['iznosNOW']).'/'.ceil($wj[6]['iznosMAX']).''; } }*/ $wj4i .= $this->getInfoItemInfo($wj[6]); @@ -9124,20 +8613,20 @@ LIMIT 1')); { $td['add_hpAll'] = '+'.$td['add_hpAll']; } - $wj4i .= '
: '.$td['add_hpAll'].''; + $wj4i .= '
Уровень жизни: '.$td['add_hpAll'].''; } if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0) { - $wj4i .= '
: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; + $wj4i .= '
Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; } if(isset($td['add_mab1']) && $td['add_mab1']>0) { if($td['add_mib1']==$td['add_mab1'] && $wj[5]['geniration']==1) { $m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab1']).''; + $wj4i .= '
Броня головы: '.$m1l.''.(0+$td['add_mab1']).''; }else{ - $wj4i .= '
: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; + $wj4i .= '
Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; } } if(isset($td['add_mab2']) && $td['add_mab2']>0) @@ -9145,9 +8634,9 @@ LIMIT 1')); if($td['add_mib2']==$td['add_mab2'] && $wj[5]['geniration']==1) { $m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab2']).''; + $wj4i .= '
Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).''; }else{ - $wj4i .= '
: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; + $wj4i .= '
Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; } } if(isset($td['add_mab3']) && $td['add_mab3']>0) @@ -9155,9 +8644,9 @@ LIMIT 1')); if($td['add_mib3']==$td['add_mab3'] && $wj[5]['geniration']==1) { $m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab3']).''; + $wj4i .= '
Броня пояса: '.$m1l.''.(0+$td['add_mab3']).''; }else{ - $wj4i .= '
: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; + $wj4i .= '
Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; } } if(isset($td['add_mab4']) && $td['add_mab4']>0) @@ -9165,18 +8654,18 @@ LIMIT 1')); if($td['add_mib4']==$td['add_mab4'] && $wj[5]['geniration']==1) { $m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab4']).''; + $wj4i .= '
Броня ног: '.$m1l.''.(0+$td['add_mab4']).''; }else{ - $wj4i .= '
: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; + $wj4i .= '
Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; } } if($wj[5]['iznosMAX']>0) { if($wj[5]['iznosMAXi'] == 999999999) { - $wj4i .= '
: '; + $wj4i .= '
Долговечность: неразрушимо '; }else{ - $wj4i .= '
: '.floor($wj[5]['iznosNOW']).'/'.ceil($wj[5]['iznosMAX']).''; + $wj4i .= '
Долговечность: '.floor($wj[5]['iznosNOW']).'/'.ceil($wj[5]['iznosMAX']).''; } } */ @@ -9196,20 +8685,20 @@ LIMIT 1')); { $td['add_hpAll'] = '+'.$td['add_hpAll']; } - $wj4i .= '
: '.$td['add_hpAll'].''; + $wj4i .= '
Уровень жизни: '.$td['add_hpAll'].''; } if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0) { - $wj4i .= '
: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; + $wj4i .= '
Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; } if(isset($td['add_mab1']) && $td['add_mab1']>0) { if($td['add_mib1']==$td['add_mab1'] && $wj[4]['geniration']==1) { $m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab1']).''; + $wj4i .= '
Броня головы: '.$m1l.''.(0+$td['add_mab1']).''; }else{ - $wj4i .= '
: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; + $wj4i .= '
Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; } } if(isset($td['add_mab2']) && $td['add_mab2']>0) @@ -9217,9 +8706,9 @@ LIMIT 1')); if($td['add_mib2']==$td['add_mab2'] && $wj[4]['geniration']==1) { $m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab2']).''; + $wj4i .= '
Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).''; }else{ - $wj4i .= '
: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; + $wj4i .= '
Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; } } if(isset($td['add_mab3']) && $td['add_mab3']>0) @@ -9227,9 +8716,9 @@ LIMIT 1')); if($td['add_mib3']==$td['add_mab3'] && $wj[4]['geniration']==1) { $m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab3']).''; + $wj4i .= '
Броня пояса: '.$m1l.''.(0+$td['add_mab3']).''; }else{ - $wj4i .= '
: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; + $wj4i .= '
Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; } } if(isset($td['add_mab4']) && $td['add_mab4']>0) @@ -9237,18 +8726,18 @@ LIMIT 1')); if($td['add_mib4']==$td['add_mab4'] && $wj[4]['geniration']==1) { $m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab4']).''; + $wj4i .= '
Броня ног: '.$m1l.''.(0+$td['add_mab4']).''; }else{ - $wj4i .= '
: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; + $wj4i .= '
Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; } } if($wj[4]['iznosMAX']>0) { if($wj[4]['iznosMAXi'] == 999999999) { - $wj4i .= '
: '; + $wj4i .= '
Долговечность: неразрушимо '; }else{ - $wj4i .= '
: '.floor($wj[4]['iznosNOW']).'/'.ceil($wj[4]['iznosMAX']).''; + $wj4i .= '
Долговечность: '.floor($wj[4]['iznosNOW']).'/'.ceil($wj[4]['iznosMAX']).''; } }*/ $wj4i .= $this->getInfoItemInfo($wj[4]); @@ -9317,7 +8806,7 @@ LIMIT 1')); $witm[4] = '' . $witm[4] . ''; } } - /*------------ . ---------------*/ + /*------------ ГЕНЕРИРУЕМ ИНФ. О ПЕРСОНАЖЕ ---------------*/ $nmmsgl1 = 0; if ($u['align'] >= 1 && $u['align'] < 2) { $nmmsgl1 = 1; @@ -9341,20 +8830,20 @@ LIMIT 1')); 7 => 'dragon' ]; $anan2 = [ - 1 => '', - 2 => '', - 3 => '', - 4 => '', - 5 => 'ϸ', - 6 => '', - 7 => '' + 1 => 'Кот', + 2 => 'Сова', + 3 => 'Светляк', + 4 => 'Чертяка', + 5 => 'Пёс', + 6 => 'Свин', + 7 => 'Дракон' ]; $anml = ''; if ($u['animal'] > 0) { $an = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `id` = "' . $u['animal'] . '" AND `pet_in_cage` = 0 AND `delete` = "0" LIMIT 1')); if (isset($an['id'])) { if ($i1 != 1) { - //$anml = '
'; + //$anml = '
'; } else { if ($an['eda'] > 0) { //$anml = '
'; @@ -9362,9 +8851,9 @@ LIMIT 1')); } $petimg = mysql_fetch_array(mysql_query('SELECT `id`,`img` FROM `obraz_pet` WHERE `uid` = "' . $u['id'] . '" AND `use` = 1 LIMIT 1')); if (isset($petimg['id'])) { - $anml = ''; + $anml = ''; } else { - $anml = ''; + $anml = ''; } } } @@ -9384,7 +8873,7 @@ LIMIT 1')); $oi = ''; if ($i1 != 1) { $jf = 'main'; - $oi = 'onMouseOver="top.hi(this,\'' . $u['login'] . ' ( "")\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"'; + $oi = 'onMouseOver="top.hi(this,\'' . $u['login'] . ' (Перейти в "Инвентарь")\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"'; $msl = ' @@ -9400,7 +8889,7 @@ LIMIT 1')); } $hpmp = ''; $eff = ''; - //-------- + //-------- генерируем эффекты $efs = mysql_query('SELECT `eu`.`id`,`eu`.`id_eff`,`eu`.`uid`,`eu`.`tr_life_user`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace`, `em`.`id2`,`em`.`mname`,`em`.`type1`,`em`.`img`,`em`.`mdata`,`em`.`actionTime`,`em`.`type2`,`em`.`type3`,`em`.`onlyOne`,`em`.`oneType`,`em`.`noAce`,`em`.`see`,`em`.`info`,`em`.`overch`,`em`.`bp`,`em`.`noch` @@ -9423,23 +8912,23 @@ LIMIT 1')); if (($e['timeUse'] + $e['timeAce'] + $e['actionTime'] >= time() || $e['timeUse'] == 77) && $esee == 1) { $ei = '' . $e['name'] . ''; if ($e['type1'] > 0 && $e['type1'] < 7) { - $ei .= ' ()'; + $ei .= ' (Эликсир)'; } elseif (($e['type1'] > 6 && $e['type1'] < 11) || $e['type1'] == 16) { - $ei .= ' ()'; + $ei .= ' (Заклятие)'; } elseif ($e['type1'] == 14) { - $ei .= ' ()'; + $ei .= ' (Прием)'; } elseif ($e['type1'] == 15) { - $ei .= ' ()'; + $ei .= ' (Изучение)'; } elseif ($e['type1'] == 17) { - $ei .= ' ()'; + $ei .= ' (Проклятие)'; } elseif ($e['type1'] == 18 || $e['type1'] == 19) { - $ei .= ' ()'; + $ei .= ' (Травма)'; } elseif ($e['type1'] == 20) { - $ei .= ' ()'; + $ei .= ' (Пристрастие)'; } elseif ($e['type1'] == 22) { - $ei .= ' ()'; + $ei .= ' (Ожидание)'; } else { - $ei .= ' ()'; + $ei .= ' (Эффект)'; } $ei .= '
'; @@ -9451,7 +8940,7 @@ LIMIT 1')); if ($tmp > 0) { $id++; if ($id < 3) { - $out .= $tmp . " . "; + $out .= $tmp . " мес. "; } $time_still = $time_still - $tmp * 2592000; } @@ -9459,7 +8948,7 @@ LIMIT 1')); if ($tmp > 0) { $id++; if ($id < 3) { - $out .= $tmp . " . "; + $out .= $tmp . " нед. "; } $time_still = $time_still - $tmp * 604800; } @@ -9467,7 +8956,7 @@ LIMIT 1')); if ($tmp > 0) { $id++; if ($id < 3) { - $out .= $tmp . " . "; + $out .= $tmp . " дн. "; } $time_still = $time_still - $tmp * 86400; } @@ -9475,7 +8964,7 @@ LIMIT 1')); if ($tmp > 0) { $id++; if ($id < 3) { - $out .= $tmp . " . "; + $out .= $tmp . " ч. "; } $time_still = $time_still - $tmp * 3600; } @@ -9483,16 +8972,16 @@ LIMIT 1')); if ($tmp > 0) { $id++; if ($id < 3) { - $out .= $tmp . " . "; + $out .= $tmp . " мин. "; } } if ($out == '') { - $out = $time_still . ' .'; + $out = $time_still . ' сек.'; } - $ei .= ': ' . $out . ''; + $ei .= 'Осталось: ' . $out . ''; } - // + //Действие эффекта $tr = ''; $t = $this->items['add']; $x = 0; @@ -9512,7 +9001,7 @@ LIMIT 1')); $ei .= $tr; } if ($e['info'] != '') { - $ei .= '
:
' . $e['info']; + $ei .= '
Информация:
' . $e['info']; } if ($e['img2'] != '' && $e['img'] == 'icon_none.gif') { $e['img'] = $e['img2']; @@ -9522,7 +9011,7 @@ LIMIT 1')); } $eff .= ''; } elseif ($e['timeUse'] + $e['timeAce'] + $e['actionTime'] < time() && $e['timeUse'] != 77) { - // + //удаляем эффект $ed = $this->lookStats($e['data']); if (!isset($ed['finish_file']) || $this->info['id'] == $e['uid']) { $this->endEffect($e['id'], $u); @@ -9531,11 +9020,11 @@ LIMIT 1')); } if ($sn['itmslvl'] == 0) { - //$ei = ' ()
: '; + //$ei = 'Легкое вооружение (Эффект)
Осталось: Бесконечно'; //$eff .= ''; } - // + //здоровье if ($type_info == 1) { $hptop = 0; $lh = [0 => 'hp_none', 1 => 1]; @@ -9550,24 +9039,24 @@ LIMIT 1')); $lh[0] = 'hp_3'; } if ($sn['mpAll'] > 0) { - // + //мана $lm = [0 => 'hp_none', 1 => 1]; $lm[1] = floor($sn['mpNow'] / $sn['mpAll'] * 120); if ($lm[1] > 0) { $lm[0] = 'hp_mp'; } - $hpmp .= '
' . floor($sn['mpNow']) . '/' . (0 + $sn['mpAll']) . '
-
+ $hpmp .= '
' . floor($sn['mpNow']) . '/' . (0 + $sn['mpAll']) . '
+
-
'; +
'; } else { $hptop = 5; } - $hpmp = '
' . floor($sn['hpNow']) . '/' . (0 + $sn['hpAll']) . '
-
+ $hpmp = '
' . floor($sn['hpNow']) . '/' . (0 + $sn['hpAll']) . '
+
-
' . $hpmp; - // +
' . $hpmp; + //Собираем НР и МР $hpmp = '
' . $hpmp . '
'; } elseif ($type_info == 2) { $hptop = 0; @@ -9584,24 +9073,24 @@ LIMIT 1')); } if ($sn['mpAll'] > 0) { - // + //мана $lm = [0 => 'hp_none', 1 => 1]; $lm[1] = floor($sn['mpNow'] / $sn['mpAll'] * 200); if ($lm[1] > 0) { $lm[0] = 'hp_mp'; } - $hpmp .= '
' . floor($sn['mpNow']) . '/' . (0 + $sn['mpAll']) . '
-
+ $hpmp .= '
' . floor($sn['mpNow']) . '/' . (0 + $sn['mpAll']) . '
+
-
'; +
'; } else { $hptop = 5; } - $hpmp = '
' . floor($sn['hpNow']) . '/' . (0 + $sn['hpAll']) . '
-
+ $hpmp = '
' . floor($sn['hpNow']) . '/' . (0 + $sn['hpAll']) . '
+
-
' . $hpmp; - // +
' . $hpmp; + //Собираем НР и МР $hpmp = '
' . $hpmp . '
'; } @@ -9619,30 +9108,30 @@ LIMIT 1')); } $pb = ''; if ($u['banned'] > 0) { - $pb .= '
'; + $pb .= '
Персонаж заблокирован
'; } if ($u['allLock'] > time()) { - $pb .= '
!
'; + $pb .= '
Временный запрет передач!
'; } - $swm = 0; // + $swm = 0; //свитки магии $l = 40; while ($l <= 52) { if (isset($witm[$l])) { $swm++; } else { - $witm[$l] = ''; + $witm[$l] = ''; } $l++; } - $ssm = 0; // + $ssm = 0; //слоты сумки $l = 59; while ($l <= 62) { if (isset($witm[$l])) { $ssm++; } else { - $witm[$l] = ''; + $witm[$l] = ''; } $l++; } @@ -9687,20 +9176,20 @@ LIMIT 1')); $zag = ''; /* - $witmn[1] = ''; - $witmn[2] = ''; - $witmn[3] = ''; - $witmn[4] = ''; - $witmn[7] = ''; - $witmn[8] = ''; - $witmn[9] = ''; - $witmn[10] = ''; - $witmn[11] = ''; - $witmn[12] = ''; - $witmn[13] = ''; - $witmn[14] = ''; - $witmn[16] = ''; - $witmn[17] = ''; + $witmn[1] = ''; + $witmn[2] = ''; + $witmn[3] = ''; + $witmn[4] = ''; + $witmn[7] = ''; + $witmn[8] = ''; + $witmn[9] = ''; + $witmn[10] = ''; + $witmn[11] = ''; + $witmn[12] = ''; + $witmn[13] = ''; + $witmn[14] = ''; + $witmn[16] = ''; + $witmn[17] = ''; */ $j2 = 0; while ($j2 <= 17) { @@ -9753,36 +9242,36 @@ LIMIT 1')); if ($zag == '') { if ($i1 == 0) { if (!isset($_GET['inv'])) { - $invg = [0 => 'main.php?inv=1', 1 => '']; + $invg = [0 => 'main.php?inv=1', 1 => 'Рюкзак']; } else { - $invg = [0 => 'main.php?skills=1', 1 => '']; + $invg = [0 => 'main.php?skills=1', 1 => 'Умения']; } } else { $o = mysql_fetch_array(mysql_query('SELECT `id` FROM `obraz` WHERE `img` = "' . mysql_real_escape_string($this->info['obraz']) . '" AND `sex` = "' . $this->info['sex'] . '" LIMIT 1')); - $invg = [0 => 'https://new-combats.com/shadow/' . $o['id'] . '" target="_blank', 1 => ' ']; + $invg = [0 => 'https://new-combats.com/shadow/' . $o['id'] . '" target="_blank', 1 => 'Галерея образов']; } $uobr = 'i/obraz/' . $u['sex'] . '/' . $u['obraz'] . ''; if (isset($sn['items_img'][1])) { $uobr = 'rimg/r' . $sn['items_img'][1]; } $rt[0] .= '
- -
+ +
' . $eff . '
' . $anml . '
'; } else { if ($i1 == 0) { if (!isset($_GET['inv'])) { - $invg = [0 => 'main.php?inv=1', 1 => '']; + $invg = [0 => 'main.php?inv=1', 1 => 'Рюкзак']; } else { - $invg = [0 => 'main.php?skills=1', 1 => '']; + $invg = [0 => 'main.php?skills=1', 1 => 'Умения']; } } else { - $invg = [0 => 'https://lib.new-combats.com/obraz.php?namez=' . $u['zag'] . '" target="_blank', 1 => ' ']; + $invg = [0 => 'https://lib.new-combats.com/obraz.php?namez=' . $u['zag'] . '" target="_blank', 1 => 'Галерея образов']; } $rt[0] .= '
- -
+ +
' . $eff . '
' . $anml . '
'; } @@ -9872,12 +9361,12 @@ LIMIT 1')); if ($zag == '') { if ($i1 == 0) { if (!isset($_GET['inv'])) { - $invg = [0 => 'main.php?inv=1', 1 => '']; + $invg = [0 => 'main.php?inv=1', 1 => 'Рюкзак']; } else { - $invg = [0 => 'main.php?skills=1', 1 => '']; + $invg = [0 => 'main.php?skills=1', 1 => 'Умения']; } } else { - $invg = [0 => 'https://lib.new-combats.com/obraz.php?name=' . $u['obraz'] . '" target="_blank', 1 => ' ']; + $invg = [0 => 'https://lib.new-combats.com/obraz.php?name=' . $u['obraz'] . '" target="_blank', 1 => 'Галерея образов']; } $u['obraz'] = '0.gif'; $uobr = 'i/obraz/' . $u['sex'] . '/old/' . $u['obraz'] . ''; @@ -9885,8 +9374,8 @@ LIMIT 1')); $uobr = 'rimg/r' . $sn['items_img'][1]; } $rt[0] .= '
- -
+ +
' . $eff . '
' . $anml . '
'; } @@ -9941,8 +9430,8 @@ LIMIT 1')); if (isset($e['id'])) { $sleep = $this->testAction('`vars` = "sleep" AND `uid` = "' . $e['uid'] . '" LIMIT 1', 1); if ($e['id_eff'] == 2) { - // - $ev = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_main` WHERE `name` = "' . mysql_real_escape_string(str_replace(': ', '', $e['name'])) . '" LIMIT 1')); + //Проверка + $ev = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_main` WHERE `name` = "' . mysql_real_escape_string(str_replace('Изучение: ', '', $e['name'])) . '" LIMIT 1')); $et = mysql_fetch_array(mysql_query('SELECT `id` FROM `actions` WHERE `uid` = "' . $e['uid'] . '" AND `vars` LIKE "%read%" AND `vals` = "' . $ev['id'] . '" LIMIT 1')); if (isset($et['id'])) { if ($et['time'] < time()) { @@ -9969,7 +9458,7 @@ LIMIT 1')); } } if (isset($u['id']) && ($e['type1'] < 11 || ($e['type1'] > 16 && $e['type1'] < 23)) && $e['noch'] == 0) { - $text = ' "' . $e['name'] . '"'; + $text = 'Закончилось действие эффекта "' . $e['name'] . '"'; mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`new`) VALUES ('" . $u['city'] . "','" . $u['room'] . "','','" . $u['login'] . "','" . $text . "','-1','6','0',1)"); if ($u['battle'] > 0) { $lastHOD = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type` FROM `battle_logs` WHERE `battle` = "' . $u['battle'] . '" ORDER BY `id_hod` DESC LIMIT 1')); @@ -9978,7 +9467,7 @@ LIMIT 1')); if ($lastHOD['type'] != 6) { $id_hod++; } - mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $u['battle'] . '","' . ($id_hod) . '","{tm1} ' . $text . ' {u1}.","login1=' . $u['login'] . '||t1=' . $u['team'] . '||time1=' . time() . '","","","","","6")'); + mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $u['battle'] . '","' . ($id_hod) . '","{tm1} ' . $text . ' у персонажа {u1}.","login1=' . $u['login'] . '||t1=' . $u['team'] . '||time1=' . time() . '","","","","","6")'); } } } @@ -10072,7 +9561,7 @@ LIMIT 1')); `iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`inOdet`="0" AND `iu`.`inShop`="0" '.$au.' AND `iu`.`delete`="1000" AND `iu`.`inGroup` = "'.$itm['id'].'" LIMIT 1')); if(!isset($itm['id'])) { - $this->error = ' ...'; + $this->error = 'Группа предметов ошибочна...'; $notr++; } else { $itm['delete'] = 0; @@ -10087,16 +9576,16 @@ LIMIT 1')); if (isset($tr['maks_itm_one']) && $tr['maks_itm_one'] > 0) { $test = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "' . $this->info['id'] . '" AND `inOdet` > 0 AND `delete` = 0 AND `data` LIKE "%maks_itm_one=' . $tr['maks_itm_one'] . '%" LIMIT 1')); if (isset($test['id'])) { - $this->error = ' !'; + $this->error = 'Возможное использование максимум одного предмета!'; $notr++; } } if ($this->info['twink'] > 0) { - // 100 . + //Не дороже 100 екр. if ($itm['price2'] > 100 || $itm['2price'] > 100) { $notr++; } - // + + //Нельзя руны + чарки if (isset($tr['rune']) && $tr['rune'] > 0) { $notr++; } @@ -10134,11 +9623,11 @@ LIMIT 1')); } } if ($notr > 0) { - // + //Не хватает характеристик или не совпадают условия if (isset($tr['open']) && isset($_GET['open'])) { - $this->error = ' '; + $this->error = 'Вы не можете открыть данный предмет'; } else { - $this->error = ' '; + $this->error = 'Нельзя одеть больше одного предмета данного типа'; } return 0; } elseif (isset($tr['open']) && isset($_GET['open']) && isset($tr['items_in_file'])) { @@ -10150,45 +9639,45 @@ LIMIT 1')); require('_incl_data/class/magic/' . $tr['items_in_file'] . '.php'); if (!isset($no_open_itm)) { $this->deleteItem($itm['id'], $this->info['id']); - $this->error = ' "' . $itm['name'] . '":
' . $io . '...'; + $this->error = 'Вы успешно открыли "' . $itm['name'] . '":
' . $io . '...'; } else { unset($no_open_itm); } } else { - $this->error = ' "' . $itm['name'] . '" ...'; + $this->error = 'Предмет "' . $itm['name'] . '" невозможно открыть...'; } } elseif (isset($tr['open']) && isset($_GET['open'])) { - // + //открываем предмет $io = ''; $i = 0; $itms = explode(',', $tr['items_in']); if ($itm['type'] == 37) { - // + //Распаковываем упаковку $io = ''; $itmin = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `id` = "' . $tr['item_inbox'] . '" LIMIT 1')); $itmmn = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . $itmin['item_id'] . '" LIMIT 1')); // if ($itm['gift'] == '' || $itm['gift'] == '0') { - $this->error = ' , !'; + $this->error = 'Предмет должен быть подарен, прежде чем его открывать!'; } elseif (!isset($itmin['id'])) { - $this->error = ' , - ...'; + $this->error = 'В упаковке ничего нет, скорее всего предмет кто-то вытащил от туда...'; } else { $io .= $itmmn['name']; if ($itmin['item_id'] == 4867) { - // + //Не откроешь $this->deleteItem($itm['id'], $this->info['id']); $this->deleteItem($itmin['id'], $this->info['id']); - $this->error = ' . .'; + $this->error = 'Не удалось открыть подарок. Содержимое испорчено.'; } elseif ($itmin['item_id'] == 4868) { - // + //Летучая мышь mysql_query('UPDATE `stats` SET `hpNow` = 1,`mpNow` = 1 WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); $this->deleteItem($itm['id'], $this->info['id']); $this->deleteItem($itmin['id'], $this->info['id']); - $this->error = ' HP...'; + $this->error = 'Вы потеряли все HP...'; } elseif ($itmin['item_id'] == 4870) { - // + //Минута молчания if ($this->info['molch1'] > time()) { $this->info['molch1'] += 3600; } else { @@ -10197,90 +9686,90 @@ LIMIT 1')); mysql_query('UPDATE `users` SET `molch1` = "' . $this->info['molch1'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); $this->deleteItem($itm['id'], $this->info['id']); $this->deleteItem($itmin['id'], $this->info['id']); - $this->error = ' ...'; + $this->error = 'Вы оказались под действие заклятия молчания...'; } elseif ($itmin['item_id'] == 4873) { - // + //Крысиный яд $a = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `uid` = "' . $this->info['id'] . '" AND `id` = "' . $this->info['animal'] . '" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1')); $this->deleteItem($itm['id'], $this->info['id']); $this->deleteItem($itmin['id'], $this->info['id']); if (isset($a['id'])) { - $this->error = ' "' . $a['name'] . '" ...'; + $this->error = 'Ваш зверь "' . $a['name'] . '" странно позеленел...'; mysql_query('UPDATE `users_animal` SET `eda` = 0, `yad` = "' . (time() + 86400 * 7) . '" WHERE `id` = "' . $a['id'] . '" LIMIT 1'); } else { - $this->error = '- , :)'; + $this->error = 'Кто-то пытался отравить вашего зверя, которого у вас нет :)'; } } elseif ($itmin['item_id'] == 4869) { - // ( 1 ) + //Неасчастный случай (легкая травма на 1 час) $this->deleteItem($itm['id'], $this->info['id']); $this->deleteItem($itmin['id'], $this->info['id']); mysql_query('INSERT INTO `eff_users` (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES ( "0","' . (time() + 3600) . '","-1", - " ","add_s' . rand(1, 3) . '=-' . rand(5, 15) . '","' . $this->info['id'] . '", + "Неверие в человечество","add_s' . rand(1, 3) . '=-' . rand(5, 15) . '","' . $this->info['id'] . '", "4", "bad_present_travma1.gif","0", "1" )'); - $this->error = ' . ...'; + $this->error = 'Вы травмированы. В том числе и физически...'; } elseif ($itmin['item_id'] == 4872) { - // ( 1 ) + //Трагедия (средняя травма на 1 час) $this->deleteItem($itm['id'], $this->info['id']); $this->deleteItem($itmin['id'], $this->info['id']); mysql_query('INSERT INTO `eff_users` (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES ( "0","' . (time() + 3600) . '","-1", - " ","add_s' . rand(1, 3) . '=-' . rand(16, 25) . '","' . $this->info['id'] . '", + "Неверие в человечество","add_s' . rand(1, 3) . '=-' . rand(16, 25) . '","' . $this->info['id'] . '", "4", "bad_present_travma2.gif","0", "2" )'); - $this->error = ' . ...'; + $this->error = 'Вы травмированы. В том числе и физически...'; } elseif ($itmin['item_id'] == 4876) { - // ( 1 ) + //Катастрофа (тяжелая травма на 1 час) $this->deleteItem($itm['id'], $this->info['id']); $this->deleteItem($itmin['id'], $this->info['id']); mysql_query('INSERT INTO `eff_users` (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES ( "0","' . (time() + 3600) . '","-1", - " ","add_s' . rand(1, 3) . '=-' . rand(26, 35) . '","' . $this->info['id'] . '", + "Неверие в человечество","add_s' . rand(1, 3) . '=-' . rand(26, 35) . '","' . $this->info['id'] . '", "4", "bad_present_travma3.gif","0", "3" )'); - $this->error = ' . ...'; + $this->error = 'Вы травмированы. В том числе и физически...'; } elseif ($itmin['item_id'] == 4878) { - // (add_puti=7200) + //Недвижимость (add_puti=7200) $this->deleteItem($itm['id'], $this->info['id']); $this->deleteItem($itmin['id'], $this->info['id']); mysql_query('INSERT INTO `eff_users` (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES ( "0","' . (time() + 7200) . '","-1", - "","add_puti=1","' . $this->info['id'] . '", + "Недвижимость","add_puti=1","' . $this->info['id'] . '", "4", "bad_present_chains.gif","0", "3" )'); - $this->error = ' ...'; + $this->error = 'Вы не можете передвигаться...'; } elseif ($itmin['item_id'] == 4874) { - // + //Сюрприз для мага на час $this->deleteItem($itm['id'], $this->info['id']); $this->deleteItem($itmin['id'], $this->info['id']); mysql_query('INSERT INTO `eff_users` (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES ( "0","' . (time() + 3600) . '","-1", - " ","add_s5=-50","' . $this->info['id'] . '", + "Сюрприз для Мага","add_s5=-50","' . $this->info['id'] . '", "4", "bad_present_dmage.gif","0", "3" )'); - $this->error = ' ...'; + $this->error = 'Вам нехорошо...'; } elseif ($itmin['item_id'] == 4871) { - // + //Сюрприз для воина на час $this->deleteItem($itm['id'], $this->info['id']); $this->deleteItem($itmin['id'], $this->info['id']); mysql_query('INSERT INTO `eff_users` (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES ( "0","' . (time() + 3600) . '","-1", - " ","add_s1=-50","' . $this->info['id'] . '", + "Сюрприз для Воина","add_s1=-50","' . $this->info['id'] . '", "4", "bad_present_dfighter.gif","0", "3" )'); - $this->error = ' ...'; - } elseif (mysql_query('UPDATE `items_users` SET `uid` = "' . $this->info['id'] . '",`lastUPD` = "' . time() . '",`gift` = "' . $itm['gift'] . '",`gtxt1` = "' . $itm['gtxt1'] . '",`gtxt2` = " . : ' . date('d.m.Y H:i:s', $itmin['time_create']) . '" WHERE `id` = "' . $itmin['id'] . '" LIMIT 1')) { - // + $this->error = 'Вам нехорошо...'; + } elseif (mysql_query('UPDATE `items_users` SET `uid` = "' . $this->info['id'] . '",`lastUPD` = "' . time() . '",`gift` = "' . $itm['gift'] . '",`gtxt1` = "' . $itm['gtxt1'] . '",`gtxt2` = "Предмет из упаковки. Дата запаковки: ' . date('d.m.Y H:i:s', $itmin['time_create']) . '" WHERE `id` = "' . $itmin['id'] . '" LIMIT 1')) { + //Удаляем упаковку $this->deleteItem($itm['id'], $this->info['id']); - $this->error = ' "' . $itm['name'] . '", :
' . $io . '...'; + $this->error = 'Вы успешно открыли "' . $itm['name'] . '", внутри было найдено:
' . $io . '...'; } else { - $this->error = ' , ?'; + $this->error = 'Неудалось открыть подарок, что же там?'; } // } @@ -10312,7 +9801,7 @@ LIMIT 1')); mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '",`inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'); } $this->deleteItem($itm['id'], $this->info['id']); - $this->error = ' "' . $itm['name'] . '", :
' . $io . '...'; + $this->error = 'Вы успешно открыли "' . $itm['name'] . '", внутри было найдено:
' . $io . '...'; } } else { $inSlot = $itm['inslot']; @@ -10322,13 +9811,13 @@ LIMIT 1')); $d[$p['inOdet']] = $p['id']; } - // + //Если в слот оружия и можно одеть в левую руку if ($itm['2too'] == 1 && $inSlot == 3 && isset($d[3])) { $inSlot = 14; } if ($inSlot == 3 || $inSlot == 14) { - // - + //Проверяем есть-ли двуручное оружие if ($this->stats['items'][$this->stats['wp3id']]['2h'] == 1 || $this->stats['items'][$this->stats['wp14id']]['2h'] == 1 || $itm['2h'] == 1) { $this->snatItem($this->stats['items'][$this->stats['wp3id']]['id'], $uid); $this->snatItem($this->stats['items'][$this->stats['wp14id']]['id'], $uid); @@ -10391,7 +9880,7 @@ LIMIT 1')); mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '", `inGroup` = 0, `delete` = 0 WHERE `id` = "' . $itm['id'] . '" LIMIT 1'); } if ($upd) { - // + //Если предмет привязывается после одевания //if($itm['']) //{ // @@ -10400,12 +9889,12 @@ LIMIT 1')); mysql_query('UPDATE `users` SET `autospell` = "1" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); return 1; } else { - $this->error = '(!) '; + $this->error = '(!) Ошибка обновления данных'; return 0; } } } else { - $this->error = ' '; + $this->error = 'Предмет не найден в вашем рюкзаке'; return 0; } } @@ -10422,14 +9911,14 @@ LIMIT 1')); if (isset($itm['id'])) { if ($coldel == 0) { - // + //Удаляем целиком $upd = mysql_query('UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time() . '" WHERE `id`="' . $itm['id'] . '" LIMIT 1'); $col = $this->itemsX($itm['id']); if ($col > 0) { mysql_query('UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time() . '",`inGroup` = "0" WHERE `inGroup`="' . $itm['id'] . '" LIMIT ' . $col); } } else { - // - + //Удаляем конкретное кол-во $col = $this->itemsX($itm['id']); if ($col > 1) { if ($col <= $coldel) { @@ -10437,7 +9926,7 @@ LIMIT 1')); } $upd = mysql_query('UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time() . '",`inGroup` = "0" WHERE `inGroup`="' . $itm['id'] . '" AND `delete` = "1000" LIMIT ' . $coldel); } else { - // + //Удаляем целиком $upd = mysql_query('UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time() . '" WHERE `id`="' . $itm['id'] . '" LIMIT 1'); $upd = mysql_query('UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time() . '",`inGroup` = "0" WHERE `inGroup`="' . $itm['id'] . '" AND `delete` = "1000" LIMIT ' . $col); } @@ -10452,18 +9941,18 @@ LIMIT 1')); $col = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `item_id`="' . $itm['item_id'] . '" AND `inOdet` = 0 AND `delete` < 100000 AND `uid` = "' . $itm['uid'] . '" AND `data` NOT LIKE "%nodelete%"' . $whr)); $col = $col[0]; mysql_query('UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time() . '" WHERE `item_id`="' . $itm['item_id'] . '" AND `inOdet` = 0 AND `delete` < 100000 AND `uid` = "' . $itm['uid'] . '" AND `data` NOT LIKE "%nodelete%"' . $whr); - $this->error = ' "' . $itm['name'] . ' (x' . ($col + 1) . ')" '; - $this->addDelo(1, $uid, '"System.inventory": "' . $itm['name'] . ' (x' . $col . ')" [itm:' . $itm['id'] . '=' . time() . '] .', time(), $this->info['city'], 'System.inventory', 0, 0); + $this->error = 'Предметы "' . $itm['name'] . ' (x' . ($col + 1) . ')" выброшены'; + $this->addDelo(1, $uid, '"System.inventory": Предметы "' . $itm['name'] . ' (x' . $col . ')" [itm:' . $itm['id'] . '=' . time() . '] были выброшены.', time(), $this->info['city'], 'System.inventory', 0, 0); } else { - $this->error = ' "' . $itm['name'] . '" '; - $this->addDelo(1, $uid, '"System.inventory": "' . $itm['name'] . '" [itm:' . $itm['id'] . '] .', time(), $this->info['city'], 'System.inventory', 0, 0); + $this->error = 'Предмет "' . $itm['name'] . '" выброшен'; + $this->addDelo(1, $uid, '"System.inventory": Предмет "' . $itm['name'] . '" [itm:' . $itm['id'] . '] был выброшен.', time(), $this->info['city'], 'System.inventory', 0, 0); } return 1; } else { return 0; } } else { - $this->error = ' '; + $this->error = 'Предмет не найден в вашем рюкзаке'; } } @@ -10570,7 +10059,7 @@ LIMIT 1')); $sts = explode('|', $u['stats']); $i = 0; $ste = ''; - // + //Родные характеристики while ($i < count($sts)) { $ste = explode('=', $sts[$i]); if (isset($ste[1])) { @@ -10601,7 +10090,7 @@ LIMIT 1')); '); } - // + //Шаблонные картинки if ($this->info['id'] == $u['id'] || $reimg != false) { $sp_img = mysql_query('SELECT * FROM `items_img` WHERE `uid` = "' . $u['id'] . '" AND `img_id` != "0" LIMIT 16'); while ($pl_img = mysql_fetch_array($sp_img)) { @@ -10614,7 +10103,7 @@ LIMIT 1')); } } - // // tr_lvl + //Характеристики от предметов //ТУТ tr_lvl $cl = mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, `iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` @@ -10625,7 +10114,7 @@ LIMIT 1')); $hnd2 = 0; $sht1 = 0; $reitm = []; - $coms = []; // + $coms = []; // комплекты $dom = []; $btl_cof = 0; $oza = [ @@ -10633,13 +10122,13 @@ LIMIT 1')); 2 => [0, 0], 3 => [0, 0], 4 => [0, 0] - ]; // + ]; //особенности защиты $ozm = [ 1 => [0, 0], 2 => [0, 0], 3 => [0, 0], 4 => [0, 0] - ]; // + ]; //особенности магии $itmslvl = 0; $itmsCfc = 0; @@ -10652,7 +10141,7 @@ LIMIT 1')); $st['irka'] += $pl['price1']; } } - /* */ + /* Доминирование */ //$dom[count($dom)] = array($pl['inOdet'],$pl['class'],$pl['class_point'],$pl['anti_class'],$pl['anti_class_point'],$pl['level'],$u['level'],$pl['price2']); @@ -10741,46 +10230,46 @@ LIMIT 1')); if (isset($sti['add_oza' . $ko])) { if (isset($sti['add_oza'])) { if ($sti['add_oza'] == 1) { - // + //Слабая $oza[$ko][0] += 1; $oza[$ko][1] += 9; } elseif ($sti['add_oza'] == 2) { - // + //Нормальная $oza[$ko][0] += 20; $oza[$ko][1] += 39; } elseif ($sti['add_oza'] == 3) { - // + //Хорошая $oza[$ko][0] += 40; $oza[$ko][1] += 69; } elseif ($sti['add_oza'] == 4) { - // + //Посредственная $oza[$ko][0] += 10; $oza[$ko][1] += 19; } elseif ($sti['add_oza'] == 5) { - // + //Великолепная $oza[$ko][0] += 70; $oza[$ko][1] += 89; } } if (isset($sti['add_ozm'])) { if ($sti['add_ozm'] == 1) { - // + //Слабая $ozm[$ko][0] += 1; $ozm[$ko][1] += 9; } elseif ($sti['add_ozm'] == 2) { - // + //Нормальная $ozm[$ko][0] += 20; $ozm[$ko][1] += 39; } elseif ($sti['add_ozm'] == 3) { - // + //Хорошая $ozm[$ko][0] += 40; $ozm[$ko][1] += 69; } elseif ($sti['add_ozm'] == 4) { - // + //Посредственная $ozm[$ko][0] += 10; $ozm[$ko][1] += 19; } elseif ($sti['add_ozm'] == 5) { - // + //Великолепная $ozm[$ko][0] += 70; $ozm[$ko][1] += 89; } @@ -10789,45 +10278,45 @@ LIMIT 1')); $ozm[$ko][1] += 9; } if ($sti['add_oza' . $ko] == 1) { - // + //Слабая $oza[$ko][0] += 1; $oza[$ko][1] += 9; } elseif ($sti['add_oza' . $ko] == 2) { - // + //Нормальная $oza[$ko][0] += 20; $oza[$ko][1] += 39; } elseif ($sti['add_oza' . $ko] == 3) { - // + //Хорошая $oza[$ko][0] += 40; $oza[$ko][1] += 69; } elseif ($sti['add_oza' . $ko] == 4) { - // + //Посредственная $oza[$ko][0] += 10; $oza[$ko][1] += 19; } elseif ($sti['add_oza' . $ko] == 5) { - // + //Великолепная $oza[$ko][0] += 70; $oza[$ko][1] += 89; } if (isset($sti['add_ozm' . $ko])) { if ($sti['add_ozm' . $ko] == 1) { - // + //Слабая $ozm[$ko][0] += 1; $ozm[$ko][1] += 9; } elseif ($sti['add_ozm' . $ko] == 2) { - // + //Нормальная $ozm[$ko][0] += 20; $ozm[$ko][1] += 39; } elseif ($sti['add_ozm' . $ko] == 3) { - // + //Хорошая $ozm[$ko][0] += 40; $ozm[$ko][1] += 69; } elseif ($sti['add_ozm' . $ko] == 4) { - // + //Посредственная $ozm[$ko][0] += 10; $ozm[$ko][1] += 19; } elseif ($sti['add_ozm' . $ko] == 5) { - // + //Великолепная $ozm[$ko][0] += 70; $ozm[$ko][1] += 89; } @@ -10908,13 +10397,13 @@ LIMIT 1')); $st['zona'] += $sti['zona']; } - // + //Добавляем статы от данного предмета if (!isset($sti['restart_stats'])) { $i = 0; while ($i < count($ia)) { if (isset($ia[$i])) { - // ( ) + //Действует на (Действует на) if (isset($sti['add_' . $ia[$i]])) { if ($ia[$i] != 'zmproc' && $ia[$i] != 'zaproc') { @@ -10954,13 +10443,13 @@ LIMIT 1')); } } - // - + //Сохраненные хар-ки и умения if (count($reitm) > 0) { $i39 = [0 => 0, 1 => 0, 2 => 0]; $i = 0; while ($i < count($reitm)) { if (isset($reitm[$i]['sm_skill']) && $i39[0] == 0) { - // + //умения $i9 = 1; $i39[0] = 1; while ($i9 <= 7) { @@ -10969,7 +10458,7 @@ LIMIT 1')); $i9++; } } elseif (isset($reitm[$i]['sm_abil']) && $i39[1] == 0) { - // + //статы $i9 = 1; $i39[1] = 1; while ($i9 <= 12) { @@ -10977,7 +10466,7 @@ LIMIT 1')); $i9++; } } elseif (isset($reitm[$i]['sm_skill2']) && $i39[2] == 0) { - // + //навыки $i39[2] = 1; } @@ -10985,7 +10474,7 @@ LIMIT 1')); } } - // + //Харки от иконок $efs = mysql_query('SELECT * FROM `users_ico` WHERE `uid`="' . mysql_real_escape_string($u['id']) . '" AND (`endTime` > "' . time() . '" OR `endTime` = 0)'); while ($e = mysql_fetch_array($efs)) { $sts = $this->lookStats($e['bonus']); @@ -11011,7 +10500,7 @@ LIMIT 1')); } } /*if( $u['battle'] > 0 ) { - // + //Кэшируем $cache_items = array( 'st' => $st, 'sti' => $sti, @@ -11040,7 +10529,7 @@ LIMIT 1')); $test_noef = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_actions` WHERE `uid` = "' . $u['id'] . '" AND `vars` = "noeffectbattle1" AND `btl` = "' . $u['battle'] . '" LIMIT 1')); } //} - // + //Характеристики от эффектов $h = 0; $nbs = []; $prsu = []; @@ -11052,7 +10541,7 @@ LIMIT 1')); if ($u['dnow'] == 0) { if ($u['battle'] == 0) { mysql_query('DELETE FROM `eff_users` WHERE `id_eff` = "' . $e['id_eff'] . '" AND `uid` = "' . $u['id'] . '" AND `id` != "' . $e['id'] . '" ORDER BY `id` ASC'); - // + //Переводим в заряды if ($e['v1'] != 'priem') { if ($e['hod'] != -1) { mysql_query('UPDATE `eff_users` SET `hod` = "-1",`timeUse` = "' . (time() + ($e['hod'] * $c['effz']) - $e['actionTime']) . '" WHERE `id` = "' . $e['id'] . '" LIMIT 1'); @@ -11071,9 +10560,9 @@ LIMIT 1')); } //echo '['.date( 'd.m.Y H:i:s' , time() + round((($e['timeUse']+$e['timeAce']+$e['actionTime'])-time())/$c['effz'])*$c['effz']).']'; if (true == false && $test_btl_info['noeff'] == 1 && isset($this->ekrcast[$e['id_eff']])) { - // + //эффекты не действуют } elseif ($e['sleeptime'] != 0 && substr_count($e['v1'], 'pgb') > 0) { - // + //Не отображаем действие пристрастия во время сна } elseif (($e['timeUse'] + $e['timeAce'] + $e['actionTime'] > time() || $e['timeUse'] == 77)) { if ($e['v1'] == 'priem') { $prsu[$e['v2']] = 0 + $prsu['x']; @@ -11136,7 +10625,7 @@ LIMIT 1')); $i++; } } elseif ($e['timeUse'] != 77) { - // + //удаляем эффект if ($e['img2'] != 'tz.gif' || $u['id'] == $this->info['id']) { if ($e['sleeptime'] == 0) { $this->endEffect($e['id'], $u); @@ -11149,38 +10638,38 @@ LIMIT 1')); $st['noeffectbattle1'] = 1; } - // + //Заглушки от эффектов //$st['items_img'][$pl_img['type']] = $pl_img_r['id'].'.'.$pl_img_r['format']; if ($nbs[4899] > 0) { - // + //Зеленый комплект $st['items_img'][8] = 'robe_illusion4.gif'; $st['items_img'][11] = 'leg_illusion4.gif'; } elseif ($nbs[4900] > 0) { - // + //Золото комплект $st['items_img'][8] = 'robe_illusion5.gif'; $st['items_img'][11] = 'leg_illusion5.gif'; } elseif ($nbs[4901] > 0) { - // + //Голубой комплект $st['items_img'][8] = 'robe_illusion3.gif'; $st['items_img'][11] = 'leg_illusion3.gif'; } elseif ($nbs[4902] > 0) { - // + //Синий комплект $st['items_img'][8] = 'robe_illusion6.gif'; $st['items_img'][11] = 'leg_illusion6.gif'; } elseif ($nbs[4903] > 0) { - // + //Желтый комплект $st['items_img'][8] = 'robe_illusion8.gif'; $st['items_img'][11] = 'leg_illusion8.gif'; } elseif ($nbs[4904] > 0) { - // + //Сиреневое платье $st['items_img'][8] = 'robe_illusion7.gif'; $st['items_img'][11] = 'leg_illusion7.gif'; } elseif ($nbs[4905] > 0) { - // + //Оранжевое платье $st['items_img'][8] = 'robe_illusion9.gif'; $st['items_img'][11] = 'leg_illusion9.gif'; } elseif ($nbs[4908] > 0) { - // + //Набор Темной Одежды $st['items_img'][8] = 'robe_illusion2.gif'; $st['items_img'][11] = 'leg_illusion2.gif'; $st['items_img'][10] = 'boots_illusion2.gif'; @@ -11189,7 +10678,7 @@ LIMIT 1')); $st['items_img'][4] = 'helmet_illusion2.gif'; $st['items_img'][12] = 'perchi_illusion2.gif'; } elseif ($nbs[4906] > 0) { - // + //Набор Бриллиантовой Одежды $st['items_img'][8] = 'robe_illusion1.gif'; $st['items_img'][11] = 'leg_illusion1.gif'; $st['items_img'][10] = 'boots_illusion1.gif'; @@ -11199,14 +10688,14 @@ LIMIT 1')); $st['items_img'][12] = 'perchi_illusion1.gif'; } if ($nbs[4909] > 0) { - // + //Набор Золотых украшений $st['items_img'][13] = 'ring_illusion2.gif'; $st['items_img'][17] = 'ring_illusion2.gif'; $st['items_img'][18] = 'ring_illusion2.gif'; $st['items_img'][14] = 'amulet_illusion2.gif'; $st['items_img'][15] = 'earrings_illusion2.gif'; } elseif ($nbs[4907] > 0) { - // + //Набор Золотых украшений $st['items_img'][13] = 'ring_illusion1.gif'; $st['items_img'][17] = 'ring_illusion1.gif'; $st['items_img'][18] = 'ring_illusion1.gif'; @@ -11215,7 +10704,7 @@ LIMIT 1')); } if ($itmslvl < 5) { - // + //Эффект ослабления $st['itmslvl'] = 0; } else { $st['itmslvl'] = 1; @@ -11226,7 +10715,7 @@ LIMIT 1')); unset($test_btl_info); if ($u['battle'] > 0) { - // + //Характеристики от приемов $efs = mysql_query('SELECT `eu`.`id`,`eu`.`id_eff`,`eu`.`uid`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`tr_life_user`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace` FROM `eff_users` AS `eu` WHERE `eu`.`uid`="' . mysql_real_escape_string($u['id']) . '" AND `eu`.`delete`="0" AND `eu`.`deactiveTime` < "' . time() . '" AND `eu`.`v1` = "priem" ORDER BY `eu`.`id` ASC'); $st['set_pog'] = []; $st['set_pog2'] = []; @@ -11315,14 +10804,14 @@ LIMIT 1')); $i++; } } elseif ($e['timeUse'] != 77) { - // + //удаляем эффект $this->endEffect($e['id'], $u); $st['act'] = 1; } } } - // + //Бонус покупателя /*$bl = mysql_fetch_array(mysql_query('SELECT `id`,`level` FROM `users_paybonus` WHERE `id` = "'.$u['id'].'" LIMIT 1')); $st['pbe'] = 0+$bl['level']; if( $st['pbe'] > 1000 ) { @@ -11330,7 +10819,7 @@ LIMIT 1')); } unset($bl);*/ - // + //Клан абилки /* if( $st['clanpos'] > 0 ) { if( $st['clanpos'] == 1 ) { @@ -11363,7 +10852,7 @@ LIMIT 1')); } }*/ - // + //Характеристики от статов if (!isset($st['hpAll'])) { $st['hpAll'] = 0; @@ -11379,26 +10868,26 @@ LIMIT 1')); } @$st['mpAll'] += @$st['s6'] * 10; - // + //Турнир if (!isset($st['m1'])) { $st['m1'] = 0; } $st['m1'] += $st['s3'] * 5; - // .- = 2.5 + // мф.анти-крит = 2.5 if (!isset($st['m2'])) { $st['m2'] = 0; } $st['m2'] += $st['s3'] * 5; - // . = 2.5 + // мф.уворот = 2.5 if (!isset($st['m4'])) { $st['m4'] = 0; } $st['m4'] += $st['s2'] * 5; - // .- = 2.5 + // мф.анти-уворот = 2.5 if (!isset($st['m5'])) { $st['m5'] = 0; } @@ -11434,7 +10923,7 @@ LIMIT 1')); } $st['pa2'] += $st['s1']*0.1;*/ - if (!isset($st['zaproc'])) { // 'zaproc'=>' (%)','zmproc'=>' (%) + if (!isset($st['zaproc'])) { //Тут зм 'zaproc'=>'Защита от урона (%)','zmproc'=>'Защита от магии стихий (%) $st['zaproc'] = 0; } $st['zaproc'] += round($st['s5'] * 0); @@ -11444,8 +10933,8 @@ LIMIT 1')); } $st['m19'] += round($st['s3'] * 0.03); - // - // " . ". + //Мощности + //Мощность против "Мощность крит. урона". Гамс if (!isset($st['antm3'])) { $st['antm3'] = 0; } @@ -11473,15 +10962,15 @@ LIMIT 1')); } $st['m8'] += 0; - // + //Бонусы комплектов $i = 0; while ($i <= count(@$coms['new'])) { if (@isset($coms['new'][$i])) { - //$coms[$i]['id'] - id , $j - - + //$coms[$i]['id'] - id комплекта, $j - кол-во предметов данного комплекта $j = @$coms['com'][$coms['new'][$i]]; $com = mysql_fetch_array(mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "' . ((int)$coms['new'][$i]) . '" AND `x` <= ' . ((int)$j) . ' ORDER BY `x` DESC LIMIT 1')); if (isset($com['id'])) { - // + //добавляем действия комплекта $ij = 0; $sti = $this->lookStats($com['data']); while ($ij < count($ia)) { @@ -11495,10 +10984,10 @@ LIMIT 1')); $i++; } - // - // + //Бонусы статов + //Замена свитков if ($u['autospell'] != '' && $u['autospell'] != 0 && $u['battle'] == 0) { - // + //проверяем свитки $splink = ''; $spi = mysql_query('SELECT `id`,`item_id`,`inOdet` FROM `items_users` WHERE `inOdet` >= 40 AND `inOdet` <= 50 AND `uid` = "' . $u['id'] . '" AND `delete` = 0 ORDER BY `item_id` DESC LIMIT 20'); while ($pli = mysql_fetch_array($spi)) { @@ -11506,13 +10995,13 @@ LIMIT 1')); } $splink = rtrim($splink, ','); - // + //Запоминаем новый комплект свитков if ($u['autospell'] == 1) { $u['autospell'] = $splink; mysql_query('UPDATE `users` SET `autospell` = "' . $splink . '" WHERE `id` = "' . $u['id'] . '" LIMIT 1'); } - // , + //Выдаем нужный свиток, если он есть в инвентаре if ($u['autospell'] != $splink) { $spe1 = explode(',', $splink); $spe2 = explode(',', $u['autospell']); @@ -11546,9 +11035,9 @@ LIMIT 1')); } - // - // - // + //Бонусы статов + //ТУТ + //сила /*if($st['s1']>24 && $st['s1']<50){ $st['m10'] += 5; } if($st['s1']>49 && $st['s1']<75){ $st['m10'] += 10; } if($st['s1']>74 && $st['s1']<100){ $st['m10'] += 17; } @@ -11589,7 +11078,7 @@ LIMIT 1')); $st['m7'] += 7; } - // $st[1]['pa1'] += 2; $st['m7'] += 35; + //ловкость $st[1]['pa1'] += 2; $st['m7'] += 35; /*if($st['s2']>24 && $st['s2']<50){ $st[1]['pa1'] += 2; } if($st['s2']>49 && $st['s2']<75){ $st['m7'] += 5; $st['m4'] += 35; $st['m2'] += 15; } if($st['s2']>74 && $st['s2']<100){ $st['m7'] += 15; $st['m4'] += 35; $st['m2'] += 15; } @@ -11642,7 +11131,7 @@ LIMIT 1')); $st['m15'] += 5; } - // + //интуиция /*if($st['s3']>24 && $st['s3']<50){ $st['m3'] += 10; } if($st['s3']>49 && $st['s3']<75){ $st['m3'] += 10; $st['m1'] += 35; $st['m5'] += 15; } if($st['s3']>74 && $st['s3']<100){ $st['m3'] += 25; $st['m1'] += 35; $st['m5'] += 15; } @@ -11701,7 +11190,7 @@ LIMIT 1')); $st['m14'] += 5; } - // + //выносливость /*if($st['s4']>0){ $st['hpAll'] += 30; } if($st['s4']>24 && $st['s4']<50){ $st['hpAll'] += 50; } if($st['s4']>49 && $st['s4']<75){ $st['hpAll'] += 100; } @@ -11747,7 +11236,7 @@ LIMIT 1')); $st['za'] += 125; $st['zm'] += 125; } - // + //интелект /*if($st['s5']>24 && $st['s5']<50){ $st['m11'] += 5; } if($st['s5']>49 && $st['s5']<75){ $st['m11'] += 10; } if($st['s5']>74 && $st['s5']<100){ $st['m11'] += 17; } @@ -11780,7 +11269,7 @@ LIMIT 1')); if ($st['s5'] > 199) { $st['pzm'] += 5; } - // + //мудрость /*if($st['s6']>24 && $st['s6']<50){ $st['mpAll'] += 50; $st['speedmp'] +=100; } if($st['s6']>49 && $st['s6']<75){ $st['mpAll'] += 100; $st['speedmp'] +=200; } if($st['s6']>74 && $st['s6']<100){ $st['mpAll'] += 175; $st['speedmp'] += 350; } @@ -11825,7 +11314,7 @@ LIMIT 1')); $st['pzm'] += 7; } - // + //если второе оружие одето if ($hnd2 == 1 && $hnd1 == 1) { $st['zona']++; } @@ -11837,7 +11326,7 @@ LIMIT 1')); //$st['speedhp'] += $st['pbe']; //$st['speedmp'] += $st['pbe']; - /* */ + /* Владения */ $i = 1; while ($i <= 7) { if (!isset($st['pm' . $i])) { @@ -11907,23 +11396,23 @@ LIMIT 1')); $i++; } - // + //Уязвимость оружие и магиям $i = 1; while ($i <= 7) { @$st['yzm' . $i] += @$st['yzma']; if ($i <= 4) { - @$st['yzm' . $i] += @$st['yzm'];// - @$st['yza' . $i] += @$st['yza']; // + @$st['yzm' . $i] += @$st['yzm'];//стихийный урон только + @$st['yza' . $i] += @$st['yza']; //урон оружия } - // + //Отнимает от защиты от урона if (isset($st['yza' . $i]) && $i <= 4) { $st['za' . $i] = ($st['za' . $i] / 100 * (100 + ($st['yza' . $i]))); if ($st['za' . $i] < 0) { $st['za' . $i] = 0; } } - // + //Отнимает от защиты от магии if (isset($st['yzm' . $i])) { $st['zm' . $i] = ($st['zm' . $i] / 100 * (100 + ($st['yzm' . $i]))); if ($st['zm' . $i] < 0) { @@ -11950,13 +11439,13 @@ LIMIT 1')); $st['mpAll'] += round($st['mpAll'] / 100 * $st['mpProc']); } - //. - 250 . + //Реген. - 250 ед. /*if( $u['level'] > 7 ) { $st['speedhp'] -= 240; $st['speedmp'] -= 240; }*/ - // + //конец бонусов if ($st['hpNow'] < 0) { $st['hpNow'] = 0; } elseif ($st['hpNow'] > $st['hpAll']) { @@ -11968,7 +11457,7 @@ LIMIT 1')); $st['mpNow'] = $st['mpAll']; } - // + //зоны блока и удара if ($st['zona'] < 1) { $st['zona'] = 1; } @@ -11996,7 +11485,7 @@ LIMIT 1')); $st['y'] = $u['y']; $st['s'] = $u['s']; - // + //Собираем рейтинг /*$st['reting'] = 0; // $st['reting'] += $st['hpAll']; @@ -12063,7 +11552,7 @@ LIMIT 1')); $st['pzm'] += 5; } - // + //Бонус от медалей $rep1 = mysql_fetch_array(mysql_query('SELECT `add_slot`,`nu_sandcity`,`n_sandcity`, `dl1`,`id`,`rep1`,`rep2`,`repcapitalcity`,`repdemonscity`,`repangelscity`,`repabandonedplain`, @@ -12084,49 +11573,49 @@ LIMIT 1')); $st['hpAll'] += 250; } - // + //Водосток if ($rep1['repdreamscity'] >= 24999) { $st['m10'] += 10; $st['pzm'] += 1; } - // + //излом if ($rep1['repizlom'] == 9999) { $st['m10'] += 10; $st['pzm'] += 1; } - // + //Бездна if ($rep1['repangelscity'] == 25000) { $st['m10'] += 10; $st['pzm'] += 1; } - // + //Катакомбы if ($rep1['repdemonscity'] == 25000) { $st['m10'] += 10; $st['pzm'] += 1; } - // + //Грибница if ($rep1['repdemonscity'] == 25000) { $st['m10'] += 10; $st['pzm'] += 1; } - // + //Пещера тысячи проклятий if ($rep1['repcapitalcity'] == 25000) { $st['m10'] += 10; $st['pzm'] += 1; } - // + //Санд if ($rep1['repsandcity'] == 25000) { $st['m10'] += 10; $st['pzm'] += 1; } - // + //Гора легиона if ($rep1['repabandonedplain'] == 24999) { $st['m10'] += 10; $st['pzm'] += 1; } - // + //Добавочный подьем для игроков $st['maxves'] += 500; if ($st['silver'] >= 5) { @@ -12146,7 +11635,7 @@ LIMIT 1')); $st['exp'] += 25; } - // + //Сохраняем рейтинг игрока $st['reting'] = floor($st['reting']); //if(@$st['btl_cof'] != @$st['reting']) { //$st['btl_cof'] = $st['reting']; @@ -12166,14 +11655,14 @@ LIMIT 1')); } if ($u['room'] == 411) { - //, -25% + //Хоккей, эффект от шайбы -25% НР $shb = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "' . $u['id'] . '" AND `item_id` = 4910 AND `delete` = 0 LIMIT 1')); if (isset($shb['id'])) { $st['hpAll'] = round($st['hpAll'] / 100 * 75); } } - if (stristr($u['login'], '( ') == true || (stristr($u['login'], ' ') && $u['ip'] == '0')) { + if (stristr($u['login'], '(зверь ') == true || (stristr($u['login'], 'Каменный страж') && $u['ip'] == '0')) { $st['this_animal'] = 1; } else { $st['this_animal'] = 0; @@ -12182,7 +11671,7 @@ LIMIT 1')); $rt = []; if ($i1 == 1) { $rt[0] = $st; - $rt[1] = $st2; // + $rt[1] = $st2; //родные статы } else { $rt = $st; } @@ -12220,7 +11709,7 @@ LIMIT 1')); return $msg_id; } - // + //получаем уровень public function testLevel() { global $c; @@ -12253,17 +11742,17 @@ LIMIT 1')); if ($this->info['exp'] >= $telvl[$this->info['upLevel']]) { $lvl = mysql_fetch_array(mysql_query('SELECT `duh`,`vinos`,`bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel`="' . $this->info['upLevel'] . '" LIMIT 1')); $lvln = mysql_fetch_array(mysql_query('SELECT `duh`,`vinos`,`bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel`="' . ($lvl['upLevel'] + 1) . '" LIMIT 1')); - // + //Кристал вечности if ($this->info['exp'] > 12499 && $this->info['level'] <= 5 && $c['infinity5level'] == true) { $itm = mysql_fetch_array(mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "1204" AND `delete` = "0" AND `uid` = "' . $this->info['id'] . '" AND `inShop` = "0" AND `inTransfer` = "0" LIMIT 1')); if (!isset($itm['id']) && $this->info['host_reg'] != 'noinfinity5' && $this->info['twink'] == 0) { $this->info['exp'] = 12499; mysql_query('UPDATE `stats` SET `exp` = "12499" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); - echo ''; + echo ''; } else { mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'); - $text = ' " [6]" .'; + $text = 'Предмет "Кристалл Вечности [6]" был успешно использован.'; echo ''; //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1',".$this->info['city']."','".$this->info['room']."','','".$this->info['login']."','".$text."','".time()."','6','0')"); } @@ -12276,16 +11765,16 @@ LIMIT 1')); while ($i != 1) { if ($c['nolevel'] == true && $this->info['exp'] >= $lvl['exp'] && isset($lvln['upLevel'])) { $tlus = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `real` = 1 AND `level` = "' . $this->info['level'] . '" LIMIT 1')); - // , $lvln + //берем апп или уровень, $lvln if ($tlus[0] < $this->info['level'] * 5) { - // / 100 + //Нельзя получать лвл/аппы пока не будет 100 персонажей текущего уровня $this->info['exp'] = $lvl['exp'] - 1; mysql_query('UPDATE `stats` SET `exp` = "' . $this->info['exp'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'); } } if ($this->info['exp'] >= $lvl['exp'] && isset($lvln['upLevel'])) { if ($lvl['nextLevel'] > $this->info['level']) { - /* + /*Выдаем бонусные предметы if($lvl['nextLevel']==9){ $this->addItem(5021,$this->info['id'],'|sudba='.$this->info['login']); } @@ -12299,7 +11788,7 @@ LIMIT 1')); $this->addItem(5023,$this->info['id'],'|sudba='.$this->info['login']); $this->addItem(5023,$this->info['id'],'|sudba='.$this->info['login']); }*/ - // + //повышаем выносливость $a4 = 1; if ($lvl['nextLevel'] == 9) { $a4 = 2; @@ -12314,12 +11803,12 @@ LIMIT 1')); $this->stats['s4'] += $a4; $sex1 = ''; if ($this->info['sex'] == 1) { - $sex1 = ''; + $sex1 = 'ла'; } $ult = 1; - // + //Рефералы if ($this->info['twink'] == 0 && (round($this->info['host_reg']) > 0 && ($this->info['dieline'] == 0 || $this->info['dieline'] < $lvl['exp']))) { $mtest = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`uid2`,`ip` FROM `mults` WHERE (`uid` = "' . $this->info['id'] . '" AND `uid2` = "' . ((int)$this->info['host_reg']) . '") OR (`uid2` = "' . $this->info['id'] . '" AND `uid` = "' . ((int)$this->info['host_reg']) . '") LIMIT 1')); $rlog = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`catch`,`host_reg` FROM `users` WHERE `id` = "' . ((int)$this->info['host_reg']) . '" LIMIT 1')); @@ -12353,23 +11842,23 @@ LIMIT 1')); $up = mysql_query('UPDATE `users` SET `money` = `money` + ' . $kr . ',`money2` = `money2` + ' . $ekr . ' WHERE `id` = "' . mysql_real_escape_string($rlog['id']) . '" LIMIT 1'); if ($up) { - // 1- + //Реферал 1-го уровня $krtxt = ''; if ($kr > 0) { - $krtxt .= '' . $kr . ' '; + $krtxt .= '' . $kr . ' КР'; if ($ekr > 0) { $krtxt .= ', '; } } if ($ekr > 0) { - $krtxt .= '' . $ekr . ' '; + $krtxt .= '' . $ekr . ' ЕКР'; } - $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], ' ' . $this->info['login'] . ' ' . $sex1 . ' ' . $lvl['nextLevel'] . '! ' . $krtxt, -1, 6, 0, 0, 0, 1); + $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], 'Ваш реферал ' . $this->info['login'] . ' достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt, -1, 6, 0, 0, 0, 1); $rlog['catch'] += $bn['add_bank']; mysql_query('UPDATE `users` SET `catch` = "' . $rlog['catch'] . '" WHERE `id` = "' . $rlog['id'] . '" LIMIT 1'); // if ((int)$rlog['host_reg'] > 0) { - // 2- + //Реферал 2-го уровня $llogin = $rlog['login']; $ekr = round($bn['add_bank'] * 0.4, 2); $kr = round($bn['add_money'] * 0.4, 2); @@ -12377,20 +11866,20 @@ LIMIT 1')); if (isset($rlog['id'])) { $krtxt = ''; if ($kr > 0) { - $krtxt .= '' . $kr . ' '; + $krtxt .= '' . $kr . ' КР'; if ($ekr > 0) { $krtxt .= ', '; } } if ($ekr > 0) { - $krtxt .= '' . $ekr . ' '; + $krtxt .= '' . $ekr . ' ЕКР'; } - $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], ' ' . $this->info['login'] . ' (2- "' . $llogin . '" ) ' . $sex1 . ' ' . $lvl['nextLevel'] . '! ' . $krtxt, -1, 6, 0, 0, 0, 1); + $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], 'Ваш реферал ' . $this->info['login'] . ' (2-го уровня от "' . $llogin . '" ) достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt, -1, 6, 0, 0, 0, 1); $rlog['catch'] += $bn['add_bank']; mysql_query('UPDATE `users` SET `money` = `money` + ' . $kr . ',`money2` = `money2` + ' . $ekr . ' WHERE `id` = "' . $rlog['id'] . '" LIMIT 1'); // if ((int)$rlog['host_reg'] > 0) { - // 3- + //Реферал 3-го уровня $llogin2 = $rlog['login']; $ekr = round($bn['add_bank'] * 0.2, 2); $kr = round($bn['add_money'] * 0.2, 2); @@ -12398,15 +11887,15 @@ LIMIT 1')); if (isset($rlog['id'])) { $krtxt = ''; if ($kr > 0) { - $krtxt .= '' . $kr . ' '; + $krtxt .= '' . $kr . ' КР'; if ($ekr > 0) { $krtxt .= ', '; } } if ($ekr > 0) { - $krtxt .= '' . $ekr . ' '; + $krtxt .= '' . $ekr . ' ЕКР'; } - $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], ' ' . $this->info['login'] . ' (3- "' . $llogin2 . '" ( ' . $llogin . ') ) ' . $sex1 . ' ' . $lvl['nextLevel'] . '! ' . $krtxt, -1, 6, 0, 0, 0, 1); + $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], 'Ваш реферал ' . $this->info['login'] . ' (3-го уровня от "' . $llogin2 . '" (Реферал ' . $llogin . ') ) достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt, -1, 6, 0, 0, 0, 1); $rlog['catch'] += $bn['add_bank']; mysql_query('UPDATE `users` SET `money` = `money` + ' . $kr . ',`money2` = `money2` + ' . $ekr . ' WHERE `id` = "' . $rlog['id'] . '" LIMIT 1'); // @@ -12417,14 +11906,14 @@ LIMIT 1')); } } else { - $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], ' ' . $this->info['login'] . ' ' . $sex1 . ' ' . $lvl['nextLevel'] . '! ( , ) ' . $bnk . ' ' . $ekr . ' .', -1, 6, 0, 0, 0, 1); + $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], 'Ваш реферал ' . $this->info['login'] . ' достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! (Ошибка зачисления, обратитесь с Администрации проекта) На Ваш банковский счет №' . $bnk . ' зачисленно ' . $ekr . ' кр.', -1, 6, 0, 0, 0, 1); } } // mysql_query("UPDATE `users` SET `referals` = `referals` + 5 WHERE `id` = '" . mysql_real_escape_string($rlog['id']) . "' LIMIT 1"); // } elseif (isset($rlog['id'])) { - $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], ' ' . $this->info['login'] . ' ' . $sex1 . ' ' . $lvl['nextLevel'] . '! ( , IP! 1 !)', -1, 6, 0, 0, 0, 1); + $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], 'Ваш реферал ' . $this->info['login'] . ' достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! (Персонаж не активирован, либо у вас совпадают IP! Разрешено не более 1 такого реферала!)', -1, 6, 0, 0, 0, 1); } } @@ -12439,7 +11928,7 @@ LIMIT 1')); /*if( $this->info['twink'] == 0 ) { if( $this->info['exp'] >= 300000 ) { - $this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],' /, : '.$lvl['money'].' .',-1,6,0,0,0,1); + $this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'За достижение нового уровня/аппа, Вы получаете: '.$lvl['money'].' кр.',-1,6,0,0,0,1); } }*/ @@ -12456,7 +11945,7 @@ LIMIT 1')); $this->info['nskills'] += $lvl['nskills']; if ($this->info['twink'] == 0) { //if( $this->info['level'] < 8 ) { - // 0-7 + //Выдаем за аппы зубы 0-7 лвл //$this->info['money4'] = $lvl['money']+$this->info['money4']; //}else{ $this->info['money'] = $lvl['money'] + $this->info['money']; @@ -12473,22 +11962,22 @@ LIMIT 1')); } if ($ult == 1) { if ($this->info['level'] == 4 || $this->info['level'] == 8) { - // + //Убрать задержки на пещеры mysql_query('DELETE FROM `actions` WHERE `uid` = "' . $this->info['id'] . '" AND `vars` LIKE "psh%"'); - $this->send('', $this->info['room'], $this->info['city'], '', $this->info['login'], ' !!!!!!!!!!!!!!!.', -1, 6, 0, 0, 0, 1); + $this->send('', $this->info['room'], $this->info['city'], '', $this->info['login'], 'Обязательно используйте свитки и эликсиры в своем инвентаре!!!!!!!!!!!!!!!.', -1, 6, 0, 0, 0, 1); } /*if( $this->info['level'] > 0 && $this->info['level'] <= 5 ) { $this->info['money4'] += 100; mysql_query('UPDATE `users` SET `money4` = "'.$this->info['money4'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - $this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],' '.$this->zuby(100,1).'',-1,6,0,0,0,1); + $this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'За достижение нового уровня вы получаете '.$this->zuby(100,1).'',-1,6,0,0,0,1); }*/ //if( isset($itm['id']) || $lvl['nextLevel'] != 6 ) { // - /*$txti = ''; + /*$txti = 'Достиг'; if( $this->info['sex'] == 1 ) { - $txti .= ''; + $txti .= 'ла'; } - $txti .= ' '.$this->info['level'].' !
'.date('d.m.Y H:i').''; + $txti .= ' '.$this->info['level'].' уровня!
'.date('d.m.Y H:i').''; // mysql_query('INSERT INTO `users_ico` ( `uid`,`time`,`text`,`img`,`type`,`x`,`see` @@ -12496,13 +11985,13 @@ LIMIT 1')); "'.$this->info['id'].'","'.time().'","'.$txti.'","pod_lvl'.$this->info['level'].'.gif","2","1","1" )');*/ // - $this->send('', $this->info['room'], $this->info['city'], '', '', '' . $this->info['login'] . ' ' . $sex1 . ' ' . $this->info['level'] . '!', time(), 6, 0, 0, 0, 1, 2); // + $this->send('', $this->info['room'], $this->info['city'], '', '', '' . $this->info['login'] . ' достиг' . $sex1 . ' уровня ' . $this->info['level'] . '!', time(), 6, 0, 0, 0, 1, 2); // Наверно тут //} } //mysql_query('UNLOCK TABLES'); if ($rt > 0) { if ($this->info['level'] >= 11) { - //$this->info['stopexp'] = 1; // + //$this->info['stopexp'] = 1; //Блокировка опыта $this->info['stopexp'] = 0; } else { $this->info['stopexp'] = 0; @@ -12520,7 +12009,7 @@ LIMIT 1')); } /*------------*/ if ($this->info['animal'] > 0) { - // + //уровень зверя $a = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `uid` = "' . $this->info['id'] . '" AND `id` = "' . $this->info['animal'] . '" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1')); if (isset($a['id']) && $a['level'] < 12) { $ea = [ @@ -12556,14 +12045,14 @@ LIMIT 1')); $iz = 0; while ($iz != -1) { if ($ea[$a['level'] + 1] <= $a['exp']) { - // + //поднимаем уровень $a['level']++; $a['max_exp'] = $mx[$a['level']]; } else { if ($iz > 0) { $a['stats'] = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`exp`,`level`,`stats`,`bonus` FROM `levels_animal` WHERE `type` = "' . $a['type'] . '" AND `level` = "' . $a['level'] . '" LIMIT 1')); $a['stats'] = $a['stats']['stats']; - $this->send('', $this->info['room'], $this->info['city'], '', $this->info['login'], '' . $a['name'] . ' ' . $a['level'] . ' !', time(), 6, 0, 0, 0, 1); + $this->send('', $this->info['room'], $this->info['city'], '', $this->info['login'], '' . $a['name'] . ' достиг ' . $a['level'] . ' уровня!', time(), 6, 0, 0, 0, 1); mysql_query('UPDATE `users_animal` SET `stats` = "' . $a['stats'] . '",`level`="' . $a['level'] . '",`max_exp`="' . $a['max_exp'] . '" WHERE `id` = "' . $a['id'] . '" LIMIT 1'); } $iz = -2; @@ -12606,29 +12095,29 @@ LIMIT 1')); //$btl = mysql_fetch_array(mysql_query('SELECT `id`,`time_start` FROM `battle` WHERE `id` = "'.$u['battle'].'" AND `team_win` = "-1" LIMIT 1')); } if ($u['battle'] == 0 || (isset($btl['id']) && $btl['time_start'] > $this->info['timereg'])) { - $sth = $u['minHP']; // HP - $stm = $u['minMP']; // MP - $sh = 0; // 1 . - $sm = 0; // M 1 . - /*---()---*/ + $sth = $u['minHP']; //Стандартное время восстановления в минутах HP + $stm = $u['minMP']; //Стандартное время восстановления в минутах MP + $sh = 0; //Скорость регенерации НР в 1 сек. + $sm = 0; //Скорость регенерации MР в 1 сек. + /*---Двужильный(Особенность)---*/ if (@$st['os9'] > 0) { if (@$st['os9'] == 5) { @$st['os9'] = 6; } $sth = floor($u['minHP'] - ($u['minHP'] / 100) * ($st['os9'] * 5)); } - /*---()---*/ - /*---()---*/ + /*---Двужильный(Особенность)---*/ + /*---Здравомыслящий(Особенность)---*/ if (@$st['os10'] > 0) { $stm = floor($u['minMP'] - ($u['minMP'] / 100) * ($st['os10'] * 5)); } - /*---()---*/ + /*---Здравомыслящий(Особенность)---*/ if ($u['battle'] > 0) { $this->info['timereg'] = $btl['time_start']; } - // - // + //Тестеры первой волны + //тесты боев $st['speedhp'] += 150; $st['speedmp'] += 150; @@ -12660,7 +12149,7 @@ LIMIT 1')); } elseif ($st['mpNow'] > $st['mpAll']) { $st['mpNow'] = $st['mpAll']; } - // + //Заносим новые данные в базу $upd = mysql_query('UPDATE `stats` SET `regHP`="' . time() . '",`regMP`="' . time() . '",`hpNow`="' . $st['hpNow'] . '",`mpNow`="' . $st['mpNow'] . '" WHERE `id` = "' . $u['id'] . '" LIMIT 1'); if (!$upd) { return [0 => 0, 1 => 0]; @@ -12676,14 +12165,14 @@ LIMIT 1')); } } - public function send_mime_mail($name_from, // - $email_from, // email - $name_to, // - $email_to, // email - $data_charset, // - $send_charset, // - $subject, // - $body // + public function send_mime_mail($name_from, // имя отправителя + $email_from, // email отправителя + $name_to, // имя получателя + $email_to, // email получателя + $data_charset, // кодировка переданных данных + $send_charset, // кодировка письма + $subject, // тема письма + $body // текст письма ) { $to = $this->mime_header_encode($name_to, $data_charset, $send_charset) @@ -12719,37 +12208,37 @@ LIMIT 1')); $po['toclan1'] = $po['toclan1'][0]; } if (isset($po['sudba']) && $po['sudba'] != '0') { - $r = '
'; + $r = 'Предмет связан с вами судьбой
'; } elseif (isset($po['toclan']) && $po['toclan1'] != $user['clan']) { - $r = ' ...
'; + $r = 'Предмет и так пренадлежит клану...
'; } elseif ($user['inTurnir'] > 0 || $user['inTurnirnew'] > 0) { - $r = ' .
'; + $r = 'Во время участия в турнире запрещено использовать клановое хранилище.
'; } else { if ((isset($po['sudba']) && $po['sudba'] != '0') || isset($po['icos']) || isset($po['frompisher']) || isset($po['fromlaba']) || ($item_['gift'] != '' && $item_['gift'] != 0)) { - $r = ' '; + $r = 'Не удалось'; } elseif (!isset($po['toclan'])) { $po['toclan'] = $user['clan'] . '#' . $user['id']; $item_['data'] = $this->impStats($po); if (mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "-21' . $user['clan'] . '", `data` = "' . $item_['data'] . '" WHERE `id` = "' . $id . '" LIMIT 1')) { - $r = ' "' . $item_['name'] . '"
'; + $r = 'Вы успешно пожертвовали предмет "' . $item_['name'] . '" клану
'; $col = $this->itemsX(((int)$id)); - $this->addDelo(2, $user['id'], '"System.transfer.MONEY": "' . $item_['name'] . '" (#id : "' . $id . '") (x' . $col . ') "' . $res['name'] . '" (' . $res['id'] . ').', time(), $user['city'], 'System.transfer.clan', 0, 0); - mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "4", "' . $user['login'] . '", "' . $item_['name'] . ' (x' . $col . ') : [' . $id . ']", "' . $user['id'] . '")'); + $this->addDelo(2, $user['id'], '"System.transfer.MONEY": Предмет "' . $item_['name'] . '" (#id : "' . $id . '") (x' . $col . ') был пожертвован клану "' . $res['name'] . '" (' . $res['id'] . ').', time(), $user['city'], 'System.transfer.clan', 0, 0); + mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "4", "' . $user['login'] . '", "' . $item_['name'] . ' (x' . $col . ') Ид : [' . $id . ']", "' . $user['id'] . '")'); } else { - $r = ' ...
'; + $r = 'Не удалось...
'; } } else { if (mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "-21' . $user['clan'] . '" WHERE `id` = "' . $id . '" LIMIT 1')) { $col = $this->itemsX(((int)$id)); - mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "3", "' . $user['login'] . '", "' . $item_['name'] . '" (x' . $col . ') : [' . $id . '], "' . $user['id'] . '")'); - $r = ' "' . $item_['name'] . '"
'; + mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "3", "' . $user['login'] . '", "' . $item_['name'] . '" (x' . $col . ') Ид : [' . $id . '], "' . $user['id'] . '")'); + $r = 'Вы успешно вернули предмет "' . $item_['name'] . '" в хранилище клана
'; } else { - $r = ' ...
'; + $r = 'Не удалось...
'; } } } } else { - $r = ' .
'; + $r = 'Предмет не найден.
'; } return $r; } @@ -12761,7 +12250,7 @@ LIMIT 1')); $res = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $cl . '" LIMIT 1')); $user_itm = mysql_fetch_array(mysql_query('SELECT `id`,`bot`,`clone` FROM `stats` WHERE `id` = "' . $itm_['uid'] . '" LIMIT 1')); if ($user_itm['bot'] > 0 || $user_itm['clone'] > 0 || !isset($user_itm['id'])) { - $r = ' ,
'; + $r = 'Вы не можете изьять данный предмет, он не принадлежит клану
'; } elseif (isset($itm_['id'])) { if ($user['inTurnir'] == 0 && $user['inTurnirnew'] == 0) { if ($itm_['inOdet'] != 0) { @@ -12769,15 +12258,15 @@ LIMIT 1')); } else { $o = ''; } - $r = ' "' . $itm_['name'] . '"
'; + $r = 'Вы успешно изъяли предмет "' . $itm_['name'] . '"
'; $col = $this->itemsX(((int)$id)); - mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "6", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') : [' . $id . '] | : [' . $itm_['uid'] . ']", "' . $user['id'] . '")'); + mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "6", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') Ид : [' . $id . '] | У персонажа : [' . $itm_['uid'] . ']", "' . $user['id'] . '")'); mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "-21' . $res['id'] . '" ' . $o . ' WHERE `id` = "' . $id . '" LIMIT 1'); } else { - $r = ' .
'; + $r = 'Во время участия в турнире запрещено использовать клановое хранилище.
'; } } else { - $r = ' .
'; + $r = 'Предмет не найден.
'; } return $r; } @@ -12794,14 +12283,14 @@ LIMIT 1')); } if ($user['inTurnir'] == 0 && $user['inTurnirnew'] == 0) { $col = $this->itemsX(((int)$id)); - mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "5", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') : [' . $id . '] : [' . $cls . ']", "' . $user['id'] . '")'); + mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "5", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') Ид : [' . $id . '] Хозяин : [' . $cls . ']", "' . $user['id'] . '")'); mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "' . $user['id'] . '" WHERE `id` = "' . $id . '" LIMIT 1'); - $r = ' "' . $itm_['name'] . '"
'; + $r = 'Вы успешно взяли предмет "' . $itm_['name'] . '" из хранилища
'; } else { - $r = ' .
'; + $r = 'Во время участия в турнире запрещено использовать клановое хранилище.
'; } } else { - $r = ' .
' . $id; + $r = 'Предмет не найден.
' . $id; } return $r; } @@ -12826,24 +12315,24 @@ LIMIT 1')); $col = $this->itemsX(((int)$pl['id'])); $it_n = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $pl['item_id'] . '"')); mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "' . $user['id'] . '", `data` = "' . $pl['data'] . '" WHERE `id` = "' . $pl['id'] . '"'); - mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "' . $type . '", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') : [' . $pl['id'] . ']", "' . $user['id'] . '")'); + mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "' . $type . '", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') Ид : [' . $pl['id'] . ']", "' . $user['id'] . '")'); } elseif ($cls != $user['id'] && $pl['uid'] == $user['id']) { $col = $this->itemsX(((int)$pl['id'])); $it_n = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $pl['item_id'] . '"')); mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "-21' . $user['clan'] . '" WHERE `id` = "' . $pl['id'] . '"'); - mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "9", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') : [' . $pl['id'] . ']", "' . $user['id'] . '")'); + mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "9", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') Ид : [' . $pl['id'] . ']", "' . $user['id'] . '")'); } } } - public function send_mail($to, $to_name, $from = 'support@new-combats.com', $name = ' 2', $title, $text) + public function send_mail($to, $to_name, $from = 'support@new-combats.com', $name = 'Бойцовский Клуб 2', $title, $text) { $this->send_mime_mail($name, $from, $to_name, $to, - 'CP1251', // , - 'KOI8-R', // , + 'CP1251', // кодировка, в которой находятся передаваемые строки + 'KOI8-R', // кодировка, в которой будет отправлено письмо $title, $text); // \r\n } diff --git a/inf.php b/inf.php index c8eda6fd..03a08e8e 100644 --- a/inf.php +++ b/inf.php @@ -18,39 +18,39 @@ $uplogin = $uplogin[0]; $uplogin = preg_replace('/%20/'," ",$uplogin); function utf8_win($s) { - $s=str_replace("%D0%B0","",$s); $s=str_replace("%D0%90","",$s); - $s=str_replace("%D0%B1","",$s); $s=str_replace("%D0%91","",$s); - $s=str_replace("%D0%B2","",$s); $s=str_replace("%D0%92","",$s); - $s=str_replace("%D0%B3","",$s); $s=str_replace("%D0%93","",$s); - $s=str_replace("%D0%B4","",$s); $s=str_replace("%D0%94","",$s); - $s=str_replace("%D0%B5","",$s); $s=str_replace("%D0%95","",$s); - $s=str_replace("%D1%91","",$s); $s=str_replace("%D0%81","",$s); - $s=str_replace("%D0%B6","",$s); $s=str_replace("%D0%96","",$s); - $s=str_replace("%D0%B7","",$s); $s=str_replace("%D0%97","",$s); - $s=str_replace("%D0%B8","",$s); $s=str_replace("%D0%98","",$s); - $s=str_replace("%D0%B9","",$s); $s=str_replace("%D0%99","",$s); - $s=str_replace("%D0%BA","",$s); $s=str_replace("%D0%9A","",$s); - $s=str_replace("%D0%BB","",$s); $s=str_replace("%D0%9B","",$s); - $s=str_replace("%D0%BC","",$s); $s=str_replace("%D0%9C","",$s); - $s=str_replace("%D0%BD","",$s); $s=str_replace("%D0%9D","",$s); - $s=str_replace("%D0%BE","",$s); $s=str_replace("%D0%9E","",$s); - $s=str_replace("%D0%BF","",$s); $s=str_replace("%D0%9F","",$s); - $s=str_replace("%D1%80","",$s); $s=str_replace("%D0%A0","",$s); - $s=str_replace("%D1%81","",$s); $s=str_replace("%D0%A1","",$s); - $s=str_replace("%D1%82","",$s); $s=str_replace("%D0%A2","",$s); - $s=str_replace("%D1%83","",$s); $s=str_replace("%D0%A3","",$s); - $s=str_replace("%D1%84","",$s); $s=str_replace("%D0%A4","",$s); - $s=str_replace("%D1%85","",$s); $s=str_replace("%D0%A5","",$s); - $s=str_replace("%D1%86","",$s); $s=str_replace("%D0%A6","",$s); - $s=str_replace("%D1%87","",$s); $s=str_replace("%D0%A7","",$s); - $s=str_replace("%D1%88","",$s); $s=str_replace("%D0%A8","",$s); - $s=str_replace("%D1%89","",$s); $s=str_replace("%D0%A9","",$s); - $s=str_replace("%D1%8A","",$s); $s=str_replace("%D0%AA","",$s); - $s=str_replace("%D1%8B","",$s); $s=str_replace("%D0%AB","",$s); - $s=str_replace("%D1%8C","",$s); $s=str_replace("%D0%AC","",$s); - $s=str_replace("%D1%8D","",$s); $s=str_replace("%D0%AD","",$s); - $s=str_replace("%D1%8E","",$s); $s=str_replace("%D0%AE","",$s); - $s=str_replace("%D1%8F","",$s); $s=str_replace("%D0%AF","",$s); + $s=str_replace("%D0%B0","а",$s); $s=str_replace("%D0%90","А",$s); + $s=str_replace("%D0%B1","б",$s); $s=str_replace("%D0%91","Б",$s); + $s=str_replace("%D0%B2","в",$s); $s=str_replace("%D0%92","В",$s); + $s=str_replace("%D0%B3","г",$s); $s=str_replace("%D0%93","Г",$s); + $s=str_replace("%D0%B4","д",$s); $s=str_replace("%D0%94","Д",$s); + $s=str_replace("%D0%B5","е",$s); $s=str_replace("%D0%95","Е",$s); + $s=str_replace("%D1%91","ё",$s); $s=str_replace("%D0%81","Ё",$s); + $s=str_replace("%D0%B6","ж",$s); $s=str_replace("%D0%96","Ж",$s); + $s=str_replace("%D0%B7","з",$s); $s=str_replace("%D0%97","З",$s); + $s=str_replace("%D0%B8","и",$s); $s=str_replace("%D0%98","И",$s); + $s=str_replace("%D0%B9","й",$s); $s=str_replace("%D0%99","Й",$s); + $s=str_replace("%D0%BA","к",$s); $s=str_replace("%D0%9A","К",$s); + $s=str_replace("%D0%BB","л",$s); $s=str_replace("%D0%9B","Л",$s); + $s=str_replace("%D0%BC","м",$s); $s=str_replace("%D0%9C","М",$s); + $s=str_replace("%D0%BD","н",$s); $s=str_replace("%D0%9D","Н",$s); + $s=str_replace("%D0%BE","о",$s); $s=str_replace("%D0%9E","О",$s); + $s=str_replace("%D0%BF","п",$s); $s=str_replace("%D0%9F","П",$s); + $s=str_replace("%D1%80","р",$s); $s=str_replace("%D0%A0","Р",$s); + $s=str_replace("%D1%81","с",$s); $s=str_replace("%D0%A1","С",$s); + $s=str_replace("%D1%82","т",$s); $s=str_replace("%D0%A2","Т",$s); + $s=str_replace("%D1%83","у",$s); $s=str_replace("%D0%A3","У",$s); + $s=str_replace("%D1%84","ф",$s); $s=str_replace("%D0%A4","Ф",$s); + $s=str_replace("%D1%85","х",$s); $s=str_replace("%D0%A5","Х",$s); + $s=str_replace("%D1%86","ц",$s); $s=str_replace("%D0%A6","Ц",$s); + $s=str_replace("%D1%87","ч",$s); $s=str_replace("%D0%A7","Ч",$s); + $s=str_replace("%D1%88","ш",$s); $s=str_replace("%D0%A8","Ш",$s); + $s=str_replace("%D1%89","щ",$s); $s=str_replace("%D0%A9","Щ",$s); + $s=str_replace("%D1%8A","ъ",$s); $s=str_replace("%D0%AA","Ъ",$s); + $s=str_replace("%D1%8B","ы",$s); $s=str_replace("%D0%AB","Ы",$s); + $s=str_replace("%D1%8C","ь",$s); $s=str_replace("%D0%AC","Ь",$s); + $s=str_replace("%D1%8D","э",$s); $s=str_replace("%D0%AD","Э",$s); + $s=str_replace("%D1%8E","ю",$s); $s=str_replace("%D0%AE","Ю",$s); + $s=str_replace("%D1%8F","я",$s); $s=str_replace("%D0%AF","Я",$s); return $s; } @@ -68,8 +68,6 @@ if(!isset($_GET['login'])) if(!isset($upLogin)){ $upLogin = ''; } - - $utf8Login = ''; $utf8Login2 = ''; @@ -95,24 +93,18 @@ if($uplogin == 'delete' || $utf8Login == 'delete' || $utf8Login2 == 'delete') { } } -/*if( $inf['id'] == 1000000 && $u->info['id'] != 1000000 ) { - die('

Can no longer open this page.

'); -}*/ - if(!isset($inf['id'])) { unset($inf); }else{ - if($inf['inTurnir'] > 0) { - //$inf['online'] = time(); - } + if(isset($_GET['restartmonster']) && $u->info['admin'] > 0) { mysql_query('UPDATE `stats` SET `res_x` = 0 WHERE `id` = "'.mysql_real_escape_string($inf['id']).'" LIMIT 1'); $inf['res_x'] = 0; } if($inf['haos']>1) { - // + //снимаем хаос if($inf['haos']info['admin'] == 0 ) { if(!isset($inf['id'])) { - die('. .'); + die('Ошибка. Персонаж не найден.'); die(' -

- :

   ...
-

+ Произошла ошибка

+ Произошла ошибка:

Указанный персонаж не найден...
+

Назад


© '.$c['title'].'

'.$c['counters'].' @@ -245,7 +237,7 @@ if($id_zodiak==null) $id_zodiak = 1; } -$name_zodiak = array(1=>'',2=>'',3=>'',4=>'',5=>'',6=>'',7=>'',8=>'',9=>'',10=>'',11=>'',12=>''); +$name_zodiak = array(1=>'Овен',2=>'Телец',3=>'Близнецы',4=>'Рак',5=>'Лев',6=>'Дева',7=>'Весы',8=>'Скорпион',9=>'Стрелец',10=>'Козерог',11=>'Водолей',12=>'Рыбы'); $name_zodiak = $name_zodiak[$id_zodiak]; function statInfo($s) @@ -440,8 +432,8 @@ if( $inf['inTurnir'] > 0 && ($u->info['inTurnir'] == $inf['inTurnir'] || $u->inf - <? echo $inf['login']; ?> - +Информация о <? echo $inf['login']; ?> + @@ -679,7 +671,7 @@ progress { var lafstReg = {}; function lookGift(e,id,nm,img,txt,from) { if(from == 1) { - from = ''; + from = 'Невидимка'; } if(!e) { e = window.event; } var body2 = document.body; @@ -689,10 +681,10 @@ function lookGift(e,id,nm,img,txt,from) { if(gf != undefined) { gf.style.top = mY+'px'; gf.style.left = mX+'px'; - if( from == '' ) { - from = ''; + if( from == 'Анонима' ) { + from = 'Анонима'; } - gf.innerHTML = `${nm}   X
${txt}`; + gf.innerHTML = `${nm}   X
${txt}
Подарок от ${from}
`; gf.innerHTML = `${gf.innerHTML}`; gf.style.display = ''; } @@ -708,13 +700,13 @@ function closeGift() { function tstlgnthm() { if( window.opener && ( window.opener.textmsg != undefined || window.opener.parent.textmsg != undefined ) ) { /* - + */ if( window.opener.textmsg != undefined ) { - $('#lgnthm').html( '' + $('#lgnthm').html() ); + $('#lgnthm').html( '' + $('#lgnthm').html() ); return } - $('#lgnthm').html( '' + $('#lgnthm').html() ); + $('#lgnthm').html( '' + $('#lgnthm').html() ); return } @@ -736,10 +728,10 @@ if(isset($uer)){ echo '
'.$uer.'getStats($inf['id'],1,0,true); $st2 = $st[1]; $st = $st[0]; //if( $u->info['admin'] > 0 ) { - // echo '
: '.$st['reting'].'
'; + // echo '
Мощность персонажа: '.$st['reting'].'
'; //} - $rgd = $u->regen($inf['id'],$st,1); $us = $u->getInfoPers($inf['id'],1,$st); if( isset($bs['id']) && $bs['type_btl'] == 2 && ($u->info['x'] != $inf['x'] || $u->info['y'] != $inf['y'])) { $us[0] = '








,
.






'; } if($us!=false){ echo $us[0]; }else{ echo 'information is lost.'; } ?>
+ $rgd = $u->regen($inf['id'],$st,1); $us = $u->getInfoPers($inf['id'],1,$st); if( isset($bs['id']) && $bs['type_btl'] == 2 && ($u->info['x'] != $inf['x'] || $u->info['y'] != $inf['y'])) { $us[0] = '








Информация скрыта,
Вы в разных комнатах.






'; } if($us!=false){ echo $us[0]; }else{ echo 'information is lost.'; } ?>
@@ -935,15 +913,15 @@ if( $onj > 6 && $inf['admin'] == 0 ) { $pr = $u->items['add']; $i = 0; $apbr = array( - ' '=>1, - ''=>1, - ' '=>1, - ' '=>1, - ' (HP)'=>1, - '. (%)'=>1, - '. '=>1, - ' (%)'=>1, - '. '=>1 + 'Защита от урона'=>1, + 'Сила'=>1, + 'Мастерство владения оружием'=>1, + 'Мастерство владения магией огня'=>1, + 'Уровень жизни (HP)'=>1, + 'Мф. критического удара (%)'=>1, + 'Мф. мощности магии огня'=>1, + 'Регенерация здоровья (%)'=>1, + 'Мф. мощности урона'=>1 ); while($i < count($pr)) { if($st[$pr[$i]] != 0 && $u->is[$pr[$i]] != '') { @@ -963,7 +941,7 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
-
+
Показать модификаторы
6 && $inf['admin'] == 0 ) { }else{ $nolog .= '
'.$u->microLogin($pl['id'],1); if( $nodell['inUser'] != $pl['id'] && $pl['id'] != $nodell['id'] ) { - $nolog .= ' ( )'; + $nolog .= ' (персонажа можно удалить)'; } if( $pl['id'] == $nodell['id'] ) { - $nolog .= ' ( )'; + $nolog .= ' (основной персонаж)'; } $nolog .= '
'; } } if( $nolog != '' ) { - $nolog = ' :'.$nolog.''; + $nolog = 'Копии персонажа:'.$nolog.''; echo $nolog; } } - ?>
:
- :
- :
- :
- 3 || $st['s5']!=0){ ?>:
- 6 || $st['s6']!=0){ ?>:
- 9 || $st['s7']!=0){ ?>:
- 11 || $st['s8']!=0){ ?>:
- 14 || $st['s9']!=0){ ?> :
- 19 || $st['s10']!=0){ ?>:
+ ?>
Сила:
+ Ловкость:
+ Интуиция:
+ Выносливость:
+ 3 || $st['s5']!=0){ ?>Интеллект:
+ 6 || $st['s6']!=0){ ?>Мудрость:
+ 9 || $st['s7']!=0){ ?>Духовность:
+ 11 || $st['s8']!=0){ ?>Воля:
+ 14 || $st['s9']!=0){ ?>Свобода духа:
+ 19 || $st['s10']!=0){ ?>Божественность:
0 ) { ?> - :
+ Энергия:
- :
+ Рейтинг сегодня:
- info['admin'] > 0 ) { echo ':'; }else{ echo ':'; } ?>
+ info['admin'] > 0 ) { echo 'Уровень:'; }else{ echo 'Уровень:'; } ?>
- : '.number_format($inf['win'], 0, ",", " ").''; } ?>
- :
- :
+ Побед: '.number_format($inf['win'], 0, ",", " ").''; } ?>
+ Поражений:
+ Ничьих:
- '; if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '
'; } ?> - '; if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '
'; } ?> + Орден Алхимиков'; if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '
'; } ?> + Орден Рекламного Развития'; if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '
'; } ?> 1 && $inf['align']<2){ echo ' - '.$u->mod_nm[1][$inf['align']]; if($inf['align']!='1.99' && $inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '
'; } - */ - /* - ?> - '; - if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } - echo '
'; - }elseif($inf['align']>3 && $inf['align']<4){ echo ' - '.$u->mod_nm[3][$inf['align']]; if($inf['align']!='3.99' && $inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '
'; } ?> - 0) { $pc = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id`="'.$inf['clan'].'" LIMIT 1')); @@ -1047,7 +1013,7 @@ if( $onj > 6 && $inf['admin'] == 0 ) { $pc['img'] = $pc['name_mini'].'.gif'; if($inf['clan_prava']=='glava') { - $inf['mod_zvanie'] = '- '; + $inf['mod_zvanie'] = '- Глава клана'; }elseif($inf['mod_zvanie']!='') { $inf['mod_zvanie'] = '- '.htmlspecialchars($inf['mod_zvanie'],NULL,'cp1251'); @@ -1058,31 +1024,30 @@ if( $onj > 6 && $inf['admin'] == 0 ) { $inf['mod_zvanie'] = str_replace('<i>','',$inf['mod_zvanie']); $inf['mod_zvanie'] = str_replace('</i>','',$inf['mod_zvanie']); } - echo ': '.$pc['name'].' '.$inf['mod_zvanie'].'
'; + echo 'Клан: '.$pc['name'].' '.$inf['mod_zvanie'].'
'; } } if( $inf['admin'] == 0 && ( ($inf['align'] > 1 && $inf['align'] < 2) || ($inf['align'] > 3 && $inf['align'] < 4) ) ) { - echo '
'; + echo 'Орден Модераторов
'; } ?> - - '.$u->city_name[$inf['city2']].'
'; } ?> - :
+ '.$u->city_name[$inf['city2']].'
'; } ?> + День рождения персонажа:
time() && true == false ) { ?> - :
+ Персонаж чист перед законом: до

'; + echo 'Администратор
'; } if($inf['redirect'] != '0' && ($u->info['admin'] > 0 || $u->info['id'] == $inf['id'])) { - echo ': '.htmlspecialchars($inf['redirect']).'
'; + echo 'Редирект: '.htmlspecialchars($inf['redirect']).'
'; } if( $u->info['admin'] > 0 ) { - echo '
: '.(0+$st['prckr']).' .
'; - echo ' : '.(0+$st['preckr']).' e.
'; - echo ' : '.(0+$st['pbe']).'
'; + echo '
Цена комплекта: '.(0+$st['prckr']).' кр.
'; + echo 'Цена комплекта: '.(0+$st['preckr']).' eкр.
'; + echo 'Уровень покупателя: '.(0+$st['pbe']).'
'; } ?> 6 && $inf['admin'] == 0 ) { } } if( $twk != '' ) { - echo ' : '.$twk.'
'; + echo 'Другие образы: '.$twk.'
'; } ?> 0 LIMIT 1')); if ($pk[0]>0) { - echo ' : '.$pk[0].'
'; + echo 'Персонаж покупал еврокредиты на сумму : '.$pk[0].' ЕКР
'; } - // + //История имен $names = ''; $sp = mysql_query('SELECT * FROM `lastnames` WHERE `uid` = "'.$inf['id'].'" ORDER BY `time` DESC'); $i = 0; @@ -1118,47 +1083,47 @@ if( $onj > 6 && $inf['admin'] == 0 ) { { $names .= '                      '; } - $names .= '\''.$pl['login'].'\' '.date('d.m.Y H:i',$pl['time']).'
'; + $names .= '\''.$pl['login'].'\' до '.date('d.m.Y H:i',$pl['time']).'
'; $i++; } if($names!='') { - echo ' : '.$names.''; + echo 'История имен: '.$names.''; } $algnt = mysql_fetch_array(mysql_query('SELECT * FROM `users_align` WHERE `uid` = "'.$inf['id'].'" AND (`delete` = 0 OR `delete` > "'.time().'") LIMIT 1')); if(isset($algnt['id'])) { if($algnt['align'] == 1) { - echo '
: '; + echo '
Выбранная сторона: Свет'; if( $algnt['delete'] > 0 ) { - echo ' ( '.date('d.m.Y H:i',$algnt['delete']).')'; + echo ' (до '.date('d.m.Y H:i',$algnt['delete']).')'; } echo '
'; }elseif($algnt['align'] == 3) { - echo '
: '; + echo '
Выбранная сторона: Тьма'; if( $algnt['delete'] > 0 ) { - echo ' ( '.date('d.m.Y H:i',$algnt['delete']).')'; + echo ' (до '.date('d.m.Y H:i',$algnt['delete']).')'; } echo '
'; }elseif($algnt['align'] == 7) { - echo '
: '; + echo '
Выбранная сторона: Нейтрал'; if( $algnt['delete'] > 0 ) { - echo ' ( '.date('d.m.Y H:i',$algnt['delete']).')'; + echo ' (до '.date('d.m.Y H:i',$algnt['delete']).')'; } echo '
'; } } if( $st['silver'] > 0 ) { echo '
'; - echo ' : '; + echo 'Благословление Ангелов: '; echo '
'; } if($inf['win_t'] > 0) { ?>
- :
- :
- + Побед в турнирах:
+ Поражений в турнирах:
+
6 && $inf['admin'] == 0 ) { }else{ $bnk .= '
'; } - $bnk .= '  • '.$pl['id'].''; + $bnk .= '  • '.$pl['id'].''; $bnk .= '
'; } if($bnk != '') { - echo '
:  '.$bnk.'
'; + echo '
Банковские счета:  '.$bnk.'
'; } echo '
'; } ?>
- +
' . $witm[53] . '
6 && $inf['admin'] == 0 ) { { $abnk = mysql_fetch_array(mysql_query('SELECT * FROM `bank_alh` WHERE `uid` = "'.$inf['id'].'" LIMIT 1')); ?> - + 6 && $inf['admin'] == 0 ) { $mrtxt = ''; if($inf['sex']==0) { - $mrtxt = ' '; + $mrtxt = 'Женат на'; }else{ - $mrtxt = ' '; + $mrtxt = 'Замужем за'; } $ico[1] .= ''; } - } - - - // - /*$uref = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `users` WHERE `host_reg` = "'.$inf['id'].'" AND `level` > 0 LIMIT 1000')); - $uref = $uref[0]; - if($uref>9) - { - $rico = 0; - if($uref>=30){ $rico = 19; - }elseif($uref>=20){ $rico = 20; - }elseif($uref>=10){ $rico = 21; } - - if($rico>0) - { - $stp = array(21=>'XXI
', - 20=>'XX
', - 19=>'IXX
'); - echo ''; - } } - */ $sp = mysql_query('SELECT * FROM `users_ico` WHERE `uid` = "'.$inf['id'].'" AND (`endTime` = 0 OR `endTime` > '.time().') LIMIT 100'); while($pl = mysql_fetch_array($sp)) @@ -1258,167 +1202,155 @@ if( $onj > 6 && $inf['admin'] == 0 ) { if($inf['vip']==1) { - $ico[1] .= ' '; + $ico[1] .= ' '; } - // + //сильвер if($st['silver']>0) { - $ico[1] .= ' '; + $ico[1] .= ' '; } - - // - /*if($st['naemnik']>0) { - echo ' '; - }*/ - - /*if($inf['activ'] == 0) { - echo ''; - }*/ - - // - + $irep = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "'.$inf['id'].'" LIMIT 1')); if(isset($irep['id'])) { - // + //Водосток if($irep['repdreamscity']>9999) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($irep['repdreamscity']>4999) { - $ico[1] .= ''; + $ico[1] .= ''; } elseif($irep['repdreamscity']>999) { - $ico[1] .= ''; + $ico[1] .= ''; } - // + //Храм знаний if($irep['rep1']>9999) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($irep['rep1']>999) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($irep['rep1']>99) { - $ico[1] .= ''; + $ico[1] .= ''; } - // + //Алтарь крови if($irep['rep2']>99) { - $ico[1] .= ''; + $ico[1] .= ''; } - // + //Излом хаоса if($irep['repizlom']>24999) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($irep['repizlom']>9999) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($irep['repizlom']>999) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($irep['repizlom']>99) { - $ico[1] .= ''; + $ico[1] .= ''; } //capitalcity if($irep['repcapitalcity']>24999) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($irep['repcapitalcity']>9999) { - $ico[1] .= ''; + $ico[1] .= ''; } //angelscity if($irep['repangelscity']>24999) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($irep['repangelscity']>9999) { - $ico[1] .= ''; + $ico[1] .= ''; } //demonscity if($irep['repdemonscity']>24999) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($irep['repdemonscity']>9999) { - $ico[1] .= ''; + $ico[1] .= ''; } //devilscity if($irep['repdevilscity']>24999) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($irep['repdevilscity']>9999) { - $ico[1] .= ''; + $ico[1] .= ''; } //suncity if($irep['repsuncity']>24999) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($irep['repsuncity']>9999) { - $ico[1] .= ''; + $ico[1] .= ''; } - // ( ) by R + //Гора легиона (сука как она меня заебала) by R if($irep['repabandonedplain']>9999) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($irep['repabandonedplain']>999) { - $ico[1] .= ''; + $ico[1] .= ''; } //emeraldscity if($irep['repemeraldscity']>24999) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($irep['repemeraldscity']>9999) { - $ico[1] .= ''; + $ico[1] .= ''; } //sandcity if($irep['repsandcity']>24999) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($irep['repsandcity']>9999) { - $ico[1] .= ''; + $ico[1] .= ''; } //mooncity if($irep['repmooncity']>24999) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($irep['repmooncity']>9999) { - $ico[1] .= ''; + $ico[1] .= ''; } - if($inf['referals'] >= 3000) // + if($inf['referals'] >= 3000) // значок за рефов { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($inf['referals'] > 1500) { - $ico[1] .= ''; + $ico[1] .= ''; }elseif($inf['referals'] > 600) { - $ico[1] .= ''; + $ico[1] .= ''; } } - - $ai=$u->achivInf($inf['id']); // $ico[3] + $ai = (new Achievements($u))->getInfo(); //Титулы $ico[3] if(isset($ai['id']) && $inf['banned']==0 && ($ai['zb']>0 || $ai['vx']>0 || $ai['snt']>0 || $ai['rp']>0 || $ai['rn']>0 || $ai['rb']>0 || $ai['pg']>0 || $ai['bv']>0 || $ai['kw']>0 || $ai['pa']>0)) { @@ -1426,75 +1358,52 @@ if( $onj > 6 && $inf['admin'] == 0 ) { $ico[3].='
'; if ($ai['zb']>0) { - $ico[3].='
'.$ai['namezb'].'.
'.$ai['klaszb'].' :
'.$ai['namezb'].'
'; + $ico[3].='
'.$ai['namezb'].'.
Ранг '.$ai['klaszb'].' :
'.$ai['namezb'].'
'; } if ($ai['vx']>0) { - $ico[3].='
'.$ai['namevx'].'.
'.$ai['klasvx'].' :
'.$ai['namevx'].'
'; + $ico[3].='
'.$ai['namevx'].'.
Ранг '.$ai['klasvx'].' :
'.$ai['namevx'].'
'; } if ($ai['snt']>0) { - $ico[3].='
'.$ai['namesnt'].'.
'.$ai['klassnt'].' :
'.$ai['namesnt'].'
'; + $ico[3].='
'.$ai['namesnt'].'.
Ранг '.$ai['klassnt'].' :
'.$ai['namesnt'].'
'; } if ($ai['rp']>0) { - $ico[3].='
'.$ai['namerp'].'.
'.$ai['klasrp'].' :
'.$ai['namerp'].'
'; + $ico[3].='
'.$ai['namerp'].'.
Ранг '.$ai['klasrp'].' :
'.$ai['namerp'].'
'; } if ($ai['rn']>0) { - $ico[3].='
'.$ai['namern'].'.
'.$ai['klasrn'].' :
'.$ai['namern'].'
'; + $ico[3].='
'.$ai['namern'].'.
Ранг '.$ai['klasrn'].' :
'.$ai['namern'].'
'; } if ($ai['rb']>0) { - $ico[3].='
'.$ai['namerb'].'.
'.$ai['klasrb'].' :
'.$ai['namerb'].'
'; + $ico[3].='
'.$ai['namerb'].'.
Ранг '.$ai['klasrb'].' :
'.$ai['namerb'].'
'; } if ($ai['pg']>0) { - $ico[3].='
'.$ai['namepg'].'.
'.$ai['klaspg'].' :
'.$ai['namepg'].'
'; + $ico[3].='
'.$ai['namepg'].'.
Ранг '.$ai['klaspg'].' :
'.$ai['namepg'].'
'; } if ($ai['bv']>0) { - $ico[3].='
'.$ai['namebv'].'.
'.$ai['klasbv'].' :
'.$ai['namebv'].'
'; + $ico[3].='
'.$ai['namebv'].'.
Ранг '.$ai['klasbv'].' :
'.$ai['namebv'].'
'; } if ($ai['kw']>0) { - $ico[3].='
'.$ai['namekw'].'.
'.$ai['klaskw'].' :
'.$ai['namekw'].'
'; + $ico[3].='
'.$ai['namekw'].'.
Ранг '.$ai['klaskw'].' :
'.$ai['namekw'].'
'; } if ($ai['pa']>0) { - $ico[3].='
'.$ai['namepa'].'.
'.$ai['klaspa'].' :
'.$ai['namepa'].'
'; + $ico[3].='
'.$ai['namepa'].'.
Ранг '.$ai['klaspa'].' :
'.$ai['namepa'].'
'; } if ($ai['bs']>0) { - $ico[3].='
'.$ai['namebs'].'.
'.$ai['klasbs'].' :
'.$ai['namebs'].'
'; + $ico[3].='
'.$ai['namebs'].'.
Ранг '.$ai['klasbs'].' :
'.$ai['namebs'].'
'; } $ico[3].='
'; } - // - /* if($inf['win_t']>99) - { - $ico[2] .= ''; - }elseif($inf['win_t']>89) - { - $ico[2] .= ''; - }elseif($inf['win_t']>69) - { - $ico[2] .= ''; - }elseif($inf['win_t']>39) - { - $ico[2] .= ''; - }elseif($inf['win_t']>29) - { - $ico[2] .= ''; - }elseif($inf['win_t']>19) - { - $ico[2] .= ''; - }elseif($inf['win_t']>9) - { - $ico[2] .= ''; - }*/ - + function timeOut($ttm,$travm=false) { if($travm==false){ @@ -1505,35 +1414,35 @@ if( $onj > 6 && $inf['admin'] == 0 ) { if ($tmp > 0) { $id++; - if ($id<3) {$out .= $tmp." . ";} + if ($id<3) {$out .= $tmp." мес. ";} $time_still = $time_still-$tmp*2592000; } $tmp = floor($time_still/604800); if ($tmp > 0) { $id++; - if ($id<3) {$out .= $tmp." . ";} + if ($id<3) {$out .= $tmp." нед. ";} $time_still = $time_still-$tmp*604800; } $tmp = floor($time_still/86400); if ($tmp > 0) { $id++; - if ($id<3) {$out .= $tmp." . ";} + if ($id<3) {$out .= $tmp." дн. ";} $time_still = $time_still-$tmp*86400; } $tmp = floor($time_still/3600); if ($tmp > 0) { $id++; - if ($id<3) {$out .= $tmp." . ";} + if ($id<3) {$out .= $tmp." ч. ";} $time_still = $time_still-$tmp*3600; } $tmp = floor($time_still/60); if ($tmp > 0) { $id++; - if ($id<3) {$out .= $tmp." . ";} + if ($id<3) {$out .= $tmp." мин. ";} } if($out=='') { @@ -1541,65 +1450,53 @@ if( $onj > 6 && $inf['admin'] == 0 ) { { $time_still = 0; } - $out = $time_still.' .'; + $out = $time_still.' сек.'; } - }else{ } return $out; } if( $ico[1] != '' ) { - //echo '
'; - //echo '
:
'; - echo ''.$ico[1]; - //echo '
'; + echo $ico[1]; } echo ''; if($inf['jail']>time()) { - echo '
'.timeOut($inf['jail']-time()).' '; + echo '
Персонаж находится в заточении еще '.timeOut($inf['jail']-time()).' '; } if(isset($st['puti'])) { - echo '
'.timeOut($st['puti']-time()).' '; + echo '
Персонаж не может передвигаться еще '.timeOut($st['puti']-time()).' '; } if($inf['molch1']>time()) { - echo '
. '.timeOut($inf['molch1']-time()).' '; + echo '
На персонажа наложено заклятие молчания. Будет молчать еще '.timeOut($inf['molch1']-time()).' '; } if($inf['molch2']>time()) { - echo '
. '.timeOut($inf['molch2']-time()).' '; + echo '
На персонажа наложено заклятие молчания на форуме. Будет молчать еще '.timeOut($inf['molch2']-time()).' '; } if($inf['clan_delay']>time()) { - echo '
: '.timeOut($inf['clan_delay']-time()).' '; + echo '
У персонажа запрет на вступление в кланы ещё: '.timeOut($inf['clan_delay']-time()).' '; } if($inf['info_delete'] > time() || $inf['info_delete'] == 1) { - echo '
.'; + echo '
На персонажа наложено заклятие обезличивания.'; if( $inf['info_delete'] > 1 ) { - echo ' '.timeOut($inf['info_delete']-time()).''; + echo ' Будет обезличен еще '.timeOut($inf['info_delete']-time()).''; } } - /*if($inf['banned'] > 0) - { - echo '
.'; - if( $inf['info_delete'] > 1 ) { - echo ' '.timeOut($inf['info_delete']-time()).''; - } - }*/ - // , . . + + //Если у персонажа есть травмы, физ. и маг. травмы $sp = mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$inf['id'].'" AND (`id_eff` = "4" OR `id_eff` = "6") AND `delete` = "0" ORDER BY `id_eff` ASC LIMIT 6'); while($pl = mysql_fetch_array($sp)) { - //$pln = array(); - //$pln = array(0=>$pln[0],1=>$pln[1]); - echo '
- "'.$pl['name'].'" '.$u->timeOut($pl['timeUse']-time()+$pl['timeAce']); + echo '
У персонажа - "'.$pl['name'].'" еще '.$u->timeOut($pl['timeUse']-time()+$pl['timeAce']); } - // - , 4 . 24 . + //Персонаж ослаблен из-за смерти в бою, еще 4 мин. 24 сек. if($inf['level']>=4) { $nn = 0; @@ -1609,7 +1506,7 @@ if( $onj > 6 && $inf['admin'] == 0 ) { { $osl = mysql_fetch_array(mysql_query('SELECT `id2`,`actionTime` FROM `eff_main` WHERE `id2` = "5" LIMIT 1')); - echo '
- , '.timeOut($st['effects'][$nn]['timeUse']+$st['effects'][$nn]['timeAce']+$osl['actionTime']-time()).' '; + echo '
Персонаж ослаблен из-за смерти в бою, еще '.timeOut($st['effects'][$nn]['timeUse']+$st['effects'][$nn]['timeAce']+$osl['actionTime']-time()).' '; $nn = count($st['effects'])+1; } $nn++; @@ -1617,34 +1514,11 @@ if( $onj > 6 && $inf['admin'] == 0 ) { } echo '
'; - - /*$ugon = mysql_query('SELECT `id` FROM `stats` WHERE `bot` = 0 ORDER BY `exp` DESC LIMIT 3'); - $igon = 0; - $igon2 = 0; - while( $plugo = mysql_fetch_array($ugon)) { - $igon++; - if( $plugo['id'] == $inf['id'] ) { - $igon2 = $igon; - } - } - - if( $igon2 == 3 ) { - $ico[3] = ''.$ico[3]; - } - if( $igon2 == 2 ) { - $ico[3] = ''.$ico[3]; - } - if( $igon2 == 1 ) { - $ico[3] = ''.$ico[3]; - }*/ - + if( $ico[3] != '' ) { - echo '
:
'.$ico[3].'
'; - } - - if( $ico[2] != '' ) { - //echo '
:
'.$ico[2].'
'; + echo '
Достижения персонажа:
'.$ico[3].'
'; } + unset($ico); if(($inf['align']>=2 && $inf['align'] < 3 && ($inf['haos']>time() || $inf['haos']==1)) || $inf['banned']>0 || $inf['jail']>time()) @@ -1652,78 +1526,71 @@ if( $onj > 6 && $inf['admin'] == 0 ) { $to = ''; if($inf['align']>=2 && $inf['align'] < 3 && ($inf['haos']>time() || $inf['haos']==1)) { - $to = ''; + $to = 'хаос'; } if($inf['banned']>0) { if($to='') { - $to = ''; + $to = 'блок'; }else{ - $to = $to.'/'; + $to = $to.'/блок'; } } $fm = mysql_fetch_array(mysql_query('SELECT `id`,`hb`,`text` FROM `users_delo` WHERE `uid` = "'.$inf['id'].'" AND `hb`!=0 ORDER BY `id` DESC LIMIT 1')); echo '
'; if(isset($fm['id'])) { - $from = ''; + $from = 'паладинов'; if($fm['hb']==2) { - $from = ''; + $from = 'Ангелов'; }elseif($fm['hb']==3) { - $from = ''; + $from = 'тарманов'; } - //echo ' '.$from.' '.$to.':
'; - echo ' :
'; - //$fm['text'] = ltrim($fm['text']," \"\;".$fm['login']."\"\; \\<\/b\>\:"); + echo 'Сообщение от модераторов:
'; echo ''.$fm['text'].'
'; } if($inf['align']>=2 && $inf['align'] < 3 && ($inf['haos']>time() || $inf['haos']==1)) { if($inf['haos']==1) { - echo ' .'; + echo 'Хаос бессрочно.'; }else{ - echo ' '.timeOut($inf['haos']-time()).''; + echo 'Хаос еще '.timeOut($inf['haos']-time()).''; } } echo '
'; } - // + //подарки if(($inf['info_delete']info['align']>1 && $u->info['align']<2 || $u->info['align']>3 && $u->info['align']<4 || $u->info['admin']>0 || $u->info['nadmin']>0)){ $gs = array('','',''); $glim = 1000; $i = 0; - //$_GET['maxgift']=1; - if(isset($_GET['maxgift'])) - { - $glim = 1000; - } $ij1 = 1; $sp = mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE (`im`.`type` = "38" OR `im`.`type` = "64" OR `iu`.`data` LIKE "%|giftsee=1%") AND `iu`.`uid` = "'.$inf['id'].'" AND `iu`.`gift` != "" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" ORDER BY `iu`.`id` DESC LIMIT '.$glim); while($pl = mysql_fetch_array($sp)) { - if(stristr($pl['data'], 'gift_id') == true) { + if(stristr($pl['data'], 'gift_id')) { $po = $u->lookStats($pl['data']); $pl_gift = $po['gift_id']; if( $pl_gift > 0 ) { $pl_gift = mysql_fetch_array(mysql_query('SELECT `name`,`img`,`id` FROM `users_gifts` WHERE `id` = "'.mysql_real_escape_string($pl_gift).'" LIMIT 1')); if( isset($pl_gift['id']) ) { - // + //Именной подарок $pl['name'] = $pl_gift['name']; $pl['img'] = $pl_gift['img']; } } } - // + //подарки if( $pl['gift'] == 1 ) { - $pl['gift2'] = ''; + $pl['gift2'] = 'Невидимка'; }else{ $pl['gift2'] = $pl['gift']; } $gs[0] .= ''; +Подарок от '.$pl['gift2'].'" />'; $ij1++; } $ij2 = 1; @@ -1731,14 +1598,14 @@ if( $onj > 6 && $inf['admin'] == 0 ) { while($pl = mysql_fetch_array($sp)) { //if($pl['type'] == 63 || $pl['type'] == 37) { - // + //открытки if( $pl['gift'] == 1 ) { - $pl['gift2'] = ''; + $pl['gift2'] = 'Невидимка'; }else{ $pl['gift2'] = $pl['gift']; } $gs[1] .= ''; +Подарок от '.$pl['gift2'].'" />'; //} $ij2++; } @@ -1747,30 +1614,30 @@ if( $onj > 6 && $inf['admin'] == 0 ) { while($pl = mysql_fetch_array($sp)) { if($pl['type'] == 28) { - // + //Букеты if( $pl['gift'] == 1 ) { - $pl['gift2'] = ''; + $pl['gift2'] = 'Невидимка'; }else{ $pl['gift2'] = $pl['gift']; } $gs[2] .= ''; +Подарок от '.$pl['gift2'].'" />'; } $ij3++; } if($gs[0]!='' || $gs[1]!='' || $gs[2]!=''){ if($gs[2] != '') { - $gs[2] = '
:

'.$gs[2].''; + $gs[2] = '
Букеты:

'.$gs[2].''; } - echo '

'.$gs[2].'
:

'.$gs[0].'
'.$gs[1].'
'; + echo '

'.$gs[2].'
Подарки:

'.$gs[0].'
'.$gs[1].'
'; $ij4 = mysql_fetch_array(mysql_query('SELECT COUNT(`iu`.`id`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE (`im`.`type` = 28 OR `im`.`type` = 63 OR `im`.`type` = 38 OR `im`.`type` = 64 OR `im`.`type` = 37 OR `iu`.`data` LIKE "%|giftsee=1%" OR `iu`.`data` LIKE "%|giftsee=2%") AND `iu`.`uid` = "'.$inf['id'].'" AND `iu`.`gift` != "" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" LIMIT 1')); $ij4 = $ij4[0]; if($ij1+$ij2+$ij3 < $ij4) { if(!isset($_GET['maxgift'])){ - echo ' , ...'; + echo 'Нажмите сюда, чтобы увидеть все подарки...'; }else{ - echo ' , '; + echo 'Нажмите сюда, чтобы скрыть подарки'; } } } @@ -1893,72 +1760,72 @@ if( $onj > 6 && $inf['admin'] == 0 ) { WHERE `id` = "'.mysql_real_escape_string($monster['id']).'" LIMIT 1'); } - echo ' !'; + echo 'Новые данные были успешно сохранены!'; } ?> - :
+ Параметры монстра:
- - + - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
(id ): + Место появления (id комнаты): -   +  
: .Время ожидания после поражения бота: мин.
: + Исчезнет после своей победы:
, - + Появляется, + ДН - + Д - + М - + Ч - + Мин
,     + Исчезает,    ДН - + Д - + М - + Ч - + Мин
( {b}, {u}):Текст появления (Логин бота {b}, Логины игроков {u}):
:Текст исчезновения:
:Текст победы игрока:
:Текст поражения игрока:
:Текст ничьей:
( ):
Награда (победа игрока):
.: Кр.:
.: Екр.:
( 100% ): Опыт (За 100% НР монстра):
(id@kolvo@data, ...):Предметы (id@kolvo@data, ...):
:Эффект:
:Подвиги:
( ):
Награда (поражение игрока):
.: Кр.:
.: Екр.:
: Опыт:
:Предметы:
:Эффект:
:Подвиги:
- +


-
+
Скрыть
-
+
Настройка монстра
info['align']>=1.1 && $u->info['align']<=1.99 && $inf['admin']<1) || ($u->info['align']>=3.05 && $u->info['align']<=3.99 && $inf['admin']<1) || $u->info['admin']>0 || $u->info['nadmin']>0)) @@ -2172,17 +2039,17 @@ if( $onj > 6 && $inf['admin'] == 0 ) { } } - if( $nopal == true ) { - //echo '

...

'; + if($nopal) { + //echo '

Вы не можете просматривать информацию старшего по званию...

'; } elseif ($u->info['admin']==0 && (($u->info['admin']==0 && (floor($u->info['align'])==1 && $inf['align']>=3.01 && $inf['align']<=3.99) || (floor($u->info['align'])==3 && $inf['align']>=1.1 && $inf['align']<=1.99)) || ($u->info['admin']==0 && $inf['admin']>0))) { - echo '

...

'; + echo '

Персонаж носит вражескую склонность...

'; }else{ - echo '

:
'; + echo '

За игроком замечены следующие темные делишки:
'; if(!isset($_GET['mod_inf'])) { - echo ' '; + echo 'Показать личное дело'; }else{ - // + //Личное дело персонажа $log = mysql_query('SELECT * FROM `users_delo` WHERE `uid`="'.$inf['id'].'" AND `type`="0" ORDER by `id` DESC LIMIT 21'); $i = 0; while ($log_w = mysql_fetch_array($log)) @@ -2190,39 +2057,25 @@ if( $onj > 6 && $inf['admin'] == 0 ) { echo ''.date("d.m.Y H:i:s",$log_w['time']).' '.$log_w['text'].'
'; $i++; } - echo ' '; + echo 'Скрыть личное дело'; } echo '

'; - // \\ + //Информация для паладинов\тарманов\ангелов if(($u->info['align']>=1.4 && $u->info['align']<=1.99 && $u->info['align']!=1.6 && $u->info['align']!=1.75 && $inf['admin']<1) || ($u->info['align']>=3.05 && $u->info['align']<=3.99 && $u->info['align']!=3.06 && $inf['admin']<1) || $u->info['admin']>0) { if ((int)$u->info['align']==1) { - $rang = ''; + $rang = 'Паладинов'; } elseif ((int)$u->info['align']==3) { - $rang = ''; + $rang = 'Тарманов'; } else { - $rang = ''; + $rang = 'Ангелов'; } - - /* - $pr1 = mysql_fetch_array(mysql_query('SELECT * FROM `register_code` WHERE `reg_id` = "'.$inf['id'].'" LIMIT 1')); - $pr = array('login'=>''); - if(isset($pr1['id'])) - { - $pr = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level` FROM `users` WHERE `id` = "'.$pr1['uid'].'" LIMIT 1')); - if(isset($pr['id'])) - { - $pr['login'] = ' : '.$pr['login'].' ['.$pr['level'].']
'; - }else{ - $pr['login'] = ' : #'.$pr1['uid'].'
'; - } - } - */ + if($u->info['admin'] == 1) { - echo ': '.$inf['room'].'
'; + echo 'Комната: '.$inf['room'].'
'; } if((int)$inf['host_reg'] >= 1){ $inf['ref'] = $u->microLogin((int)$inf['host_reg'],1); @@ -2232,11 +2085,11 @@ if( $onj > 6 && $inf['admin'] == 0 ) { if(!isset($inf['ipReg'])){ $inf['ipReg'] = '--'; } echo '
- '.$rang.'
- : '.$inf['bithday'].'
'; + Только для '.$rang.'
+ День рождения: '.$inf['bithday'].'
'; if($inf['vip']==1) { - echo 'VIP
'; + echo 'VIP персонаж
'; } if($u->info['admin'] > 0) { @@ -2246,7 +2099,7 @@ if( $onj > 6 && $inf['admin'] == 0 ) { $mls = mysql_fetch_array(mysql_query('SELECT * FROM `users_rbk` WHERE `email` = "'.mysql_real_escape_string($inf['mail']).'" LIMIT 1')); if(isset($mls['name'])) { - echo 'E-mail: '.$inf['mail'].' ()'; + echo 'E-mail: '.$inf['mail'].' (РАССЫЛКА)'; }else{ echo 'E-mail: '.$inf['mail'].''; } @@ -2258,9 +2111,9 @@ if( $onj > 6 && $inf['admin'] == 0 ) { } }else{ if( $inf['activ'] == 0 ) { - echo ' '; + echo 'Персонаж активирован'; }else{ - echo ' '; + echo 'Персонаж не активирован'; } echo '
'; } @@ -2268,50 +2121,50 @@ if( $onj > 6 && $inf['admin'] == 0 ) { $inf['ipReg'] = $inf['no_ip']; $inf['ip'] = $inf['no_ip']; } - echo ' : '.$inf['ref'].'
- : '.date('d.m.Y H:i',$inf['online']).'
- '.$pr['login'].'IP : '.$inf['ipReg'].'
'; + echo 'Персонажа пригласили: '.$inf['ref'].'
+ Последний раз заходил в клуб: '.date('d.m.Y H:i',$inf['online']).'
+ '.$pr['login'].'IP при регистрации: '.$inf['ipReg'].'
'; if($inf['no_ip'] == '' || $u->info['admin']>0) { - echo 'IP : '.$inf['ip'].''; + echo 'IP последние: '.$inf['ip'].''; $auth = mysql_query('SELECT * FROM `logs_auth` WHERE `uid`="'.$inf['id'].'" AND `type`="1" ORDER by `id` DESC LIMIT 10'); $country = ''; while ($auth_w = mysql_fetch_array($auth)) { echo '
'.$auth_w['ip'].' ('.date('d.m.Y H:i',$auth_w['time']).')'; } }else{ - echo 'IP : '.$inf['no_ip'].''; + echo 'IP последние: '.$inf['no_ip'].''; } function user_browser($agent) { - preg_match("/(MSIE|Opera|Firefox|Chrome|Version|Opera Mini|Netscape|Konqueror|SeaMonkey|Camino|Minefield|Iceweasel|K-Meleon|Maxthon)(?:\/| )([0-9.]+)/", $agent, $browser_info); // , 90% - list(,$browser,$version) = $browser_info; // - if (preg_match("/Opera ([0-9.]+)/i", $agent, $opera)) return 'Opera '.$opera[1]; // ___ ( 8.50), - if ($browser == 'MSIE') { // IE - preg_match("/(Maxthon|Avant Browser|MyIE2)/i", $agent, $ie); // , IE - if ($ie) return $ie[1].' based on IE '.$version; // , - return 'IE '.$version; // IE + preg_match("/(MSIE|Opera|Firefox|Chrome|Version|Opera Mini|Netscape|Konqueror|SeaMonkey|Camino|Minefield|Iceweasel|K-Meleon|Maxthon)(?:\/| )([0-9.]+)/", $agent, $browser_info); // регулярное выражение, которое позволяет отпределить 90% браузеров + list(,$browser,$version) = $browser_info; // получаем данные из массива в переменную + if (preg_match("/Opera ([0-9.]+)/i", $agent, $opera)) return 'Opera '.$opera[1]; // определение _очень_старых_ версий Оперы (до 8.50), при желании можно убрать + if ($browser == 'MSIE') { // если браузер определён как IE + preg_match("/(Maxthon|Avant Browser|MyIE2)/i", $agent, $ie); // проверяем, не разработка ли это на основе IE + if ($ie) return $ie[1].' based on IE '.$version; // если да, то возвращаем сообщение об этом + return 'IE '.$version; // иначе просто возвращаем IE и номер версии } - if ($browser == 'Firefox') { // Firefox - preg_match("/(Flock|Navigator|Epiphany)\/([0-9.]+)/", $agent, $ff); // , Firefox - if ($ff) return $ff[1].' '.$ff[2]; // , + if ($browser == 'Firefox') { // если браузер определён как Firefox + preg_match("/(Flock|Navigator|Epiphany)\/([0-9.]+)/", $agent, $ff); // проверяем, не разработка ли это на основе Firefox + if ($ff) return $ff[1].' '.$ff[2]; // если да, то выводим номер и версию } - if ($browser == 'Opera' && $version == '9.80') return 'Opera '.substr($agent,-5); // Opera 9.80, - if ($browser == 'Version') return 'Safari '.$version; // - if (!$browser && strpos($agent, 'Gecko')) return 'Browser based on Gecko'; // , Gecko, - return $browser.' '.$version; // + if ($browser == 'Opera' && $version == '9.80') return 'Opera '.substr($agent,-5); // если браузер определён как Opera 9.80, берём версию Оперы из конца строки + if ($browser == 'Version') return 'Safari '.$version; // определяем Сафари + if (!$browser && strpos($agent, 'Gecko')) return 'Browser based on Gecko'; // для неопознанных браузеров проверяем, если они на движке Gecko, и возращаем сообщение об этом + return $browser.' '.$version; // для всех остальных возвращаем браузер и версию } echo'
- : '.user_browser($inf['dateEnter']).'
+ Браузер: '.user_browser($inf['dateEnter']).'
'; if($inf['no_ip'] == '' || $u->info['admin']>0) { if($mults!='' && $inf['admin']==0){ $mults = trim($mults,', '); - echo ' : '.$mults.'
'; + echo 'Другие ники этого бойца: '.$mults.'
'; } } @@ -2320,29 +2173,29 @@ function user_browser($agent) { $sp = mysql_query('SELECT `id`,`login`,`ip`,`ipreg`,`timereg`,`online` FROM `users` WHERE `host_reg` = "'.$inf['id'].'" AND `activ` = "0" ORDER BY `timereg` DESC'); while( $pl = mysql_fetch_array($sp) ) { - $referalos .= '
.: '.date('d.m.Y H:i',$pl['timereg']).' / : '.date('d.m.Y H:i',$pl['online']).'   '.$u->microLogin($pl['id'],1).' ( '.$pl['ip'].' , '.$pl['ipreg'].' )'; + $referalos .= '
Дата рег.: '.date('d.m.Y H:i',$pl['timereg']).' / Был тут: '.date('d.m.Y H:i',$pl['online']).'   '.$u->microLogin($pl['id'],1).' ( '.$pl['ip'].' , '.$pl['ipreg'].' )'; $rfs++; } if( $referalos == '' ) { - $referalos = ''; + $referalos = 'Отсутствуют'; } - echo '
:'.$referalos.'
'; + echo '
Рефералы бойца:'.$referalos.'
'; if($u->info['admin']>0) { - echo '. :
'; + echo 'Доп. возможности: сбросить характеристики
'; $on1 = mysql_fetch_array(mysql_query('SELECT `time_all`,`time_today` FROM `online` WHERE `uid` = "'.$inf['id'].'" LIMIT 1')); - echo ' (): '.timeOut($on1['time_all']).'
(): '.timeOut($on1['time_today']).'
'; + echo 'Время в онлайне (всего): '.timeOut($on1['time_all']).'
Время в онлайне (сегодня): '.timeOut($on1['time_today']).'
'; } if($inf['molch3'] time()) { - echo '
'; + echo 'Запретить персонажу отправлять сообщения с молчанкой
'; } echo' - : '.$inf['exp'].'
- UP-: '.$inf['ability'].'
- : '.$inf['money'].'
: '.$inf['money2'].'
: '.$u->zuby($inf['money4']).''; + Опыт: '.$inf['exp'].'
+ Число неиспользованных UP-ов: '.$inf['ability'].'
+ Кредитов: '.$inf['money'].'
ЕвроКредитов: '.$inf['money2'].'
Зубов: '.$u->zuby($inf['money4']).''; $bnk = ''; $bmn1 = 0; $bmn2 = 0; $sp = mysql_query('SELECT * FROM `bank` WHERE `uid` = "'.$inf['id'].'"'); while($pl = mysql_fetch_array($sp)) { @@ -2351,31 +2204,31 @@ function user_browser($agent) { }else{ $bnk .= '
'; } - $bnk .= '  • '.$pl['id'].''; - $bnk .= ''.$pl['money1'].' .'; - $bnk .= ''.$pl['money2'].' .'; + $bnk .= '  • '.$pl['id'].''; + $bnk .= ''.$pl['money1'].' кр.'; + $bnk .= ''.$pl['money2'].' екр.'; if($u->info['admin'] > 0) { - $bnk .= ': '.htmlspecialchars($pl['pass'],NULL,'cp1251').''; + $bnk .= 'Пароль: '.htmlspecialchars($pl['pass'],NULL,'cp1251').''; } if($pl['moneyBuy'] > 0) { - $ds = '    : '.$pl['moneyBuy'].'
'; + $ds = 'Персонаж покупал еврокредиты  Сумма : '.$pl['moneyBuy'].'
'; } $bmn1 += $pl['money1']; $bmn2 += $pl['money2']; $bnk .= '
'; } $pk = mysql_fetch_array(mysql_query('SELECT SUM(`ekr`) FROM `pay_operation` WHERE `uid` = "'.$inf['id'].'" AND `good` > 0 LIMIT 1')); - echo '
   : '.$pk[0].'
'; + echo '
Персонаж покупал еврокредиты  Сумма : '.$pk[0].' ЕКР
'; if($bnk != '') { - echo '
:'.$bnk.'   ( ):   '.$bmn1.' .     '.$bmn2.' .
'.$ds; + echo '
Банковские счета:'.$bnk.'   Деньги (Всего в банке):   '.$bmn1.' кр.     '.$bmn2.' екр.
'.$ds; } if($u->info['admin']>0 && $inf['admin']>0) { echo '
admin: '.$inf['admin'].''; } if($inf['active']!=''){ - echo '
! .'; + echo '
Внимание!Если персонаж не получает письма с активацией отправте ему письмо вручную.'; echo '
'; - echo "

"; + echo "

"; } echo '
'; } @@ -2386,7 +2239,7 @@ function user_browser($agent) {
- @@ -2423,13 +2276,13 @@ if( $u->info['align'] > 3 && $u->info['align'] < 4 ) { if($inf['level'] < 8 && $inf['admin'] == 0 && $u->info['admin'] == 0 && $moder == 0) { ?>
-

8

+

Обезличен до достижения 8 уровня

-

1){ echo ' '.date('d.m.Y H:i',$inf['info_delete']).'.'; }else{ echo '.'; } ?>

+

Персонаж обезличен 1){ echo 'до '.date('d.m.Y H:i',$inf['info_delete']).'.'; }else{ echo '.'; } ?>

info['align']>1 && $u->info['align']<2 || $u->info['align']>3 && $u->info['align']<4 || $u->info['admin']>0) { @@ -2441,25 +2294,25 @@ if($inf['info_delete']==0 || (($u->info['align']>1 && $u->info['align']<2) || ($ ?>

-

+

Анкетные данные

-:
-: -
+Имя:
+Пол: +
-:
+Город:
0 && $inf['icq_hide']==0){ echo 'ICQ: '.$inf['icq'].'
'; } ?> Skype: '.$inf['skype'].'
'; } ?> 4) { $url = ((substr($inf['homepage'],0,4)=='https'?"":"https://").$inf['homepage']); ?> - :
+Домашняя страница:
-:
+Девиз:
- / :
+Увлечения / хобби:
',$inf['hobby']); } @@ -2472,7 +2325,7 @@ echo '

'.$c['counters_noFrm'].'
'; ?>

-
+

diff --git a/modules_data/__user.php b/modules_data/__user.php deleted file mode 100644 index 94a22c11..00000000 --- a/modules_data/__user.php +++ /dev/null @@ -1,12567 +0,0 @@ - true, // - - 33 => true, // - 34 => true, // - 35 => true, // - - 42 => true, // - 43 => true, // - - 296 => true - - ); - public $aves = array('now'=>0,'max'=>0),$rep,$tfer,$error2 = '', $room = array(), $bank = array(), $align_nm = array( - 1 => '', - 2 => '', - 3 => '', - 7 => '' - ), $mod_nm = array( - 0=>array(0=>''), - 1=>array('1'=>'','1.1'=>' ','1.4'=>' ','1.5'=>' ','1.6'=>'','1.7'=>' ','1.75'=>'-','1.9'=>' ','1.91'=>' ','1.92'=>' ','1.99'=>' '), - 3=>array('3'=>'','3.01'=>'-','3.05'=>'-','3.06'=>'','3.07'=>'-','3.075'=>'-','3.09'=>'-','3.091'=>'-','3.092'=>' ','3.99'=>' ') - ); - public $btl_txt = '',$rgd = array(0=>0,1=>0),$error = '', - - $city_unid = array(0,'capitalcity','angelscity','abandonedplain','newcapitalcity','demonscity','fallenearth','emeraldscity','dreamscity','suncity'), - $city_id = array('capitalcity'=>1,'angelscity'=>2,'abandonedplain'=>3,'newcapitalcity'=>4,'demonscity'=>5,'fallenearth'=>6,'emeraldscity'=>6,'suncity'=>7,'dreamscity'=>8), - $city_name = array('emeraldscity' => 'Emeralds city','abandonedplain'=>'Abandoned Plain','capitalcity'=>'Capital city','angelscity'=>'Angels city','newcapitalcity'=>'New Capital city','demonscity'=>'Demons city','fallenearth'=>'Fallen Earth','dreamscity'=>'Dreams City','suncity'=>'Sun City'), - $city_name2 = array('emeraldscity' => 'Emeraldscity', 'abandonedplain'=>'Abandonedplain','capitalcity'=>'Capitalcity','angelscity'=>'Angelscity','newcapitalcity'=>'Newcapitalcity','demonscity'=>'Demonscity','fallenearth'=>'FallenEarth','dreamscity'=>'Dreams City','suncity'=>'Sun City'), - - $stats,$info,$map,$mapUsers,$is = array( - 'acestar' => ' ', 'spasenie' => ' ','more_awards' => ' %', 'exp' => ' (%)', 'align_bs' => ' ', - 'nopryh' => ' ', 'puti'=>' ','align'=>'','hpAll'=>' (HP)','mpAll'=>' ','enAll'=>' ','sex'=>'','lvl'=>'','s1'=>'','s2'=>'','s3'=>'','s4'=>'','s5'=>'','s6'=>'','s7'=>'','s8'=>'','s9'=>' ','s10'=>'','s11'=>'','m1'=>'. (%)','m2'=>'. (%)','m3'=>'. . (%)','m4'=>'. (%)','m5'=>'. (%)','m6'=>'. (%)','m7'=>'. (%)','m8'=>'. (%)','m9'=>'. (%)','m14'=>'. . (%)','m15'=>'. . (%)','m16'=>'. . (%)','m17'=>'. . (%)','m18'=>'. . (%)','m19'=>'. . (%)','m20'=>'. (%)','a1'=>' , ','a2'=>' , ','a3'=>' , ','a4'=>' ','a5'=>' ','a6'=>' ','a7'=>' ','aall'=>' ','mall'=>' ','m2all'=>' ','mg1'=>' ','mg2'=>' ','mg3'=>' ','mg4'=>' ','mg5'=>' ','mg6'=>' ','mg7'=>' ','tj'=>' ','lh'=>' ','minAtack'=>' ','maxAtack'=>' ','m10'=>'. ','m11'=>'. ','m11a'=>'. ','pa1'=>'. ','pa2'=>'. ','pa3'=>'. ','pa4'=>'. ','pm1'=>'. ','pm2'=>'. ','pm3'=>'. ','pm4'=>'. ','pm5'=>'. ','pm6'=>'. ','pm7'=>'. ','za'=>' ','zm'=>' ','zma'=>' ','za1'=>' ','za2'=>' ','za3'=>' ','za4'=>' ','zm1'=>' ','zm2'=>' ','zm3'=>' ','zm4'=>' ','zm5'=>' ','zm6'=>' ','zm7'=>' ','magic_cast'=>' ','pza'=>' ','pzm'=>' ','pza1'=>' ','min_heal_proc'=>' (%)','notravma'=>' ','yron_min'=>' ','yron_max'=>' ','zaproc'=>' (%)','zmproc'=>' (%)','zm2proc'=>' (%)','pza2'=>' ','pza3'=>' ','pza4'=>' ','pzm1'=>' ','pzm2'=>' ','pzm3'=>' ','pzm4'=>' ','pzm5'=>' ','pzm6'=>' ','pzm7'=>' ','speedhp'=>' (%)','speedmp'=>' (%)','tya1'=>' ','tya2'=>' ','tya3'=>' ','tya4'=>' ','tym1'=>' ','mg2static_points'=>' ()','tym2'=>' ','tym3'=>' ','tym4'=>' ','hpProc'=>' (%)','mpProc'=>' (%)','tym5'=>' ','tym6'=>' ','tym7'=>' ','min_use_mp'=>' ','pog'=>' ','pog2'=>' ','pog2p'=>' ','pog2mp'=>' ','maxves'=>' ','bonusexp'=>' ','speeden'=>' (%)', - 'antm3' => '. ','repair_z' => ' ','repair_r' => ' ', -'yza' => ' (%)','yzm' => ' (%)','yzma' => ' (%)' -,'yza1' => ' (%)','yza2' => ' (%)','yza3' => ' (%)','yza4' => ' (%)' -,'yzm1' => ' (%)','yzm2' => ' (%)','yzm3' => ' (%)','yzm4' => ' (%)','yzm5' => ' (%)','yzm6' => ' (%)','yzm7' => ' (%)','rep'=> ' ' -,'repair_discount' => ' ','hpVinos' => ' ','bronze' => 'Bronze Premium Account','silvers' => 'Silver Premium Account','gold' => 'Gold Premium Account','speed_dungeon' => ' ' -); - public $items = array( - 'tr' => array('sex','align','lvl','s1','s2','s3','s4','s5','s6','s7','s8','s9','s10','s11','a1','a2','a3','a4','a5','a6','a7','mg1','mg2','mg3','mg4','mg5','mg6','mg7','mall','m2all','aall','rep', 'align_bs'), - 'add' => array( - 'no_vor','antm3','acestar','spasenie','exp','enemy_am1','hod_minmana','yhod','noshock_voda','bronze','silvers','gold','repair_discount', - 'yza','yzm','yzma','yza1','yza2','yza3','yza4','yzm1','yzm2','yzm3','yzm4','yzm5','yzm6','yzm7','repair_z','repair_r', - 'notuse_last_pr','yrn_mg_first','antishock','nopryh','speed_dungeon','naemnik','mg2static_points','yrnhealmpprocmg3','nousepriem','notactic','seeAllEff','100proboi1','pog2','pog2p','magic_cast','min_heal_proc','no_yv1','no_krit1','no_krit2','no_contr1','no_contr2','no_bl1','no_pr1','no_yv2','no_bl2','no_pr2','silver','pza','pza1','pza2','pza3','pza4','pzm','pzm1','pzm2','pzm3','pzm4','pzm5','pzm6','pzm7','yron_min','yron_max','notravma','min_zonb','min_zona','nokrit','pog','min_use_mp','za1proc','za2proc','za3proc','za4proc','zaproc','zmproc','zm1proc','zm2proc','zm3proc','zm4proc','shopSale','shopSaleEkr','s1','s2','s3','s4','s5','s6','s7','s8','s9','s10','s11','aall','a1','a2','a3','a4','a5','a6','a7','m2all','mall','mg1','mg2','mg3','mg4','mg5','mg6','mg7','hpAll','hpVinos','mpVinos','mpAll','enAll','hpProc','mpProc','m1','m2','m3','m4','m5','m6','m7','m8','m9','m14','m15','m16','m17','m18','m19','m20','pa1','pa2','pa3','pa4','pm1','pm2','pm3','pm4','pm5','pm6','pm7','za','za1','za2','za3','za4','zma','zm','zm1','zm2','zm3','zm4','zm5','zm6','zm7','mib1','mab1','mib2','mab2','mib3','mab3','mib4','mab4','speedhp','speedmp','m10','m11','m11a','zona','zonb','maxves','minAtack','maxAtack','bonusexp','speeden'), - 'sv' => array('pza','pza1','pza2','pza3','pza4','pzm','pzm1','pzm2','pzm3','pzm4','pzm5','pzm6','pzm7','notravma','min_zonb','min_zona','nokrit','pog','min_use_mp','za1proc','za2proc','za3proc','za4proc','zaproc','zmproc','zm1proc','zm2proc','zm3proc','zm4proc','shopSale','shopSaleEkr','s1','s2','s3','s4','s5','s6','s7','s8','s9','s10','s11','aall','a1','a2','a3','a4','a5','a6','a7','m2all','mall','mg1','mg2','mg3','mg4','mg5','mg6','mg7','hpAll','mpAll','enAll','m1','m2','m3','m4','m5','m6','m7','m8','m9','m14','m15','m16','m17','m18','m19','m20','pa1','pa2','pa3','pa4','pm1','pm2','pm3','pm4','pm5','pm6','pm7','min_use_mp','za','za1','za2','za3','za4','zma','zm','zm1','zm2','zm3','zm4','zm5','zm6','zm7','mib1','mab1','mib2','mab2','mib3','mab3','mib4','mab4','speedhp','speedmp','m10','m11','zona','zonb','maxves','minAtack','maxAtack','speeden') - ); - - /* - yrnhealmpprocmg3 - , % ( ) - */ - - public function sys_add($uid,$time,$type,$text,$data,$time_see) { - /*if(mysql_query('INSERT INTO `a_system` (`uid`,`time`,`type`,`text`,`data`,`time_see`) VALUES ("'.$uid.'","'.$time.'","'.$type.'","'.$text.'","'.$data.'","'.$time_see.'")')){ - - }else{ - echo '.'; - } - */ - } - - public function pensia($type) { - if( $type == false ) { - if( ( $this->info['align'] > 0 || $this->info['clan'] > 0 || $this->info['level'] >8) && $this->info['align'] != 2 ) { - $r = ($this->info['level']-6) * 0.04; - if( date('m') >= 6 || date('m') <= 8 ) { - $r = round($r * 2,2); - }elseif( date('w') == 0 || date('w') == 6 ) { - $r = round($r * 2,2); - } - $r = $r.' .'; - }else{ - $r = $this->info['level']; - if( date('m') >= 6 || date('m') <= 8 ) { - $r = round($r * 2,2); - }elseif( date('w') == 0 || date('w') == 6 ) { - $r = round($r * 2,2); - } - $r = $r .' .'; - } - }else{ - if( ($this->info['align'] > 0 || $this->info['clan'] > 0 || $this->info['level'] >8) && $this->info['align'] != 2 ) { - $r = ($this->info['level']-6) * 0.04; - if( date('m') >= 6 || date('m') <= 8 ) { - $r = round($r * 2,2); - }elseif( date('w') == 0 || date('w') == 6 ) { - $r = round($r * 2,2); - } - $r = array(2,$r); - }else{ - $r = $this->info['level']; - if( date('m') >= 6 || date('m') <= 8 ) { - $r = round($r * 2,2); - }elseif( date('w') == 0 || date('w') == 6 ) { - $r = round($r * 2,2); - } - $r = array(1,$r); - } - } - return $r; - } - - public function testAlign( $an , $uid ) { - $r = 1; - if( floor($an) > 0 ) { - $a = mysql_fetch_array(mysql_query('SELECT * FROM `users_align` WHERE `uid` = "'.$uid.'" AND (`delete` = "0" OR `delete` > "'.time().'") LIMIT 1')); - if(isset($a['id'])) { - if( floor($a['align']) > 0 ) { - if( floor($a['align']) != $an ) { - $r = 0; - } - } - } - } - return $r; - } - - public function abilsRoom($type) { - $r = ''; - // - if( $this->info['clan'] > 0 ) { - // - }elseif( $type == 'test' ) { - if( $this->room['name'] == ' ' || $this->room['name'] == ' ' || $this->room['name'] == ' ' ) { - if(isset($_GET['vhp'])) { - $v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "'.$this->info['id'].'" AND `type` = 1 ORDER BY `time` DESC LIMIT 1')); - if( isset($v['id']) && $v['time'] > time() - 60 * 60 ) { - // - $this->error = ' '.$this->timeOut( $v['time'] + 60 * 60 - time() ); - }else{ - if( $this->stats['hpNow'] < 1 ) { $this->stats['hpNow'] = 0; } - $this->error = ' '.round($this->stats['hpAll'] - $this->stats['hpNow']).' HP.'; - mysql_query('INSERT INTO `vortex` ( `uid`,`time`,`room`,`val`,`type` ) VALUES ( - "'.$this->info['id'].'","'.time().'","'.$this->info['room'].'","'.round($this->stats['hpAll'] - $this->stats['hpNow']).'","1" - )'); - $this->stats['hpNow'] = $this->stats['hpAll']; - mysql_query('UPDATE `stats` SET `hpNow` = "'.$this->stats['hpNow'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - }elseif(isset($_GET['vmp'])) { - $v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "'.$this->info['id'].'" AND `type` = 2 ORDER BY `time` DESC LIMIT 1')); - if( isset($v['id']) && $v['time'] > time() - 60 * 60 ) { - // - $this->error = ' '.$this->timeOut( $v['time'] + 60 * 60 - time() ); - }else{ - if( $this->stats['mpNow'] < 1 ) { $this->stats['mpNow'] = 0; } - $this->error = ' '.round($this->stats['mpAll'] - $this->stats['mpNow']).' MP.'; - mysql_query('INSERT INTO `vortex` ( `uid`,`time`,`room`,`val`,`type` ) VALUES ( - "'.$this->info['id'].'","'.time().'","'.$this->info['room'].'","'.round($this->stats['mpAll'] - $this->stats['mpNow']).'","2" - )'); - $this->stats['hpNow'] = $this->stats['hpAll']; - mysql_query('UPDATE `stats` SET `mpNow` = "'.$this->stats['mpNow'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - } - } - }elseif( $type == 'look' ) { - // - if( $this->room['name'] == ' ' || $this->room['name'] == ' ' || $this->room['name'] == ' ' ) { - $vid = 0; - // - if( $this->room['name'] == ' ' ) { - $vid = 6; - }elseif( $this->room['name'] == ' ' ) { - $vid = 7; - }elseif( $this->room['name'] == ' ' ) { - $vid = 10; - } - // - $v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "'.$this->info['id'].'" AND `type` = 1 ORDER BY `time` DESC LIMIT 1')); - if(isset($v['id']) && $v['time'] + 60 * 60 > time() ) { - $r .= ' '; - }else{ - $r .= ' '; - } - $v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "'.$this->info['id'].'" AND `type` = 2 ORDER BY `time` DESC LIMIT 1')); - if(isset($v['id']) && $v['time'] + 60 * 60 > time() ) { - $r .= ' '; - }else{ - $r .= ' '; - } - } - // - } - return $r; - } - - public function insertAlign( $an , $uid ) { - if( $an > 0 ) { - mysql_query('UPDATE `users_align` SET `delete` = "'.(time()+1).'" WHERE `uid` = "'.mysql_real_escape_string($uid).'" AND `align` = "'.mysql_real_escape_string(floor($an)).'"'); - mysql_query('INSERT INTO `users_align` (`uid`,`time`,`delete`,`align`) VALUES ( - "'.mysql_real_escape_string($uid).'","'.time().'","0","'.mysql_real_escape_string(floor($an)).'" - ) '); - } - } - - public function deleteAlign( $an , $uid ) { - if( $an > 0 ) { - mysql_query('UPDATE `users_align` SET `delete` = "'.(time()+86400*60).'" WHERE `uid` = "'.mysql_real_escape_string($uid).'" AND `align` = "'.mysql_real_escape_string(floor($an)).'"'); - } - } - - public function shopSaleM( $val, $itm ) { - global $c; - /*$proc = array( - 0,0,0,0,0,0,0,0, - 5,30,30,30,30,30,30,30,30,30,30,30,30,30 - ); - $po = $this->lookStats($itm['data']); - $proc = $proc[$po['tr_lvl']];*/ - $proc = 0; - // - $proc = array( - 0, //0 - 0, //1 - 0, //2 - 0, //3 - 0, //4 - 0, //5 - 0, //6 - 0, //7 - 5,30,30,30,30,30,30,30,30,30,30,30,30,30 - ); - $po = $this->lookStats($itm['data']); - $proc = $proc[$po['tr_lvl']]; - // - if( $itm['type'] >= 28 ) { - $proc = 50; - } - if($itm['type']==46){ - $proc = 0; - } - if( $c['shop_all'] > 0 ) { - $proc = 100-$c['shop_all']; - }elseif( $c['shop_all_type1'] > 0 && !isset($this->info['inBerezka']) ) { - $proc = 100-$c['shop_all_type1']; - }elseif( $c['shop_all_type2'] > 0 && isset($this->info['inBerezka'])) { - $proc = 100-$c['shop_all_type2']; - } - $val = round(($val/100*(100-$proc)),2); - return $val; - } - - // - public function deleteItemID($id, $uid, $coldel) { - $sp = mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "'.mysql_real_escape_string($id).'" AND `uid` = "'.mysql_real_escape_string($uid).'" AND (`delete` = 0 OR `delete` = 1000) ORDER BY `inGroup` DESC LIMIT '.$coldel); - $delitm = array(); - while($pl = mysql_fetch_array($sp)) { - if(count($delitm) < $coldel) { - $delitm[] = $pl['id']; - } - } - $i = 0; - while($i < count($delitm)) { - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$delitm[$i].'" LIMIT 1'); - $i++; - } - } - - public function count_items($id, $uid, $coldel) { - $sp = mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "'.mysql_real_escape_string($id).'" AND `uid` = "'.mysql_real_escape_string($uid).'" AND (`delete` = 0 OR `delete` = 1000) ORDER BY `inGroup` DESC LIMIT '.$coldel); - $delitm = array(); - while($pl = mysql_fetch_array($sp)) { - if(count($delitm) < $coldel) { - $delitm[] = $pl['id']; - } - } - $i = 0; - while($i < count($delitm)) { - $i++; - } - return $i; - } - - public function repobmen($id,$type) - { - //echo ''; - $pl = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "'.((int)$id).'" LIMIT 1;')); - $d = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$pl['item_id'].'" LIMIT 1')); - $po = $this->lookStats($pl['data']); - //echo $po['dungeon'].' '.$po['tr_lvl']; - if((!isset($po['frompisher']) or $po['tr_lvl']<4) and $pl['type']!=31){ - $e = ' .'; - }else{ - $e = ' "'.$pl['name'].'" apitalcity .'; - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - $this->rep['repcapitalcity'] += 1; - mysql_query('UPDATE `rep` SET `repcapitalcity` = "'.$this->rep['repcapitalcity'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - return $e; - } - - public function add_buf($id,$tp,$uid = NULL,$mod = NULL) { - /*if($this->info['admin'] > 0) { - if($tp == 1) { - - $cache = ob_get_contents(); - ob_end_clean (); - - // - if($uid != '') { - $uid_f = floor($uid/1000); - }else{ - $uid_f = '_m'; - } - - // - if(!is_dir($id.'~a/'.$uid_f.'/') ) { - // - mkdir($id.'~a/'.$uid_f.'/', 0700); - } - - // - if(!is_dir($id.'~a/'.$uid_f.'/'.$uid.'/') ) { - // - mkdir($id.'~a/'.$uid_f.'/'.$uid.'/', 0700); - } - - $id = $id.'~a/'.$uid_f.'/'.$uid.'/'.$mod.'_'.md5($mod).'.cach'; - - // - if(file_exists($id)) { - $this->del_buf($id); - } - - // - $fp = @fopen ($id, "w"); - @fwrite($fp, $cache); - @fclose($fp); - - }elseif($tp == 0) { - ob_start(); - } - }*/ - } - - public function del_buf($id,$uid = NULL,$mod = NULL) { - /*if($uid != NULL && $mod != NULL) { - // - if((int)$uid > 0 && $uid != '') { - $uid_f = floor($uid/1000); - }else{ - $uid_f = '_m_'.$uid; - } - $id = $id.'~a/'.$uid_f.'/'.$uid.'/'.$mod.'_'.md5($mod).'.cach'; - } - if(file_exists($id)) { - unlink($id); - }*/ - } - - public function see_buf($id,$uid = NULL,$mod = NULL) { - /*if(file_exists($id)) { - if($uid != NULL && $mod != NULL) { - // - if($uid != '') { - $uid_f = floor($uid/1000); - }else{ - $uid_f = '_m'; - } - $id = $id.'~a/'.$uid_f.'/'.$uid.'/'.$mod.'_'.md5($mod).'.cach'; - } - return file_get_contents($id); - }else{ - return false; - }*/ - } - - public function sys_see($type) { - /* - $r = ''; $lid = $this->info['sys']; - $sp = mysql_query('SELECT `id`,`uid`,`time`,`type`,`text`,`data`,`time_see` FROM `a_system` WHERE `uid` = "'.$this->info['id'].'" AND `id` > "'.$this->info['sys'].'" ORDER BY `time` DESC LIMIT 20'); - while($pl = mysql_fetch_array($sp)) { - $r .= 'top.tow('.$pl['id'].',"'.$pl['text'].'",'.$pl['time_see'].','.$pl['data'].');'; - if($pl['id'] > $lid) { - $lid = $pl['id']; - } - } - if($lid > $this->info['sys']) { - mysql_query('UPDATE `users` SET `sys` = "'.$lid.'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - return $r; - */ - } - - public static function start() - { - if (!isset(self::$flag_one)) - { - $c = __CLASS__; - self::$flag_one = new $c(); - } - return self::$flag_one; - } - - public function lookKeys($m,$i) - { - $e = explode('|',$m); - $r = array(); - while($i 0 || $bu[$i]['nich']) { - mysql_query('UPDATE `users` SET `lose` = "'.$bu[$i]['lose'].'", `nick` = "'.$bu[$i]['nich'].'" WHERE `id` = "'.$bu[$i]['id'].'" LIMIT 1'); - mysql_query('UPDATE `bs_turnirs` SET `users_finish` = `users_finish` + 1 WHERE `id` = "'.$id['id'].'" LIMIT 1'); - /* */ - if($bu['inBot'] == 0) { - $pls1 = mysql_fetch_array(mysql_query('SELECT `id`, `bsid`, `money`, `finish`, `time`, `inBot`, `uid` FROM `bs_zv` WHERE `bsid` = "'.$id['id'].'" AND `finish` = 0 AND `time` = "'.$id['time_start'].'" AND `inBot` = "'.$bu[$i]['id'].'" LIMIT 1')); - if(isset($pls1['id'])) { - mysql_query('DELETE FROM `users` WHERE `id` = "'.$bu[$i]['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `stats` WHERE `id` = "'.$bu[$i]['id'].'" LIMIT 1'); - - // - $spi = mysql_query('SELECT `id`,`item_id` FROM `items_users` WHERE `uid` = "'.$bu[$i]['id'].'" LIMIT 500'); - $ins = ''; - while($pli = mysql_fetch_array($spi)) - { - $ins .= '("'.$di['dn_id'].'","'.$pli['item_id'].'","'.time().'","'.$di['x'].'","'.$di['y'].'"),'; - } - - $ins = rtrim($ins,','); - mysql_query('INSERT INTO `dungeon_items` (`dn`,`item_id`,`time`,`x`,`y`) VALUES '.$ins.''); - mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$pls1['inBot'].'" LIMIT 1'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$pls1['inBot'].'" LIMIT 1'); - mysql_query('UPDATE `bs_zv` SET `finish` = "'.time().'" WHERE `id` = "'.$pls1['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `inUser` = 0 WHERE `id` = "'.$pls1['uid'].'" LIMIT 1'); - } - } - $id['users_finish']++; - } - $i++; - } - } - if($id['users']-$id['users_finish'] < 2) { - $win = array(); - $sp = mysql_query('SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "'.$id['id'].'" AND `finish` = "0" AND `time` = "'.$id['time_start'].'" ORDER BY `money` DESC LIMIT 100'); - while($pl = mysql_fetch_array($sp)) - { - $ur = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "'.$pl['uid'].'" LIMIT 1')); - $ub = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "'.$ur['inUser'].'" LIMIT 1')); - if(isset($ur['id']) && isset($ub['id'])) - { - if($ub['lose'] > 0 || $ub['nich'] > 0) { - // - - }else{ - $win = $ub; - $winr = $ur; - } - } - } - - /* */ - if(isset($win['id']) && $win['lose'] == 0 && $win['nich'] == 0 && $win['id'] > 0) { - // - $bsep = 0; - if($winr['level'] < 6) { - $bsep = 2500; - }elseif($winr['level'] < 7) { - $bsep = 5000; - }elseif($winr['level'] < 8) { - $bsep = 15000; - }elseif($winr['level'] < 9) { - $bsep = 25000; - }else{ - $bsep = 50000; - } - /* */ - $mn = (round($id['money']/100*85)); - mysql_query('UPDATE `users` SET `money` = `money` + "'.$mn.'" WHERE `id` = "'.$winr['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `exp` = `exp` + "'.$bsep.'" WHERE `id` = "'.$winr['id'].'" LIMIT 1'); - /* */ - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','".$winr['login']."','! " "! : ".$bsep.", : ".$mn." .','-1','6','0')"); - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','! " ", : ".$winr['login']."! !','-1','5','0')"); - $this->addDelo(1,$uid,'"WinTournament.'.$this->info['city'].'" ( ): "'.$mn.' ."',time(),$this->info['city'],'WinTournament.'.$this->info['city'].'',0,0); - }else{ - // - // - - /* */ - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','! " ", : .','-1','5','0')"); - } - - $sp = mysql_query('SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "'.$id['id'].'" AND `time` = "'.$id['time_start'].'" ORDER BY `money` DESC LIMIT 100'); - while($pl = mysql_fetch_array($sp)) - { - $ur = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "'.$pl['uid'].'" LIMIT 1')); - $ub = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "'.$ur['inUser'].'" LIMIT 1')); - if(isset($ub['id'])) - { - //del - mysql_query('DELETE FROM `users` WHERE `id` = "'.$ub['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `stats` WHERE `id` = "'.$ub['id'].'" LIMIT 1'); - mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$ub['id'].'" LIMIT 500'); - mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$ub['id'].'" LIMIT 500'); - //upd - mysql_query('UPDATE `bs_zv` SET `finish` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `users` SET `inUser` = "0" WHERE `id` = "'.$pl['uid'].'" LIMIT 1'); - } - } - } - } - - // - public function ves($u) - { - $r = array('now'=>0,'max'=>0); - if($u==NULL) - { - // - $r['now'] = mysql_fetch_array(mysql_query('SELECT SUM(`im`.`massa`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "'.$this->info['id'].'" AND (`iu`.`delete` = "0" OR (`iu`.`delete` = "1000" AND `iu`.`inGroup` > 0)) AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0"')); - $r['now'] = 0+$r['now'][0]; - @$r['max'] = 40+($this->stats['os7']*10)+$this->stats['s4']+$this->stats['maxves']+$this->stats['s1']*4; - $r['items'] = mysql_fetch_array(mysql_query('SELECT COUNT(`im`.`id`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "'.$this->info['id'].'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0"')); - $r['items'] = $r['items'][0]; - }else{ - - } - return $r; - } - - // \ - public function plavka($id, $type) - { - $e = ''; - $rn = 0; $rnn = array(); - $pl = mysql_fetch_array(mysql_query('SELECT -`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, -`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` -FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "'.((int)$id).'" LIMIT 1;')); - $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$pl['item_id'].'" LIMIT 1')); - $po = $this->lookStats($d['data']); - $rlvl = 4; - if($pl['level'] == 0) { - $pl['level'] = 0+$po['tr_lvl']; - } - - if($pl['level']==7 || $pl['level']==8){ - $rlvl = 7; - }elseif($pl['level']==9){ - $rlvl = 9; - }elseif($pl['level']>=10){ - $rlvl = 9; - } - // - if( ( rand(0,100) == 0 ) && $this->rep['rep1'] >= 1000 ) { - $rlvl = 1; - $rs = mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `type` = 31 AND `level` = "'.$rlvl.'" AND `id` >= 5024 AND `id` < 6000'); - }elseif( ( rand(0,100) <= 1 ) && $this->rep['rep1'] >= 10000 ) { - $rlvl = 1; - $rs = mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `type` = 31 AND `level` = "'.$rlvl.'" AND `id` >= 5024 AND `id` < 6000'); - }else{ - $rs = mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `type` = 31 AND `level` = "'.$rlvl.'" AND `id` < 5024'); - } - - //$rs = mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `type` = 31 AND `level` = "'.$rlvl.'"'); - while($rl = mysql_fetch_array($rs)) - { - $nm = explode(' ',$rl['name']); - if(($nm[0] && $nm[1] || $rlvl >= 10)) { - $rnn[count($rnn)] = $rl['id']; - } - } - $rn = $rnn[rand(0,count($rnn)-1)]; - - $chns = round(50 + ( ( 4 - $po['tr_lvl'] ) * 5 ) ); // - if( $chns > 90 ) { - $chns = 90; - }elseif( $chns < 50 ) { - $chns = 70; - } - - if($po['tr_lvl']<4 && $pl['item_id']!=1035) - { - $e = ' 4- '; - }elseif($pl['type']!=1 && $pl['type']!=3 && $pl['type']!=5 && $pl['type']!=6 && $pl['type']!=8 && $pl['type']!=9 && $pl['type']!=10 && $pl['type']!=11 && $pl['type']!=12 && $pl['type']!=14 && $pl['type']!=15 && $pl['type']!=18 && $pl['type']!=19 && $pl['type']!=20 && $pl['type']!=21 && $pl['type']!=22 && $pl['type']!=13 && $pl['item_id']!=1035) - { - $e = ' , ! ? ! - !'; - }elseif($po['tr_lvl']>=7 && $this->rep['rep1']<100) - { - $e = ' 7- '; - }elseif($po['tr_lvl']>=9 && $this->rep['rep1']<1000) - { - $e = ' 9- '; - }elseif($po['tr_lvl']>=10 && $this->rep['rep1']<10000) - { - $e = ' 10- '; - }elseif($rn>0) - { - if(isset($pl['id'],$d['id'])) - { - $rnn = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `type` = "31" AND `id` = "'.$rn.'" LIMIT 1')); - if(isset($rnn['id'])){ - $pl['rep'] = 0; - if( $po['tr_lvl'] >= 4 && $po['tr_lvl'] <= 6 && $this->rep['rep1'] < 100 ) { - $pl['rep'] = 1; //4-6 - }elseif($this->rep['rep1'] > 99 && $this->rep['rep1'] < 1000){ - if( $po['tr_lvl'] >= 7 && $po['tr_lvl'] <= 8 ) { //7-8 - $pl['rep'] = 1; - } - if($pl['item_id']==1035){ - $pl['rep'] = 2; - } - }elseif($this->rep['rep1'] > 999){ - if( $po['tr_lvl'] >= 9 && $po['tr_lvl'] <= 10 ) { //9-10 - $pl['rep'] = 1; - } - if($pl['item_id']==1035){ - $pl['rep'] = 2; - } - }else{ - if($pl['item_id']==1035){ - $pl['rep'] = 2; - } - } - // - if( $chns <= rand(0,100) && $pl['item_id'] != 1035) { - $e = ' "'.$pl['name'].'" ...'; - $ld = $this->addDelo(1, $this->info['id'],'"AddItems.'.$this->info['city'].'": ['.$pl['name'].'] .',time(),$this->info['city'],'AddItems.'.$this->info['city'].'',0,0); - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }elseif(mysql_query('UPDATE `rep` SET `rep1` = `rep1` + "'.$pl['rep'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1')){ - - $e = ' "'.$pl['name'].'". '.( $pl['item_id'] != 1035 ? ' "'.$rnn['name'].'".' : '').'. : +'.$pl['rep'].' .'; - if($pl['item_id'] != 1035) { - $irunew = $this->addItem($rnn['id'],$this->info['id'], null, null, null, null, $pl['name']); - /*if( $rlvl == 1 ) { - $irunew = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `id` = "'.$irunew.'" LIMIT 1')); - if(isset($irunew['id'])) { - $irunew['data'] .= '|sudba='.$u->info['login'].''; - } - mysql_query('UPDATE `items_users` SET `data` = "'.$irunew['data'].'" WHERE `id` = "'.$irunew['id'].'" LIMIT 1'); - unset($irunew); - }*/ - } - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - $this->rep['rep1'] += $pl['rep']; - mysql_query('UPDATE `rep` SET `rep1` = "'.$this->rep['rep1'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - }else{ - $e = ' , ...'; - } - }else{ - $e = ' ...'; - } - }else{ - $e = ' , '.$pl['item_id'].'...'; - } - }else{ - $e = ' , ...'; - } - return $e; - } - - // - public function info_remont() - { - $r = ''; - $sp = mysql_query('SELECT - `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, - `iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` - FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid` = "'.((int)$this->info['id']).'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` > "0" AND `iu`.`inOdet` < "18" LIMIT 18'); - while($pl = mysql_fetch_array($sp)) - { - if($pl['iznosNOW']>ceil($pl['iznosMAX']*0.80)) - { - $r .= ''.$pl['name'].' ['.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']).']
'; - } - } - $r = '
'.$r.'
'; - return $r; - } - - // - public function weaponAtc($item,$st,$x) - { - $tp = 0; - if(isset($item['id'])) - { - $itm = $this->lookStats($item['data']); - // - if(!isset($st['minAtack'])) { $st['minAtack'] = 0; } - if(!isset($st['maxAtack'])) { $st['maxAtack'] = 0; } - if(!isset($st['yron_min'])) { $st['yron_min'] = 0; } - if(!isset($st['yron_max'])) { $st['yron_max'] = 0; } - if(!isset($itm['yron_min'])) { $itm['yron_min'] = 0; } - if(!isset($itm['yron_max'])) { $itm['yron_max'] = 0; } - if(!isset($itm['sv_yron_min'])) { $itm['sv_yron_min'] = 0; } - if(!isset($itm['sv_yron_max'])) { $itm['sv_yron_max'] = 0; } - - $min = $itm['sv_yron_min']+$st['minAtack']+$itm['yron_min']+$st['yron_min']; - $max = $itm['sv_yron_max']+$st['maxAtack']+$itm['yron_max']+$st['yron_max']; - - //if($x!=0) - //{ - // : 0 - , 1 - , 2 - , 3 - , 4 - , 5 - , 6 - , 7 - , 8 - , 9 - , 10 - , 11 - - if($item['type'] == 18) - { - // - $sss = ceil((($st['s1']*0.45+$st['s2']*0.55))); - }elseif($item['type'] == 19) - { - // - $sss = ceil(($st['s1']*0.60+$st['s2']*0.25+$st['s3']*0.25)); - }elseif($item['type'] == 20) - { - // - $sss = ceil($st['s1']*0.95); - }elseif($item['type'] == 21) - { - // - $sss = ceil(($st['s1']*0.45+$st['s3']*0.45)); - }else{ - // - $sss = ceil($st['s1']*0.5); - } - - - // - //$p['B'][0] = 5; - //$p['B'][1] = 9; - - $p['B'][0] = ceil($st['s1']*1.4); - $p['B'][1] = ceil(0.4+$p['B'][0]/0.9); - - $p['B'][0] = 2 + $st['level'] + $st['s1'] - round($st['s1']/5); - $p['B'][1] = $p['B'][0] + 3; - - $p['B']['rnd'] = rand($p['B'][0],$p['B'][1]); - // - $p['W'][0] = $min; - $p['W'][1] = $max; - $p['W']['rnd'] = rand($p['W'][0],$p['W'][1]); - // . - $p['T'] = 1; - // - $bn = 0; - if($item['type'] == 21) { - // - $p['M'] = $st['pa4']; - $bn = $st['a4']; - $p['M'] = $st['pa'.$x]; - }elseif($item['type'] == 20) { - // - $p['M'] = $st['pa3']; - $bn = $st['a3']; - }elseif($item['type'] == 19) { - // - $p['M'] = $st['pa2']; - $bn = $st['a2']; - }elseif($item['type'] == 18) { - // - $p['M'] = $st['pa1']; - $bn = $st['pa1']; - }elseif($item['type'] == 22) { - // - $p['M'] = $st['pa']; - $bn = $st['a5']; - } - // - //if( $x < 5 ) { - //$p['M'] = $st['pa'.$x]; - //}else{ - // $p['M'] = $st['pm'.($x-4)]; - //} - $min = (($p['B'][0]+$sss+$p['W'][0])*$p['T']*(1+0.005*$bn))*(1+$p['M']/100); - $max = (($p['B'][1]+$sss+$p['W'][1])*$p['T']*(1+0.005*$bn))*(1+$p['M']/100); - // - $kmin = ceil( ( 2 * ( 1 + $st['m3']/100 ) ) * $min); - $kmax = ceil( ( 2 * ( 1 + $st['m3']/100 ) ) * $max); - /* - $r['Kmin'] = ceil( ( 2 * ( 1 + $p['K']/100 ) ) * $r['min']); - $r['Kmax'] = ceil( ( 2 * ( 1 + $p['K']/100 ) ) * $r['max']); - */ - // - //$min = $min*0.8; - //$max = $max*0.8; - //} - $tp = array(0=>ceil($min),1=>ceil($max),2=>ceil($kmin),3=>ceil($kmax)); - } - return $tp; - } - - public function yronLvl($lvl1,$lvl2) { - $r = array( - 1 => array(0,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200), - 2 => array(0,600,400,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200), - 3 => array(0,1000,800,600,400,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200), - 4 => array(0,1400,1200,1000,800,600,400,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200), - 5 => array(0,1800,1600,1400,1200,1000,800,600,400,200,200,200,200,200,200,200,200,200,200,200,200,200), - 6 => array(0,2200,2000,1800,1600,1400,1200,1000,800,600,400,200,200,200,200,200,200,200,200,200,200,200), - 7 => array(0,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600,400,200,200,200,200,200,200,200,200,200), - 8 => array(0,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600,400,200,200,200,200,200,200,200), - 9 => array(0,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600,400,200,200,200,200,200), - 10 => array(0,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600,400,200,200,200), - 11 => array(0,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600,400,200), - 12 => array(0,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600), - 13 => array(0,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000), - 14 => array(0,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400), - 15 => array(0,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800), - 16 => array(0,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200), - 17 => array(0,6600,6400,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600), - 18 => array(0,7000,6800,6600,6400,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000), - 19 => array(0,7400,7200,7000,6800,6600,6400,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400), - 20 => array(0,7800,7600,7400,7200,7000,6800,6600,6400,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800), - 21 => array(0,8200,8000,7800,7600,7400,7200,7000,6800,6600,6400,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200) - ); - $r = floor($r[$lvl1][$lvl2]/100); - $r = 0; - return $r; - } - - // - public function zago($v) { - /*if($v > 1000) { - $v = 1000; - } - $r = (1-( pow(0.5, ($v/250) ) ))*100; - return $r;*/ - if($v > 1700) { - $v = 1700; - } - $r = round( (1-( pow(0.5, ($v/399.51) ) ))*100 , 2 ); - return $r; - } - // () - public function zmgo($v) { - if($v > 1000) { - $v = 1000; - } - $r = (1-( pow(0.5, ($v/250) ) ))*100; - return $r; - } - - public function inform($v) - - { - //$this->stats['items'][13] , $this->stats['items'][14] - $r = ''; - if($v=='yrontest' || $v=='yrontest-krit') - { - $y = array(); - /* */ - $w1 = 0; - $w2 = 0; - $i = 0; - while($istats['items'])) - { - if($this->stats['items'][$i]['inOdet']==3 && $w1==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28) - { - $w1 = $this->stats['items'][$i]; - }elseif($this->stats['items'][$i]['inOdet']==14 && $w2==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28) - { - $w2 = $this->stats['items'][$i]; - } - $i++; - } - if(isset($w1['id']) && $w1['inOdet']!=14) - { - $tp = 0; - $t = 0; - $i = 1; - $d = $this->lookStats($w1['data']); - while($i<=4) - { - if(isset($d['tya'.$i]) && $t<$d['tya'.$i]) - { - $t = $d['tya'.$i]; - $tp = $i; - } - $i++; - } - $y = $this->weaponAtc($w1,$this->stats,$tp); - if($v=='yrontest-krit') { - $y[0] = $y[2]; - $y[1] = $y[3]; - } - if( $y[0] < 1 ) { - $y[0] = 1; - } - if( $y[1] < 1 ) { - $y[1] = 1; - } - $r .= ''.$y[0].'-'.$y[1].''; - }else{ - // - $y[0] = ceil( 2 + $this->info['level'] + $this->stats ['s1'] - round($this->stats['s1'] / 5) )+$this->stats['minAtack']+$this->stats['yron_min']; - $y[1] = ceil($y[0] + 3)+$this->stats['maxAtack']+$this->stats['yron_max']; - if( $y[0] < 1 ) { - $y[0] = 1; - } - if( $y[1] < 1 ) { - $y[1] = 1; - } - $r .= $y[0].'-'.$y[1]; - } - /* */ - if(isset($w2['id'])) - { - $tp = 0; - $t = 0; - $i = 1; - $d = $this->lookStats($w2['data']); - while($i<=4) - { - if($t<$d['tya'.$i]) - { - $t = $d['tya'.$i]; - $tp = $i; - } - $i++; - } - $y = $this->weaponAtc($w2,$this->stats,$tp); - if($v=='yrontest-krit') { - $y[0] = $y[2]; - $y[1] = $y[3]; - } - if( $y[0] < 1 ) { - $y[0] = 1; - } - if( $y[1] < 1 ) { - $y[1] = 1; - } - $r .= ' / '.$y[0].'-'.$y[1].''; - } - /* --- */ - }elseif($v=='yron') - { - $y = array(); - /* */ - $w1 = 0; - $w2 = 0; - $i = 0; - while($istats['items'])) - { - if($this->stats['items'][$i]['inOdet']==3 && $w1==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28) - { - $w1 = $this->stats['items'][$i]; - }elseif($this->stats['items'][$i]['inOdet']==14 && $w2==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28) - { - $w2 = $this->stats['items'][$i]; - } - $i++; - } - if(isset($w1['id']) && $w1['inOdet']!=14) - { - $tp = 0; - $t = 0; - $i = 1; - $d = $this->lookStats($w1['data']); - while($i<=4) - { - if(isset($d['tya'.$i]) && $t<$d['tya'.$i]) - { - $t = $d['tya'.$i]; - $tp = $i; - } - $i++; - } - $y = $this->weaponAtc($w1,$this->stats,$tp); - if( $y[0] < 1 ) { - $y[0] = 1; - } - if( $y[1] < 1 ) { - $y[1] = 1; - } - $r .= ''.$y[0].'-'.$y[1].''; - }else{ - // - $y[0] = ceil($this->stats['s1']*1.4)+$this->stats['minAtack']+$this->stats['yron_min']; - $y[1] = ceil(0.4+$y[0]/0.9)+$this->stats['maxAtack']+$this->stats['yron_max']; - if( $y[0] < 1 ) { - $y[0] = 1; - } - if( $y[1] < 1 ) { - $y[1] = 1; - } - $r .= $y[0].'-'.$y[1]; - } - /* */ - if(isset($w2['id'])) - { - $tp = 0; - $t = 0; - $i = 1; - $d = $this->lookStats($w2['data']); - while($i<=4) - { - if($t<$d['tya'.$i]) - { - $t = $d['tya'.$i]; - $tp = $i; - } - $i++; - } - $y = $this->weaponAtc($w2,$this->stats,$tp); - if( $y[0] < 1 ) { - $y[0] = 1; - } - if( $y[1] < 1 ) { - $y[1] = 1; - } - $r .= ' / '.$y[0].'-'.$y[1].''; - } - }else{ - // - $y = array(); - /* */ - $w1 = 0; - $w2 = 0; - $i = 0; - $ry = 0; - while($istats['items'])) - { - if($this->stats['items'][$i]['inOdet']==3 && $w1==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28) - { - $w1 = $this->stats['items'][$i]; - }elseif($this->stats['items'][$i]['inOdet']==14 && $w2==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28) - { - $w2 = $this->stats['items'][$i]; - } - $i++; - } - if(isset($w1['id']) && $w1['inOdet']!=14) - { - $tp = 0; - $t = 0; - $i = 1; - $d = $this->lookStats($w1['data']); - $y = 0; - if(isset($d['sv_'.$v])) { - $y += $d['sv_'.$v]; - } - if(isset($this->stats[$v])) { - $y += $this->stats[$v]; - } - $ry = $y; - $r .= ''.$y.''; - }else{ - // - $r .= $this->stats[$v]; - $ry = $this->stats[$v]; - } - /* */ - if(isset($w2['id'])) - { - $tp = 0; - $t = 0; - $i = 1; - $d = $this->lookStats($w2['data']); - $y = @$this->stats[$v]+@$d['sv_'.$v]; - if($y!=$ry) - { - $r .= ' / '.$y.''; - }else{ - $r = str_replace('title="'.$w1['name'].'"','',$r); - } - } - // - } - return $r; - } - - public function timeOut($ttm) - { - $out = ''; - $time_still = $ttm; - $tmp = floor($time_still/2592000); - $id=0; - if ($tmp > 0) - { - $id++; - if ($id<3) {$out .= $tmp." . ";} - $time_still = $time_still-$tmp*2592000; - } - $tmp = floor($time_still/86400); - if ($tmp > 0) - { - $id++; - if ($id<3) {$out .= $tmp." . ";} - $time_still = $time_still-$tmp*86400; - } - $tmp = floor($time_still/3600); - if ($tmp > 0) - { - $id++; - if ($id<3) {$out .= $tmp." . ";} - $time_still = $time_still-$tmp*3600; - } - $tmp = floor($time_still/60); - if ($tmp > 0) - { - $id++; - if ($id<3) {$out .= $tmp." . ";} - } - if($out=='') - { - if($time_still<0) - { - $time_still = 0; - } - $out = $time_still.' .'; - } - return $out; - } - - public function rep_zv($id,$e) - { - if($id==1) - { - // - if($e>9999) - { - $r = ' , '.$e.' / ??'; - }elseif($e>999) - { - $r = ' , ' .$e.' / 9999'; - }elseif($e>99) - { - $r = ' , '.$e.' / 999'; - }else{ - $r = $e.' / 99'; - } - }elseif($id==2) - { - //Capital city - if($e>24999) - { - $r = ' , '.$e.' / ??'; - }elseif($e>9999) - { - $r = ' , '.$e.' / 24999'; - }else{ - $r = $e.' / 10000'; - } - }elseif($id==3) - { - //Angels city - if($e>24999) - { - $r = ' , '.$e.' / ??'; - }elseif($e>9999) - { - $r = ' , '.$e.' / 24999'; - }else{ - $r = $e.' / 10000'; - } - }elseif($id==4) - { - //Demons city - if($e>24999) - { - $r = ' , '.$e.' / ??'; - }elseif($e>9999) - { - $r = ' , '.$e.' / 24999'; - }else{ - $r = $e.' / 10000'; - } - }elseif($id==5) - { - // - if($e>99) - { - $r = ' '.$e.' / 999'; - }else{ - $r = $e.' / 99'; - } - }elseif($id==6) - { - //Sand - if($e>24999) - { - $r = ' , '.$e.' / ??'; - }elseif($e>9999) - { - $r = ' , '.$e.' / 24999'; - }else{ - $r = $e.' / 10000'; - } - }elseif($id==7) - { - //Sun - if($e>24999) - { - $r = ' , '.$e.' / ??'; - }elseif($e>9999) - { - $r = ' , '.$e.' / 24999'; - }else{ - $r = $e.' / 10000'; - } - }elseif($id==8) - { - //Moon - if($e>24999) - { - $r = ' , '.$e.' / ??'; - }elseif($e>9999) - { - $r = ' , '.$e.' / 24999'; - }else{ - $r = $e.' / 10000'; - } - }elseif($id==9) - { - //Dreams city - if($e>9999) - { - $r = ' , ['.$e.']'; - }elseif($e>4999) - { - $r = ' ,' .$e.' / 9999'; - }elseif($e>999) - { - $r = ' , '.$e.' / 4999'; - }else{ - $r = $e.' / 999'; - } - }elseif($id==10) { - // - if($e>9999) - { - $r = ' ,['.$e.']'; - }elseif($e>999) - { - $r = ' , '.$e.' / 4999'; - }else{ - $r = $e.' / 999'; - } - }elseif($id==11) - { - // - if($e>9999) - { - $r = ' , ['.$e.']'; - }elseif($e>4999) - { - $r = ' ,' .$e.' / 9999'; - }elseif($e>999) - { - $r = ' , '.$e.' / 4999'; - }else{ - $r = $e.' / 999'; - } - } - - return $r; - } - - public function getInfoById($id){ - $ch = mysql_fetch_array(mysql_query("SELECT `users`.*,`stats`.* FROM `users` INNER JOIN `stats` ON (`stats`.`id`=`users`.`id`) WHERE `users`.`id`='".$id."' OR - `users`.`login`= '".mysql_real_escape_string($id)."'")); - - - return $ch; - } - - public function addItem($id, $uid, $md = null, $dn = null, $mxiznos = null, $nosudba = null, $plavka = null) { - $rt = -1; - $i = mysql_fetch_array(mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp` FROM `items_main` AS `im` WHERE `im`.`id` = "'.mysql_real_escape_string($id).'" LIMIT 1')); - if(isset($i['id'])) - { - $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1')); - // - $data = $d['data']; - if($i['ts']>0) - { - if( $nosudba == NULL ) { - $ui = mysql_fetch_array(mysql_query('SELECT `id`,`login` FROM `users` WHERE `id` = "'.mysql_real_escape_string($uid).'" LIMIT 1')); - $data .= '|sudba='.$ui['login']; - } - } - if($md!=NULL) - { - $data .= $md; - $data = $this->lookStats($data); // SROK? - $data = $this->impStats($data); - } - - - if($dn!=NULL) - { - // - if($dn['dn_delete']>0) - { - $i['dn_delete'] = 1; - } - } - if($mxiznos > 0) { - $i['iznosMAXi'] = $mxiznos; - } - if($this->info['dnow'] > 0){ - $room = $this->room['city']; - }else { - $room = $this->info['city']; - } - $ins = mysql_query('INSERT INTO `items_users` (`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`,`dn_delete`) VALUES ( - "'.$i['overTypei'].'", - "'.$i['id'].'", - "'.$uid.'", - "'.$data.'", - "'.$i['iznosMAXi'].'", - "'.$i['geni'].'", - "'.$i['magic_inci'].'", - "'.$room.'", - "'.time().'", - "'.time().'", - "'.$i['dn_delete'].'")'); - if($ins) - { - $rt = mysql_insert_id(); - mysql_query('UPDATE `items_users` SET `dn_delete` = "1" WHERE `id` = "'.$rt.'" AND `data` LIKE "%dn_delete=%" LIMIT 1'); - if( $uid == $this->info['id'] ) { - $this->stack( $rt ); - } - $ads = ''; - if($plavka != null) { - $ads = ' : ['.$plavka.']'; - } - // - $ld = $this->addDelo(1,$uid,'"AddItems.'.$this->info['city'].'": "'.$i['name'].'" (x1) [#'.$i['iid'].']. '.$ads.'',time(),$this->info['city'],'AddItems.'.$this->info['city'].'',0,0); - }else{ - $rt = 0; - } - } - return $rt; - } - - public function getNum($v) - { - $plid = $v; - $pi = iconv_strlen($plid); - if($pi<5) - { - $i = 0; - while($i<=5-$pi) - { - $plid = '0'.$plid; - $i++; - } - } - return $plid; - } - - public function microLogin2($bus) { - $bus['login_BIG'] = ''; - if( $bus['align'] > 0 ) { - $bus['login_BIG'] .= ''; - } - if( $bus['align2'] > 0 ) { - $bus['login_BIG'] .= ''; - } - if( $bus['clan'] > 0 ) { - $bus['login_BIG'] .= ''; - } - $bus['login_BIG'] .= ''.$bus['login'].'['.$bus['level'].']'; - return $bus['login_BIG']; - } - - public function microLogin($id,$t,$nnz = 1) - { - global $c; - if($t==1) - { - $inf = mysql_fetch_array(mysql_query('SELECT - `u`.`id`, - `u`.`align`,`u`.`align2`, - `u`.`login`, - `u`.`clan`, - `u`.`level`, - `u`.`city`, - `u`.`online`, - `u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`, - `u`.`cityreg`, - `u`.`palpro`, - `u`.`invis`, - `st`.`hpNow` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($id).'" OR `u`.`login` = "'.mysql_real_escape_string((int)$id).'" LIMIT 1')); - }else{ - $inf = $id; - $id = $inf['id']; - } - $r = ''; - if(isset($inf['id']) && ( ($inf['invis'] < time() && $inf['invis'] != 1) || ($this->info['id'] == $inf['id'] && $nnz == 1) )) - { - if($inf['align']>0) - { - $r .= ''; - } - if($inf['align2']>0) - { - $r .= ''; - } - if($inf['clan']>0) - { - $cln = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`name_mini`,`align`,`type_m`,`money1`,`exp` FROM `clan` WHERE `id` = "'.$inf['clan'].'" LIMIT 1')); - if(isset($cln['id'])) - { - $r .= ''; - } - } - if($inf['cityreg'] == '') { - $inf['cityreg'] = 'capitalcity'; - } - $r .= ' '.$inf['login'].' ['.$inf['level'].']'; - }else{ - $r = ' [??]'; - } - return $r; - } - - public function testHome() - { - /*----()----*/ - $timeforwait = 3600; - if(isset($st['os3']) && $st['os3']>0) { - $timeforwait = 3600-(($st['os6']*5)*60); - } - /*----()----*/ - $hgo = $this->testAction('`uid` = "'.$this->info['id'].'" AND `time` >= '.(time()-$timeforwait).' AND `vars` = "go_homeworld" LIMIT 1',1); - if($this->info['level']==0 || $this->info['active']!='' || $this->info['inTurnir'] > 0 || $this->info['inTurnirnew'] > 0 || $this->info['zv'] > 0 || $this->info['dnow'] > 0) { - $hgo['id'] = true; - } - if(isset($this->info['noreal']) || $this->info['dnow'] > 0) { - $hgo['id'] = true; - } - if(!isset($hgo['id'])) { - $ku = mysql_fetch_array(mysql_query('SELECT `id` FROM `katok_zv` WHERE `uid` = "'.$this->info['id'].'" LIMIT 1')); - if(isset($ku['id'])) { - $hgo['id'] = true; - } - } - return $hgo; - } - - public function telegram($uid,$text,$type = 1,$from = NULL) - { - if(!(int)$uid) - { - $uid = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "'.mysql_real_escape_string($uid).'" LIMIT 1')); - $uid = $uid['id']; - } - $r = 0; - if($uid>0) - { - if($from == NULL) - { - $from = $this->info['login']; - } - $ins = mysql_query('INSERT INTO `telegram` (`uid`,`from`,`time`,`fromType`,`text`) VALUES ("'.mysql_real_escape_string($uid).'","'.mysql_real_escape_string($from).'","'.time().'","'.mysql_real_escape_string($type).'","'.mysql_real_escape_string(htmlspecialchars($text,NULL,'cp1251')).'")'); - if($ins) - { - $r = 1; - }else{ - $r = -2; - } - }else{ - $r = -1; - } - return $r; - } - - public function functionThisData() { - // - - } - - private function __construct() - { - global $c,$code,$magic; - - $this->info = mysql_fetch_array(mysql_query(' -SELECT - `u`.`nextBonus`, - `u`.`mat`, - `u`.`skype`, - `u`.`skype_hide`, - `u`.`stopexp`, - `u`.`twink`, - `u`.`swin`, - `u`.`slose`, - `u`.`send`, - `u`.`activ`, - `u`.`b1`, - `u`.`nadmin`, - `u`.`fnq`, - `u`.`id`, - `u`.`login`, - `u`.`login2`, - `u`.`pass`, - `u`.`pass2`, - `u`.`repass`, - `u`.`notrhod`, - `u`.`emailconfirmation`, - `u`.`securetime`, - `u`.`sys`, - `u`.`palpro`, - `u`.`online`, - `u`.`ip`, - `u`.`ipreg`, - `u`.`joinIP`, - `u`.`admin`, - `u`.`city`, - `u`.`room`, - `u`.`banned`, - `u`.`auth`, - `u`.`align`, - `u`.`align2`, - `u`.`align_lvl`, - `u`.`align_exp`, - `u`.`mod_zvanie`, - `u`.`clan`, - `u`.`nextMsg`, - `u`.`molch1`, - `u`.`molch2`, - `u`.`molch3`, - `u`.`level`, - `u`.`money`, - `u`.`money2`, - `u`.`money4`, - `u`.`money3`, - `u`.`money3`, - `u`.`battle`, - `u`.`cityreg`, - `u`.`invBlock`, - `u`.`allLock`, - `u`.`invBlockCode`, - `u`.`zag`, - `u`.`a1`, - `u`.`q1`, - `u`.`mail`, - `u`.`name`, - `u`.`bithday`, - `u`.`sex`, - `u`.`design`, - `u`.`autospell`, - `u`.`noplaw`, - `u`.`city_real`, - `u`.`icq`, - `u`.`icq_hide`, - `u`.`homepage`, - `u`.`deviz`, - `u`.`hobby`, - `u`.`chatColor`, - `u`.`timereg`, - `u`.`add_smiles`, - `u`.`obraz`, - `u`.`win`, - `u`.`lose`, - `u`.`nich`, - `u`.`cityreg2`, - `u`.`host`, - `u`.`info_delete`, - `u`.`dateEnter`, - `u`.`afk`, - `u`.`dnd`, - `u`.`timeMain`, - `u`.`clan_prava`, - `u`.`addpr`, - `u`.`marry`, - `u`.`city2`, - `u`.`invis`, - `u`.`bot_id`, - `u`.`haos`, - `u`.`host_reg`, - `u`.`inUser`, - `u`.`inTurnir`, - `u`.`inTurnirnew`, - `u`.`jail`, - `u`.`animal`, - `u`.`vip`, - `u`.`catch`, - `u`.`frg`, - `u`.`no_ip`, - `u`.`type_pers`, - `u`.`bot_room`, - `u`.`clan_delay`, - `u`.`bukmeker`, - `u`.`ang_g`, - `st`.`id`, - `st`.`lider`, - `st`.`btl_cof`, - `st`.`last_hp`, - `st`.`last_pr`, - `st`.`smena`, - `st`.`stats`, - `st`.`hpAll`, - `st`.`mpAll`, - `st`.`hpNow`, - `st`.`mpNow`, - `st`.`enNow`, - `st`.`transfers`, - `st`.`regHP`, - `st`.`regMP`, - `st`.`showmenu`, - `st`.`prmenu`, - `st`.`ability`, - `st`.`skills`, - `st`.`sskills`, - `st`.`nskills`, - `st`.`exp`, - `st`.`minHP`, - `st`.`minMP`, - `st`.`zv`, - `st`.`dn`, - `st`.`dnow`, - `st`.`team`, - `st`.`battle_yron`, - `st`.`battle_exp`, - `st`.`enemy`, - `st`.`last_a`, - `st`.`last_b`, - `st`.`battle_text`, - `st`.`upLevel`, - `st`.`wipe`, - `st`.`bagStats`, - `st`.`timeGo`, - `st`.`timeGoL`, - `st`.`nextAct`, - `st`.`active`, - `st`.`bot`, - `st`.`lastAlign`, - `st`.`tactic1`, - `st`.`tactic2`, - `st`.`tactic3`, - `st`.`tactic4`, - `st`.`tactic5`, - `st`.`tactic6`, - `st`.`tactic7`, - `st`.`x`, - `st`.`y`, - `st`.`s`, - `st`.`battleEnd`, - `st`.`priemslot`, - `st`.`priems`, - `st`.`priems_z`, - `st`.`bet`, - `st`.`clone`, - `st`.`atack`, - `st`.`bbexp`, - `st`.`ref_data`, - `st`.`res_x`, - `st`.`res_y`, - `st`.`res_s`, - `st`.`bn_capitalcity`, - `st`.`bn_demonscity`, - `r`.`noatack` -FROM - `users` AS `u` - LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) - LEFT JOIN `room` AS `r` ON (`u`.`room` = `r`.`id`) -WHERE - `u`.`login`="'.mysql_real_escape_string($_COOKIE['login']).'" AND - `u`.`pass`="'.mysql_real_escape_string($_COOKIE['pass']).'" - LIMIT 1')); - - - if( $c['securetime'] > 0 ) { - if(!defined('IP')) { - $dip = ''; - if (!empty($_SERVER['HTTP_CLIENT_IP'])) - $dip = $_SERVER['HTTP_CLIENT_IP']; - else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) - $dip = $_SERVER['HTTP_X_FORWARDED_FOR']; - $dip = $_SERVER['REMOTE_ADDR']; - define('IP',$dip); - } - - if( isset($this->info['id']) && ($this->info['ip'] != IP || $this->info['banned'] > 0) ) { - if( $_SERVER['REQUEST_URI'] != '/' ) { - unset($this->info, $_COOKIE['login'], $_COOKIE['pass']); - die(''); - } - } - } - - if(isset($this->info['id'])) { - if( $this->info['exp'] > 300000 && $this->info['twink'] > 0 ) { - $this->info['exp'] = 300000; - mysql_query('UPDATE `users` SET `exp` = '.$this->info['exp'].' WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - } - - if(isset($this->info['id']) && $this->info['inUser']) - { - $md = array($this->info['molch1'],$this->info['molch2'],$this->info['molch3'],$this->info['admin'],$this->info['nadmin'],$this->info['banned'],$this->info['activ'],$this->info['align'],$this->info['id'],$this->info['level']); - $this->info = mysql_fetch_array(mysql_query('SELECT - `u`.`nextBonus`,`u`.`mat`,`u`.`skype`,`u`.`skype_hide`,`u`.`stopexp`,`u`.`twink`,`u`.`swin`,`u`.`slose`,`u`.`activ`,`u`.`nadmin`,`u`.`b1`,`u`.`fnq`,`u`.`id`,`u`.`login`,`u`.`login2`,`u`.`pass`,`u`.`pass2`,`u`.`repass`,`u`.`notrhod`,`u`.`emailconfirmation`,`u`.`securetime`,`u`.`sys`,`u`.`palpro`,`u`.`online`,`u`.`ip`,`u`.`ipreg`,`u`.`joinIP`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`banned`,`u`.`auth`,`u`.`align`,`u`.`align2`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`mod_zvanie`,`u`.`clan`,`u`.`nextMsg`,`u`.`molch1`,`u`.`molch2`,`u`.`molch3`,`u`.`level`,`u`.`money`,`u`.`money2`,`u`.`money4`,`u`.`money3`,`u`.`battle`,`u`.`cityreg`,`u`.`invBlock`,`u`.`allLock`,`u`.`invBlockCode`,`u`.`zag`,`u`.`a1`,`u`.`q1`,`u`.`mail`,`u`.`name`,`u`.`bithday`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`city_real`,`u`.`icq`,`u`.`icq_hide`,`u`.`homepage`,`u`.`deviz`,`u`.`hobby`,`u`.`chatColor`,`u`.`timereg`,`u`.`add_smiles`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`cityreg2`,`u`.`host`,`u`.`info_delete`,`u`.`dateEnter`,`u`.`afk`,`u`.`dnd`,`u`.`timeMain`,`u`.`clan_prava`,`u`.`addpr`,`u`.`marry`,`u`.`city2`,`u`.`invis`,`u`.`bot_id`,`u`.`haos`,`u`.`host_reg`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`jail`,`u`.`animal`,`u`.`vip`,`u`.`catch`,`u`.`frg`,`u`.`no_ip`,`u`.`type_pers`,`u`.`bot_room`,`u`.`clan_delay`,`u`.`bukmeker`, - `st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity` - FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($this->info['inUser']).'" LIMIT 1')); - if($this->info['molch1'] < $md[0]) { - $this->info['molch1'] = $md[0]; - } - if($this->info['molch2'] < $md[1]) { - $this->info['molch2'] = $md[1]; - } - if($this->info['molch3'] < $md[2]) { - $this->info['molch3'] = $md[2]; - } - if($this->info['admin'] < $md[3]) { - $this->info['admin'] = $md[3]; - } - if($this->info['nadmin'] < $md[4]) { - $this->info['nadmin'] = $md[4]; - } - if($this->info['banned'] < $md[5]) { - $this->info['banned'] = $md[5]; - } - $this->info['activ'] = $md[6]; - $this->info['noreal'] = 1; - $this->info['align_real'] = $md[7]; - $this->info['__id'] = $md[8]; - $this->info['__level'] = $md[9]; - } - - if($this->info['battle'] != $_COOKIE['btl']) { - setcookie('btl',$this->info['battle'],time()+86400); - } - - // - /*if($this->info['banned'] == 7007001) { - $spm_url = mysql_fetch_array(mysql_query('SELECT * FROM `_spamer` WHERE `host` = "'.$this->info['host'].'" LIMIT 1')); - if(isset($spm_url['id'])) { - die(''); - }else{ - die(''); - } - }*/ - - if(!isset($this->info['id'])) - { - $this->info = mysql_fetch_array(mysql_query('SELECT - `u`.`nadmin`,`u`.`id`,`u`.`login`,`u`.`login2`,`u`.`pass`,`u`.`pass2`,`u`.`repass`,`u`.`notrhod`,`u`.`emailconfirmation`,`u`.`securetime`,`u`.`sys`,`u`.`palpro`,`u`.`online`,`u`.`ip`,`u`.`ipreg`,`u`.`joinIP`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`banned`,`u`.`auth`,`u`.`align`,`u`.`align2`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`mod_zvanie`,`u`.`clan`,`u`.`nextMsg`,`u`.`molch1`,`u`.`molch2`,`u`.`molch3`,`u`.`level`,`u`.`money`,`u`.`money2`,`u`.`money4`,`u`.`money3`,`u`.`battle`,`u`.`cityreg`,`u`.`invBlock`,`u`.`allLock`,`u`.`invBlockCode`,`u`.`zag`,`u`.`a1`,`u`.`q1`,`u`.`mail`,`u`.`name`,`u`.`bithday`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`city_real`,`u`.`icq`,`u`.`icq_hide`,`u`.`homepage`,`u`.`deviz`,`u`.`hobby`,`u`.`chatColor`,`u`.`timereg`,`u`.`add_smiles`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`cityreg2`,`u`.`host`,`u`.`info_delete`,`u`.`dateEnter`,`u`.`afk`,`u`.`dnd`,`u`.`timeMain`,`u`.`clan_prava`,`u`.`addpr`,`u`.`marry`,`u`.`city2`,`u`.`invis`,`u`.`bot_id`,`u`.`haos`,`u`.`host_reg`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`jail`,`u`.`animal`,`u`.`vip`,`u`.`catch`,`u`.`frg`,`u`.`no_ip`,`u`.`type_pers`,`u`.`bot_room`,`u`.`clan_delay`,`u`.`bukmeker` - FROM `users` AS `u` WHERE `u`.`login`="'.mysql_real_escape_string($_COOKIE['login']).'" AND `u`.`pass`="'.mysql_real_escape_string($_COOKIE['pass']).'" LIMIT 1')); - if($this->info['dateEnter']!=$_SERVER['HTTP_USER_AGENT']) - { - unset($this->info); - } - $this->btl_txt = $this->info['battle_text']; - if(!isset($this->info['id'])) - { - unset($this->info); - setcookie('login','',time()-60*60*24,'',$c['host']); - setcookie('pass','',time()-60*60*24,'',$c['host']); - }else{ - echo 'stats is lost.'; - } - } - - if(isset($this->info['id'])) { - if($this->info['invis'] == 1 || $this->info['invis'] > time()) { - $this->info['cast_login'] = ''; - }else{ - $this->info['cast_login'] = $this->info['login']; - } - } - - if(isset($this->info['id']) && $this->info['battle'] == 0) - { - $sb = mysql_fetch_array(mysql_query('SELECT SUM(`money2`) FROM `bank` WHERE `uid` = "'.$this->info['id'].'" LIMIT 100')); - $sb = $sb[0]; - - if($sb-1 > $this->info['catch']-$this->info['frg']) { - if($this->info['frg'] == -1) { - $sm = $this->testAction('`uid` = "'.$this->info['id'].'" AND `vars` = "frg" LIMIT 1',1); - } - if(!isset($sm['id']) && $this->info['frg']==-1) { - mysql_query('UPDATE `users` SET `catch` = "'.round($sb).'",`frg` = "0" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - $this->addAction(time(),'frg','[ '.$this->info['login'].' ] '.date('d.m.Y H:i:s').' [true] , balance: '.$sb.' / '.$this->info['catch'].' / '.$this->info['frg'].' '); - }else{ - mysql_query('UPDATE `users` SET `catch` = "'.round($sb+$this->info['frg']).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - if($sb-10 > $this->info['catch']-$this->info['frg']) { - $this->addAction(time(),'frgfalse','[ '.$this->info['login'].' ] '.date('d.m.Y H:i:s').' [false] , ['.($sb-($this->info['catch']-$this->info['frg'])).'] , balance: '.$sb.' | '.$this->info['catch'].' | '.$this->info['frg'].' '); - } - } - } - - if($this->info['login2']!='' && $this->info['battle']==0 && $this->info['zv']==0) { - mysql_query('UPDATE `users` SET `login2` = "" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - $this->info['login2'] = ''; - } - - $this->rep = mysql_fetch_array(mysql_query('SELECT - `add_slot`,`nu_sandcity`,`n_sandcity`, - `dl1`,`id`,`rep1`,`rep2`,`repcapitalcity`,`repdemonscity`,`repangelscity`,`repabandonedplain`, - `repdevilscity`,`repmooncity`,`repsuncity`,`repsandcity`,`repemeraldscity`,`repdreamscity`,`repizlom`, - `n_capitalcity`,`n_demonscity`,`n_suncity`,`nu_demonscity`,`nu_angelscity`,`nu_abandonedplain`, - `nu_capitalcity`,`nu_suncity`,`nu_devilscity`,`nu_dreamscity`,`add_stats`,`add_money`,`add_skills`,`add_skills2`, - `rep3`,`rep3_buy`,`repdragonscity`,`n_dragonscity`,`nu_dragonscity`, - (`repcapitalcity`+`repdemonscity`+`repangelscity`+`repsuncity`+`repdreamscity`+`repabandonedplain`+`repsandcity`+`repemeraldscity`) as allrep, - (`nu_capitalcity`+`nu_demonscity`+`nu_angelscity`+`nu_suncity`+`nu_dreamscity`+`nu_abandonedplain`+`nu_sandcity`+`nu_emeraldscity`) as allnurep - FROM `rep` WHERE `id` = "'.$this->info['id'].'" LIMIT 1')); - - - if(!isset($this->rep['id'])){ - mysql_query('INSERT INTO `rep` (`id`) VALUES ('.$this->info['id'].')'); - } - if($this->info['login2'] != '' && $this->info['zv'] == 0 && $this->info['battle'] == 0) { - $this->info['login2'] = ''; - mysql_query('UPDATE `users` SET `login2` = "" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - /* */ - /*$i = $this->testAction('`time` >= "'.(time()-7129).'" AND `vars` = "reclama1" LIMIT 1',1); - if(!isset($i['id'])) - { - $this->addAction(time(),'reclama1',''); - // - $t6 = array('',''); - if(date('N') == 1) { - // - $t6[0] = ' '; - }elseif(date('N') == 2) { - // - $t6[0] = ''; - }elseif(date('N') == 3) { - // - if(date('H')<20) { - $t6[0] = ''; - }else{ - $t6[0] = ' '; - } - }elseif(date('N') == 4) { - // - $t6[0] = ''; - }elseif(date('N') == 5) { - // - if(date('H')<20) { - $t6[0] = ''; - }else{ - $t6[0] = ' '; - } - }elseif(date('N') == 6) { - // - $t6[0] = ''; - }elseif(date('N') == 7) { - // - if(date('H')<20) { - $t6[0] = ''; - }else{ - $t6[0] = ' '; - } - } - $r = '! '.$t6[0].' ( 20:00 ). Alexandr Events.new-combats.com'; - // - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','".$r."','".time()."','6','0')"); - } - */ - /* - // - mysql_query('LOCK TABLES users,stats,chat,room,test_bot,battle WRITE'); - $dasc = array('ASC','DESC'); - $sp = mysql_query('SELECT `u`.`id`,`u`.`bot_room`,`s`.`atack`,`u`.`type_pers`,`s`.`bbexp`,`s`.`timeGo`,`s`.`timeGoL`,`u`.`login`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`align`,`u`.`align2`,`u`.`clan`,`u`.`room`,`u`.`level`,`u`.`battle`,`s`.`hpNow`,`s`.`mpNow`,`s`.`team`,`u`.`city` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`type_pers` > 0 AND `s`.`timeGo` < '.time().' AND `s`.`timeGoL` < '.time().' ORDER BY `s`.`timeGoL` '.$dasc[rand(0,1)].' LIMIT 11'); - while($pl = mysql_fetch_array($sp)) { - if($pl['type_pers']>0 && $pl['battle'] == 0) { - // - if($pl['timeGo'] 0 AND `close` = 0 AND `destroy` = 0 LIMIT 1')); - if(isset($rmgo['id'])) { - $pl['room'] = $rmgo['id']; - mysql_query('UPDATE `users` SET `room` = "'.$rmgo['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `timeGo` = "'.(time()+rand(60,240)).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - } - } - if($pl['type_pers']>1 && $pl['battle'] == 0 && $pl['timeGoL'] 6 AND `u`.`online` > "'.(time()-10).'" AND `u`.`banned` = "0" LIMIT 5'); - while($plu = mysql_fetch_array($spu)) { - if($plu['battle'] == 0) { - $ru[count($ru)] = $plu['id']; - $rs[$plu['id']] = $plu; - } - } - $ru = $ru[rand(0,count($ru)-1)]; - if($ru > 0 && rand(0,10000) < 2500) { - // - if($pl['timeGoL'] < time()) { - // - $atc = $magic->atackUser($pl['id'],$ru,$rs[$ru]['team'],$rs[$ru]['battle'],$pl['bbexp']); - if($atc == 1) { - $rs[$ru] = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`battle`,`s`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`room` = "'.$pl['room'].'" AND `u`.`city` = "'.$pl['city'].'" AND `u`.`type_pers` = 0 AND `s`.`bot` = 0 AND `u`.`id` != "'.$pl['id'].'" AND `u`.`level` > 6 AND `u`.`online` > "'.(time()-60).'" AND `u`.`banned` = "0" AND `u`.`id` = "'.$rs[$ru]['id'].'" LIMIT 1')); - $pl['battle'] = $rs[$ru]['battle']; - if($rs[$ru]['team'] == 1) { - $pl['team'] = 2; - }else{ - $pl['team'] = 1; - } - mysql_query('UPDATE `users` SET `battle` = "'.$pl['battle'].'",`team` = "'.$pl['team'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','! ".$pl['login']." ".$rs[$ru]['login']."...','".time()."','6','0')"); - $sx = ''; - if($pl['sex'] == 1) { - $sx = ''; - } - $rtxt = '[img[items/pal_button8.gif]] "!'.$pl['login'].'" '.$sx.' "'.$rs[$ru]['login'].'".'; - mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('".$pl['city']."','','','','".$rtxt."','".time()."','7','0','1','1')"); - }else{ - //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','! ".$pl['login']." ".$rs[$ru]['login']."...','".time()."','6','0')"); - } - }else{ - // - mysql_query('UPDATE `stats` SET `timeGoL` = "'.(time()+rand(30,520)).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - } - } - - if($pl['type_pers']>2) { - if($pl['battle'] > 0) { - // - $btlu = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `time_over` = 0 AND `id` = "'.$pl['battle'].'" LIMIT 1')); - if(!isset($btlu['id'])) { - // - mysql_query('UPDATE `users` SET `battle` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - //mysql_query('UPDATE `stats` SET `atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - }else{ - // - if($pl['atack'] < time()) { - //mysql_query('UPDATE `stats` SET `atack` = "'.(time()+123456789).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - } - }else{ - // - if($pl['atack'] > time()) { - //mysql_query('UPDATE `stats` SET `atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - - // - if($pl['hpNow'] < 1) { - if($pl['bot_room'] > 0) { - // " " - mysql_query('UPDATE `users` SET `room` = "'.$pl['bot_room'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - mysql_query('UPDATE `stats` SET `hpNow` = "1",`mpNow` = "1",`team` = "0",`timeGoL` = "'.(time()+rand(60,240)).'",`atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','! ".$pl['login']." ".$this->city_name[$pl['city']]."...','".time()."','6','0')"); - }else{ - // - mysql_query('UPDATE `stats` SET `hpNow` = "1000000000",`mpNow` = "1000000000",`team` = "0",`timeGoL` = "'.(time()+rand(60,240)).'",`atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - }elseif($pl['bot_room'] > 0 && $pl['room'] == $pl['bot_room']) { - $btst = $this->getStats($pl['id']); - if($btst['hpAll'] <= $btst['hpNow'] && $btst['mpAll'] <= $btst['mpNow']) { - mysql_query('UPDATE `stats` SET `hpNow` = "'.$btst['hpAll'].'",`mpNow` = "'.$btst['mpAll'].'",`team` = "0",`timeGoL` = "'.(time()+rand(60,240)).'",`atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - $nrm = mysql_fetch_array(mysql_query('SELECT `id` FROM `room` WHERE `name` = " " AND `city` = "'.$pl['city'].'" LIMIT 1')); - mysql_query('UPDATE `users` SET `room` = "'.(0+$nrm['id']).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','! ".$pl['login']." " " ".$this->city_name[$pl['city']]."...','".time()."','6','0')"); - unset($nrm); - }else{ - // - - } - unset($btst); - } - } - } - } - mysql_query('UNLOCK TABLES'); - unset($pl,$sp,$plu,$spu,$atc,$ru,$rs); - /* - $upd = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "" AND `online` < '.(time()-604800).' LIMIT 1')); - if(isset($upd['id'])) - { - mysql_query('UPDATE `users` SET `online` = "'.(time()+600).'" WHERE `id` = "'.$upd['id'].'" LIMIT 1'); - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','! Capital City! !','-1','5','0')"); - unset($upd); - } - */ - - if(isset($_GET['homeworld'])) - { - if($this->info['zv']==0 && $this->info['battle']==0 && $this->info['dnow']==0) - { - $hgo = $this->testHome(); - if(!isset($hgo['id']) && $this->info['room'] != 274 && $this->info['align']!=2 && $this->info['inTurnir'] == 0) - { - $this->addAction(time(),'go_homeworld',''); - $rmt = mysql_fetch_array(mysql_query('SELECT `id`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee` FROM `room` WHERE `name` = " " AND `city` = "'.$this->info['city'].'" LIMIT 1')); - if(isset($rmt['id'])) - { - // - if( $this->room['file'] == 'bsenter' ) { - // - $sp_bs = mysql_query('SELECT `id`,`bsid`,`money` FROM `bs_zv` WHERE `uid` = "'.$this->info['id'].'" AND `inBot` = "0" AND `finish` = "0"'); - while( $pl_bs = mysql_fetch_array($sp_bs) ) { - mysql_query('UPDATE `bs_turnirs` SET `users` = `users` - 1 WHERE `id` = "'.$pl_bs['bsid'].'" LIMIT 1'); - } - unset($sp_bs,$pl_bs); - mysql_query('UPDATE `bs_zv` SET `finish` = "'.time().'" WHERE `uid` = "'.$this->info['id'].'" AND `inBot` = "0" AND `finish` = "0"'); - } - $this->info['room'] = $rmt['id']; - mysql_query('UPDATE `users` SET `room` = "'.$this->info['room'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - - }else{ - $this->error = ' '; - } - unset($rmt); - }else{ - $this->error = ' '; - } - unset($hgo); - } - } - - // - if(isset($_GET['itmid']) && isset($_GET['addtext'])) { - $itm = mysql_fetch_array(mysql_query('SELECT - `i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl` - ,`m`.`max_text` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE `i`.`id` = "'.mysql_real_escape_string($_GET['itmid']).'" LIMIT 1')); - if(isset($itm['id'])) { - if($itm['max_text'] > 0 && $itm['max_text']-$itm['use_text'] > 0) { - $txt = $_GET['addtext']; - $txt = str_replace(' ','',$txt); - $txt = str_replace(' ','',$txt); - if($txt != '') { - $txt = substr($_GET['addtext'],0,$itm['max_text']-$itm['use_text']); - $sx = iconv_strlen($txt); - $itm['use_text'] += $sx; - if($itm['use_text'] > $itm['max_text']) { - $itm['use_text'] = $itm['max_text']; - } - - mysql_query('UPDATE `items_users` SET `use_text` = "'.$itm['use_text'].'" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - mysql_query('INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`) VALUES ("'.$itm['id'].'","'.time().'","'.$this->info['login'].'","'.mysql_real_escape_string(htmlspecialchars($txt,NULL,'cp1251')).'","'.$this->info['city'].'","'.$sx.'")'); - $this->error = ' '; - }else{ - $this->error = ' - ...'; - } - }else{ - $this->error = ' '; - } - }else{ - $this->error = ' '; - } - } - - // - if(isset($_POST['trnLogin'],$_GET['transfer']) && $this->info['battle']==0) { - if($this->info['level']<4 && $this->info['admin']==0) { - $this->error = ' 4- '; - } elseif($this->info['align']==2 && $this->info['admin']==0) { - $this->error = ' '; - } else { - $t = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`login2`,`pass`,`pass2`,`emailconfirmation`,`securetime`,`sys`,`online`,`ip`,`ipreg`,`joinIP`,`admin`,`city`,`room`,`banned`,`auth`,`align`,`mod_zvanie`,`clan`,`nextMsg`,`molch1`,`molch2`,`molch3`,`level`,`money`,`battle`,`cityreg`,`invBlock`,`invBlockCode`,`zag`,`a1`,`q1`,`mail`,`name`,`bithday`,`sex`,`city_real`,`icq`,`icq_hide`,`homepage`,`deviz`,`hobby`,`chatColor`,`timereg`,`add_smiles`,`obraz`,`win`,`lose`,`nich`,`cityreg2`,`host`,`info_delete`,`dateEnter`,`afk`,`dnd`,`timeMain`,`clan_prava`,`addpr`,`marry`,`city2`,`invis`,`bot_id`,`haos`,`host_reg`,`inUser`,`jail`,`animal`,`vip`,`catch`,`frg`,`no_ip`,`type_pers`,`bot_room` FROM `users` WHERE `login` = "'.mysql_real_escape_string($_POST['trnLogin']).'" AND `city` = "'.$this->info['city'].'" LIMIT 1')); - if(isset($t['id'])) - { - if($this->info['login']==$t['login']) { - $this->error = ' , '.$this->microLogin($t['id'],1).''; - }elseif($t['battle']>0) - { - $this->error = ' '; - }elseif($t['level']<4 && $this->info['admin']==0) - { - $this->error = ' 4- '; - }elseif($t['align']==2 && $this->info['admin']==0) - { - $this->error = ' '; - }elseif($t['room']!=$this->info['room']) - { - $this->error = ' '; - }else{ - // - $tt = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`uid1`,`uid2`,`city`,`room`,`good1`,`good2`,`cancel1`,`cancel2`,`money1`,`money2`,`start1`,`start2`,`text`,`r0`,`r1`,`r2`,`finish1`,`finish2` FROM `transfers` WHERE (`uid1` = "'.$this->info['id'].'" OR `uid2` = "'.$this->info['id'].'") AND (`cancel1` = "0" OR (`finish1` > 0 AND `uid1` = "'.$this->info['id'].'") OR (`finish2` > 0 AND `uid2` = "'.$this->info['id'].'")) AND (`cancel2` = "0" OR (`finish2` > 0 AND `uid2` = "'.$this->info['id'].'") OR (`finish1` > 0 AND `uid1` = "'.$this->info['id'].'")) ORDER BY `id` DESC LIMIT 1')); - if(isset($tt['id'])) - { - $this->error = ' '; - }else{ - $tt = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`uid1`,`uid2`,`city`,`room`,`good1`,`good2`,`cancel1`,`cancel2`,`money1`,`money2`,`start1`,`start2`,`text`,`r0`,`r1`,`r2`,`finish1`,`finish2` FROM `transfers` WHERE (`uid1` = "'.$t['id'].'" OR `uid2` = "'.$t['id'].'") AND (`cancel1` = "0" OR (`finish1` > 0 AND `uid1` = "'.$t['id'].'") OR (`finish2` > 0 AND `uid2` = "'.$t['id'].'")) AND (`cancel2` = "0" OR (`finish2` > 0 AND `uid2` = "'.$t['id'].'") OR (`finish1` > 0 AND `uid1` = "'.$t['id'].'")) ORDER BY `id` DESC LIMIT 1')); - if(isset($tt['id'])) - { - $this->error = ' '; - }else{ - $ins = mysql_query('INSERT INTO `transfers` (`uid1`,`uid2`,`city`,`room`,`time`,`text`,`start1`) VALUES ("'.$this->info['id'].'","'.$t['id'].'","'.$this->info['city'].'","'.$this->info['room'].'","'.time().'","'.mysql_real_escape_string(htmlspecialchars($_POST['textarea'],NULL,'cp1251')).'","'.time().'")'); - if($ins) - { - $this->addAction(time(),'trasfer_'.$this->info['city'].'_'.$this->info['room'].'_'.$t['id'].'',$this->info['login']); - } - } - } - } - }else{ - $this->error = ' '; - } - } - } - - // - $this->tfer = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`uid1`,`uid2`,`city`,`room`,`good1`,`good2`,`cancel1`,`cancel2`,`money1`,`money2`,`start1`,`start2`,`text`,`r0`,`r1`,`r2`,`finish1`,`finish2` FROM `transfers` WHERE (`uid1` = "'.$this->info['id'].'" OR `uid2` = "'.$this->info['id'].'") AND (`cancel1` = "0" OR (`finish1` > 0 AND `uid1` = "'.$this->info['id'].'") OR (`finish2` > 0 AND `uid2` = "'.$this->info['id'].'")) AND (`cancel2` = "0" OR (`finish2` > 0 AND `uid2` = "'.$this->info['id'].'") OR (`finish1` > 0 AND `uid1` = "'.$this->info['id'].'")) ORDER BY `id` DESC LIMIT 1')); - if($this->tfer['uid1'] == $this->tfer['uid2']) { - $this->tfer = false; - } - if(isset($this->tfer['id'])) - { - if($this->tfer['cancel1']==0 && $this->tfer['cancel2']==0) - { - if($this->tfer['uid2']==$this->info['id'] && $this->tfer['start2']==0 && isset($_GET['transfer'])) - { - $this->tfer['start2'] = time(); - mysql_query('UPDATE `transfers` SET `start2` = "'.$this->tfer['start2'].'" WHERE `id` = "'.$this->tfer['id'].'" LIMIT 1'); - } - if($this->tfer['uid2']==$this->info['id'] && $this->tfer['start2']==0) - { - $this->tfer = false; - }elseif($this->tfer['time']tfer,$upd); - } - }elseif($this->info['room']!=$this->tfer['room'] || $this->info['city']!=$this->tfer['city'] || $this->info['battle']>0) - { - $upd = mysql_query('UPDATE `transfers` SET `cancel1` = "'.time().'",`cancel2` = "'.time().'" WHERE `id` = "'.$this->tfer['id'].'" LIMIT 1'); - if($upd) - { - - - - - - mysql_query('UPDATE `items_users` SET `inTransfer` = "0" WHERE (`uid` = "'.$this->tfer['uid1'].'" OR `uid` = "'.$this->tfer['uid2'].'") AND `inTransfer` > 0'); - unset($this->tfer,$upd); - } - }elseif(isset($_GET['exit_transfer'])) - { - $upd = 1; - if($this->tfer['uid2']==$this->info['id']) - { - $upd = 2; - } - $upd = mysql_query('UPDATE `transfers` SET `cancel'.$upd.'` = "'.time().'" WHERE `id` = "'.$this->tfer['id'].'" LIMIT 1'); - if($upd) - { - - $this->error = ' .'; - - - - mysql_query('UPDATE `items_users` SET `inTransfer` = "0" WHERE (`uid` = "'.$this->tfer['uid1'].'" OR `uid` = "'.$this->tfer['uid2'].'") AND `inTransfer` > 0'); - // - if($this->tfer['start2']>0) - { - - - - - } - unset($this->tfer,$upd); - } - }else{ - if($this->tfer['uid1']==$this->info['id']) - { - // - - }elseif($this->tfer['uid2']==$this->info['id']) - { - // - - } - } - } - } - - /* - - */ - - // - $stat = $this->testAction('`uid` = "'.$this->info['id'].'" AND `time` >= '.strtotime('now 00:00:00').' AND `vars` = "statistic_today" LIMIT 1',1); - if(!isset($stat['id'])) - { - $this->addAction(time(),'statistic_today','e='.$this->info['exp'].'|w='.$this->info['win'].'|l='.$this->info['lose'].'|n='.$this->info['nich']); - } - - // - if(isset($_GET['usec1']) && $this->info['battle']==0) - { - $cmp = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`type`,`val`,`name`,`time`,`delete` FROM `save_com` WHERE `uid` = "'.$this->info['id'].'" AND `delete` = "0" AND `id` = "'.mysql_real_escape_string($_GET['usec1']).'" LIMIT 1')); - if(isset($cmp['id'])) - { - // - mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE `uid` = "'.$this->info['id'].'"'); - // , - $cm = $this->lookStats($cmp['val']); - $i = 1; - while($i<=250) - { - if(isset($cm[$i])) - { - mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE `uid` = "'.$this->info['id'].'" AND `inOdet` = "'.$i.'"'); - mysql_query('UPDATE `items_users` SET `inOdet` = "'.$i.'" WHERE `id` = "'.((int)$cm[$i]).'" AND `uid` = "'.$this->info['id'].'" AND `delete` = "0" AND `inShop` = "0"'); - } - $i++; - } - } - - - - - - unset($cmp,$cm); - } - - $this->room = mysql_fetch_array(mysql_query('SELECT `id`,`extdlg`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee`,`roomAjax` FROM `room` WHERE `id` = "'.$this->info['room'].'" LIMIT 1')); - - if(isset($_POST['bankpsw'])) - { - $this->bank = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`block`,`create`,`pass`,`money1`,`money2`,`useNow`,`notmail` FROM `bank` WHERE `uid` = "'.$this->info['id'].'" AND `block` = "0" AND `id` = "'.mysql_real_escape_string((int)$_POST['bank']).'" AND `pass` = "'.mysql_real_escape_string($_POST['bankpsw']).'" LIMIT 1')); - if(isset($this->bank)) - { - mysql_query('UPDATE `bank` SET `useNow` = "'.(time()+24*60*60).'" WHERE `id` = "'.$this->bank['id'].'" LIMIT 1'); - }else{ - $this->bank['error'] = ' '; - } - }elseif(!isset($_GET['bank_exit'])) - { - $this->bank = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`block`,`create`,`pass`,`money1`,`money2`,`useNow`,`notmail` FROM `bank` WHERE `uid` = "'.$this->info['id'].'" AND `block` = "0" AND `useNow` > '.time().' ORDER BY `useNow` DESC LIMIT 1')); - } - - if(isset($_GET['bank_exit'])) - { - mysql_query('UPDATE `bank` SET `useNow` = "0" WHERE `uid` = "'.$this->info['id'].'" AND `useNow`!="0" LIMIT 1'); - } - - if(!isset($_GET['obt_sel']) && $this->info['battle'] == 0 && $this->info['obraz'] != '0.gif') { - // - $this->stats = $this->getStats($this->info['id']); - $tr = true; - $o = mysql_fetch_array(mysql_query('SELECT `id`,`sex`,`tr`,`img`,`login`,`level`,`admin`,`align`,`clan`,`itm` FROM `obraz` WHERE `img` = "'.mysql_real_escape_string($this->info['obraz']).'" AND `sex` = "'.$this->info['sex'].'" AND (`login` = "" OR `login` = "'.$this->info['login'].'") LIMIT 1')); - $t = $this->items['tr']; - $x = 0; - $po = $this->lookStats($o['tr']); - if( $o['itm'] > 0 ) { - $o['itm'] = explode(',',$o['itm']); - $j = 0; - while( $j < count($o['itm']) ) { - $itm_id = $o['itm'][$j]; - if( $itm_id > 0 ) { - $itm_id = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$itm_id.'" LIMIT 1')); - $itm_id_true = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = "'.$itm_id['id'].'" AND - `delete` = 0 AND `inOdet` > 0 AND `inShop` = 0 AND `uid` = "'.$this->info['id'].'" - LIMIT 1')); - if(!isset($itm_id_true['id'])) { - $tr = false; - } - } - $j++; - } - } - while($x $this->stats[$n]) { - $tr = false; - } - } - $x++; - } - if( $this->info['clan'] != $o['clan'] && $o['clan'] != 0 ) { - $tr = false; - } - if(!isset($o['id']) || $tr == false) { - if( $this->info['obraz'] == $o['img'] ) { - $this->info['obraz'] = '0.gif'; - mysql_query('UPDATE `users` SET `obraz` = "'.$this->info['obraz'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - } - - } - - if(isset($_GET['obr_sel']) || isset($_GET['obraz'])) - { - $sm = $this->testAction('`uid` = "'.$this->info['id'].'" AND `time` > '.(time()-86400).' AND `vars` = "sel_obraz" LIMIT 1',1); - if(!isset($sm['id'])) - { - if(isset($_GET['obr_sel'])) - { - $this->stats = $this->getStats($this->info['id']); - $tr = true; - $o = mysql_fetch_array(mysql_query('SELECT `id`,`sex`,`tr`,`img`,`login`,`level`,`admin`,`align`,`clan`,`itm` FROM `obraz` WHERE `id` = "'.((int)$_GET['obr_sel']).'" AND `sex` = "'.$this->info['sex'].'" AND (`login` = "" OR `login` = "'.$this->info['login'].'") LIMIT 1')); - $t = $this->items['tr']; - $x = 0; - $po = $this->lookStats($o['tr']); - if( $o['itm'] > 0 ) { - $o['itm'] = explode(',',$o['itm']); - $j = 0; - $tritm = ''; - while( $j < count($o['itm']) ) { - $itm_id = $o['itm'][$j]; - if( $itm_id > 0 ) { - $itm_id = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$itm_id.'" LIMIT 1')); - $itm_id_true = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = "'.$itm_id['id'].'" AND - `delete` = 0 AND `inOdet` > 0 AND `inShop` = 0 AND `uid` = "'.$this->info['id'].'" - LIMIT 1')); - if(!isset($itm_id_true['id'])) { - $tr = false; - } - if( $j > 0 ) { - $tritm .= ', '; - } - $tritm .= '"'.$itm_id['name'].'"'; - } - $j++; - } - if( $tritm != '' && $tr == false ) { - $this->error = ' : '.$tritm.''; - } - } - while($x $this->stats[$n]) { - $tr = false; - $this->error = ' '; - } - } - $x++; - } - if(isset($o['id']) && $tr == true) { - if( $this->info['obraz'] != $o['img'] ) { - mysql_query('UPDATE `users` SET `obraz` = "'.$o['img'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - $this->addAction(time(),'sel_obraz','id='.$o['id'].''); - $this->info['obraz'] = $o['img']; - } - }else{ - if( $this->info['obraz'] == $o['img'] ) { - $this->info['obraz'] = '0.gif'; - mysql_query('UPDATE `users` SET `obraz` = "'.$this->info['obraz'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - } - } - }else{ - $this->error = ' , '.date('d.m.Y H:i',$sm['time']+86400).''; - unset($_GET['obr_sel']); - $_GET['inv'] = 1; - } - } - - if($this->info['zv'] > 0) - { - $zv = mysql_fetch_array(mysql_query('SELECT `id` FROM `zayvki` WHERE `id` = "'.$this->info['zv'].'" AND `btl_id` = "0" AND `cancel` = "0" LIMIT 1')); - if(!isset($zv['id'])) - { - $this->info['zv'] = 0; - mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - } - - if($this->info['wipe']!=0) - { - $this->wipe(); - }else{ - // - - } - - $this->allActionsStart(); - - }elseif(isset($this->info['id'])) { - $this->room = mysql_fetch_array(mysql_query('SELECT `id`,`extdlg`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee`,`roomAjax` FROM `room` WHERE `id` = "'.$this->info['room'].'" LIMIT 1')); - } - } - - public function allActionsStart() - { - global $magic; - if(isset($_GET['use_snowball'])) - { - $this->stats = $this->getStats($this->info,0); - // - if(isset($this->stats['items'][$this->stats['wp13id']]['id']) && $this->stats['items'][$this->stats['wp13id']]['item_id']==998) - { - // , - if($this->room['name']!=' ') - { - $this->error2 = ' '; - }else{ - $smt = $this->testAction('`uid` = "'.$this->info['id'].'" AND `time`>='.(time()-600).' AND `vars` = "create_snowball_cp" LIMIT 1',1); - if(isset($smt['id'])) - { - $this->error2 = ' ;)'; - }else{ - $smt = $this->testAction('`uid` = "'.$this->info['id'].'" AND `time`>='.strtotime('now 00:00:00').' AND `vars` = "create_snowball_cp" LIMIT 25',2); - $smt = $smt[0]; - if($smt<24) - { - $this->addAction(time(),'create_snowball_cp',$this->info['city']); - $magic->add_eff($this->info['id'],24); - $this->error2 = ' , '.(24-$smt).' ...'; - }else{ - $this->error2 = ' 24 ...'; - } - } - } - } - } - } - - public function round2($v) - { - $v = explode('.',$v); - $v = doubleval($v[0].'.'.$v[1][0].''.$v[1][1]); - $f = explode('.',$v); - if(!isset($f[1])) - { - $v = $v.'.00'; - } - return $v; - } - - public function zuby($v,$t = 0) { - $r = ''; - if( $v < 0 ) { - $v = 0; - } - if($t == 0) { - $names[] = ' '; - $names[] = ' '; - $names[] = ' '; - $names[] = ' '; - }else{ - $names[] = ' '; - $names[] = ' '; - $names[] = ' '; - $names[] = ' '; - } - $int = $v; - do{ - $mod = $int%10; - $int = floor($int/10);// $int = ($int-$mod)/10; - $r = array_shift($names)."".$mod."".$r; - - }while($int); - - $ost = explode('.',$v); - $ost = $ost[1]; - if($ost == '' || $ost == 0) { - $ost = '00'; - } - - $r .= '.'.$ost; - - return $r; - } - - public function onlineBonus() - { - /*if( $this->info['inTurnir'] == 0 ){ - $ts = mysql_fetch_array(mysql_query('SELECT `time_all`,`time_today` FROM `online` WHERE `uid` = "'.$this->info['id'].'" LIMIT 1')); - $tf = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`vars`,`vals` FROM `actions` WHERE `uid` = "'.$this->info['id'].'" AND `vars` = "online_bonus_time" LIMIT 1')); - $m = floor(($ts['time_all']-$tf['vals'])/60); - $h = floor($m/60); - - if($h > 0 ) { - $ekr_add = round($h*0.45,2); - $bnks = mysql_fetch_array(mysql_query('SELECT `id`,`money2` FROM `bank` WHERE `uid` = "'.$this->info['id'].'" AND `block` = "0" ORDER BY `id` DESC LIMIT 1')); - if( isset($bnks['id']) ) { - $r .= ' '.$ekr_add.' . ( '.$bnks['id'].') '.$h.' . !'; - $this->info['catch'] += $ekr_add; - $bnks['money2'] += $ekr_add; - mysql_query('UPDATE `users` SET `catch` = "'.$this->info['catch'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `bank` SET `money2` = "'.$bnks['money2'].'" WHERE `id` = "'.$bnks['id'].'" LIMIT 1'); - if(!isset($tf['id'])) { - $this->addAction(time(),'online_bonus_time',$ts['time_all']); - }elseif($tf['vals'] < $ts['time_all']) { - mysql_query('UPDATE `actions` SET `vals` = "'.$ts['time_all'].'" WHERE `id` = "'.$tf['id'].'" LIMIT 1'); - } - mysql_query("INSERT INTO `chat` (`typeTime`,`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('2','1','".$this->info['city']."','".$this->info['room']."','','".$this->info['login']."','".$r."','".time()."','6','0')"); - } - } - } - /*$ts = mysql_fetch_array(mysql_query('SELECT `time_all`,`time_today` FROM `online` WHERE `uid` = "'.$this->info['id'].'" LIMIT 1')); - $tf = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`vars`,`vals` FROM `actions` WHERE `uid` = "'.$this->info['id'].'" AND `vars` = "online_bonus_time" LIMIT 1')); - $m = floor(($ts['time_all']-$tf['vals'])/60); - $h = floor($m/60); - - if($m > 0) - { - $this->stats = $this->getStats($this->info,0); - $r = ''; - if(!isset($tf['id'])) - { - $this->addAction(time(),'online_bonus_time',$ts['time_all']); - }elseif($tf['vals'] < $ts['time_all']) - { - mysql_query('UPDATE `actions` SET `vals` = "'.$ts['time_all'].'" WHERE `id` = "'.$tf['id'].'" LIMIT 1'); - } - - // $m . - if($m > 0) { - $hrg = 1; - //$this->addItem(2130,$this->info['id'],'noodet=1|noremont=1'); - $this->stats['enNow'] = $this->info['enNow']; - $enreg = round($m*(@$this->stats['enAll']/(60*$hrg)),7); - if($this->info['admin'] > 0) { - // - } - - $this->stats['enNow'] += $enreg; - if($this->stats['enNow'] > $this->stats['enAll']) { - $this->stats['enNow'] = $this->stats['enAll']; - $enreg = 0; - } - $this->info['enNow'] = $this->stats['enNow']; - mysql_query('UPDATE `stats` SET `enNow` = "'.$this->stats['enNow'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - - /*if($this->info['id'] == 285838 || $this->info['admin'] > 0) { - $r .= '! : '.$enreg.' . ['.$this->stats['enNow'].'/'.$this->stats['enAll'].']'; - - // - mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$this->info['city']."','".$this->info['room']."','','".$this->info['login']."','".$r."','-1','5','0')"); - }*/ - //} - return NULL; - } - - public function addAction($time,$vars,$vls,$uid = NULL) - { - if($uid==NULL) - { - $uid = $this->info['id']; - } - //mysql_query('LOCK TABLES actions WRITE'); - $ins = mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`) VALUES ("'.$uid.'","'.$time.'","'.$this->info['city'].'","'.$this->info['room'].'","'.mysql_real_escape_string($vars).'","'.mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']).'","'.mysql_real_escape_string($vls).'")'); - - //mysql_query('UNLOCK TABLES'); - if($ins) - { - return true; - }else{ - return false; - } - } - - public function testAction($filter,$tp) - { - //mysql_query('LOCK TABLES actions WRITE'); - if($tp==1) - { - $ins = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`,`val` FROM `actions` WHERE '.$filter.'')); - }elseif($tp==2){ - $ins = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `actions` WHERE '.$filter.'')); - } - return $ins; - } - - public function takePersInfo($whr) - { - $inf = mysql_fetch_array(mysql_query('SELECT - `u`.`id`,`u`.`login`,`u`.`login2`,`u`.`pass`,`u`.`pass2`,`u`.`repass`,`u`.`notrhod`,`u`.`emailconfirmation`,`u`.`securetime`,`u`.`sys`,`u`.`palpro`,`u`.`online`,`u`.`ip`,`u`.`ipreg`,`u`.`joinIP`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`banned`,`u`.`auth`,`u`.`align`,`u`.`align2`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`mod_zvanie`,`u`.`clan`,`u`.`nextMsg`,`u`.`molch1`,`u`.`molch2`,`u`.`molch3`,`u`.`level`,`u`.`money`,`u`.`money2`,`u`.`money4`,`u`.`money3`,`u`.`battle`,`u`.`cityreg`,`u`.`invBlock`,`u`.`allLock`,`u`.`invBlockCode`,`u`.`zag`,`u`.`a1`,`u`.`q1`,`u`.`mail`,`u`.`name`,`u`.`bithday`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`city_real`,`u`.`icq`,`u`.`icq_hide`,`u`.`homepage`,`u`.`deviz`,`u`.`hobby`,`u`.`chatColor`,`u`.`timereg`,`u`.`add_smiles`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`cityreg2`,`u`.`host`,`u`.`info_delete`,`u`.`dateEnter`,`u`.`afk`,`u`.`dnd`,`u`.`timeMain`,`u`.`clan_prava`,`u`.`addpr`,`u`.`marry`,`u`.`city2`,`u`.`invis`,`u`.`bot_id`,`u`.`haos`,`u`.`host_reg`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`jail`,`u`.`animal`,`u`.`vip`,`u`.`catch`,`u`.`frg`,`u`.`no_ip`,`u`.`type_pers`,`u`.`bot_room`,`u`.`clan_delay`,`u`.`bukmeker`, - `st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity` - FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE '.$whr.' LIMIT 1')); - return $inf; - } - - public function addNewbot($id,$botDate,$clon,$logins_bot,$luser,$round) - { - global $c,$code; - if($clon!=NULL) - { - $r = false; - if( is_array($clon) ) { - // - }else{ - $clon = $this->takePersInfo('`u`.`id` = "'.((int)$clon).'"'); - } - if(isset($clon['id'])) - { - if( !isset($clon['loclon']) ) { - $clon['login'] .= ' ()'; - } - // - $ins1 = mysql_query('INSERT INTO `users` ( - `align`, - `login`, - `level`, - `pass`, - `city`, - `cityreg`, - `name`, - `sex`, - `deviz`, - `hobby`, - `timereg`, - `obraz`, - `bot_id`, - `inTurnir` - ) VALUES ( - "'.$clon['align'].'", - "'.$clon['login'].'", - "'.$clon['level'].'", - "'.md5('bot_pass_'.$clon['login'].'_').'", - "'.$this->info['city'].'", - "'.$clon['city_reg'].'", - "'.$clon['login'].'", - "'.$clon['sex'].'", - "", - "", - "'.$clon['time_reg'].'", - "'.$clon['obraz'].'", - "'.mysql_real_escape_string($id).'", - "'.$clon['inTurnir'].'" - )'); - if($ins1) - { - if( $round > 0 ) { - // . 1 = +10% - $statss = $this->lookStats($clon['stats']); - // - $statss['s1'] = ceil($statss['s1']*(1 + 0.1*($round))); - $statss['s2'] = ceil($statss['s2']*(1 + 0.1*($round))); - $statss['s3'] = ceil($statss['s3']*(1 + 0.1*($round))); - $statss['s4'] = ceil($statss['s4']*(1 + 0.1*($round))); - // - $statss['hpAll'] = ceil($statss['hpAll']*(1 + 0.1*($round))); - $statss['mpAll'] = ceil($statss['mpAll']*(1 + 0.1*($round))); - // - $statss['m1'] = ceil($statss['m1']*(1 + 0.1*($round))); - $statss['m2'] = ceil($statss['m2']*(1 + 0.1*($round))); - $statss['m3'] = ceil($statss['m3']*(1 + 0.1*($round))); - $statss['m4'] = ceil($statss['m4']*(1 + 0.1*($round))); - $statss['m5'] = ceil($statss['m5']*(1 + 0.1*($round))); - $statss['za'] = ceil($statss['za']*(1 + 0.1*($round))); - $statss['zm'] = ceil($statss['zm']*(1 + 0.1*($round))); - $clon['stats'] = $this->impStats($statss); - unset($statss); - } - if($luser == true && $clon['level'] < 8) { - // , - $statss = $this->lookStats($clon['stats']); - $statss['m1'] = ceil($statss['m1']*0.75); - $statss['m2'] = ceil($statss['m2']*0.75); - $statss['m3'] = ceil($statss['m3']*0.75); - $statss['m4'] = ceil($statss['m4']*0.75); - $statss['m5'] = ceil($statss['m5']*0.75); - $statss['za'] = ceil($statss['za']*0.25); - - //$statss['yron_min'] -= $clon['level'] * 7; - //$statss['yron_max'] -= $clon['level'] * 12; - - $clon['stats'] = $this->impStats($statss); - unset($statss); - } - $uid = mysql_insert_id(); - // - $ins2 = mysql_query('INSERT INTO `stats` (`clone`,`id`,`stats`,`hpNow`,`upLevel`,`bot`,`priems`) VALUES ("'.$clon['id'].'","'.$uid.'","'.$clon['stats'].'","1000000","'.$clon['upLevel'].'","1","'.$clon['priems'].'")'); - if($ins2) - { - // - $sp = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `uid` = "'.$clon['id'].'" AND `inOdet` > 0 AND `delete` = "0" LIMIT 50'); - while($pl = mysql_fetch_array($sp)) - { - $pl['data'] = str_replace('toclan','to_clan_',$pl['data']); - mysql_query('INSERT INTO `items_users` (`uid`,`item_id`,`data`,`inOdet`,`iznosMAX`,`kolvo`) VALUES ("'.$uid.'","'.$pl['item_id'].'","'.$pl['data'].'","'.$pl['inOdet'].'","'.$pl['iznosMAX'].'","'.$pl['kolvo'].'")'); - } - // - $sp = mysql_query('SELECT `id`,`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`timeAce`,`user_use`,`delete`,`v1`,`v2`,`img2`,`x`,`hod`,`bj`,`sleeptime`,`no_Ace`,`tr_life_user` FROM `eff_users` WHERE `uid` = "'.$clon['id'].'" AND `delete` = "0" AND `deactiveTime` < "'.time().'" AND `v1` != "priem" LIMIT 50'); - while($pl = mysql_fetch_array($sp)) - { - mysql_query('INSERT INTO `eff_users` (`uid`,`id_eff`,`data`,`name`,`overType`,`timeUse`,`x`) VALUES ("'.$uid.'","'.$pl['id_eff'].'","'.$pl['data'].'","'.$pl['name'].'","'.$pl['overType'].'","'.$pl['timeUse'].'","'.$pl['x'].'")'); - } - $r = $uid; - } - } - } - return $r; - }else{ - if($botDate==NULL){ - $bot = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`stats`,`obraz`,`level`,`sex`,`name`,`deviz`,`hobby`,`type`,`itemsUse`,`priemUse`,`align`,`clan`,`align_zvanie`,`bonus`,`clan_zvanie`,`time_reg`,`city_reg`,`upLevel`,`active`,`expB`,`p_items`,`agressor`,`priems`,`priems_z`,`award` FROM `test_bot` WHERE `id` = "'.$id.'" LIMIT 1')); - }else{ - $bot = $botDate; - } - if(isset($bot['id'])) - { - if(isset($logins_bot[$bot['login']])) - { - $logins_bot[$bot['login']]++; - $bot['login'] = $bot['login'].' ('.$logins_bot[$bot['login']].')'; - }else{ - $logins_bot[$bot['login']] = 1; - } - $ret = true; - if($bot['time_reg']==100) - { - $bot['time_reg'] = time(); - } - if($bot['city_reg']=='{thiscity}') - { - $bot['city_reg'] = $this->info['city']; - } - - $ins1 = mysql_query('INSERT INTO `users` ( - `align`, - `login`, - `level`, - `pass`, - `city`, - `cityreg`, - `name`, - `sex`, - `deviz`, - `hobby`, - `timereg`, - `obraz`, - `bot_id` - ) VALUES ( - "'.$bot['align'].'", - "'.$bot['login'].'", - "'.$bot['level'].'", - "'.md5('bot_pass_'.$bot['login'].'_').'", - "'.$this->info['city'].'", - "'.$bot['city_reg'].'", - "'.$bot['name'].'", - "'.$bot['sex'].'", - "'.$bot['deviz'].'", - "'.$bot['hobby'].'", - "'.$bot['time_reg'].'", - "'.$bot['obraz'].'", - "'.mysql_real_escape_string($id).'" - )'); - if($ins1){ - $uid = mysql_insert_id(); - if( $round > 0 ) { - // . 1 = +20% - $statss = $this->lookStats($bot['stats']); - // - $statss['s1'] = ceil($statss['s1']*(1 + 0.10*($round))); - $statss['s2'] = ceil($statss['s2']*(1 + 0.10*($round))); - $statss['s3'] = ceil($statss['s3']*(1 + 0.10*($round))); - $statss['s4'] = ceil($statss['s4']*(1 + 0.10*($round))); - // - $statss['hpAll'] = ceil($statss['hpAll']*(1 + 0.10*($round))); - $statss['mpAll'] = ceil($statss['mpAll']*(1 + 0.10*($round))); - // - $statss['m1'] = ceil($statss['m1']*(1 + 0.10*($round))); - $statss['m2'] = ceil($statss['m2']*(1 + 0.10*($round))); - $statss['m3'] = ceil($statss['m3']*(1 + 0.10*($round))); - $statss['m4'] = ceil($statss['m4']*(1 + 0.10*($round))); - $statss['m5'] = ceil($statss['m5']*(1 + 0.10*($round))); - $statss['za'] = ceil($statss['za']*(1 + 0.10*($round))); - $statss['zm'] = ceil($statss['zm']*(1 + 0.10*($round))); - $bot['stats'] = $this->impStats($statss); - unset($statss); - } - $ins2 = mysql_query('INSERT INTO `stats` (`id`,`stats`,`hpNow`,`upLevel`,`bot`) VALUES ("'.$uid.'","'.$bot['stats'].'","1000000","'.$bot['upLevel'].'","1")'); - if($ins2){ - $bot['id'] = $uid; - $bot['logins_bot'] = $logins_bot; - $ret = $bot; - - // - //$this->addItem($item_id,$uid); - $iu = explode(',',$bot['itemsUse']); - $i = 0; - $w3b = 0; - while($i0) { - $idiu = $this->addItem($iu[$i],$bot['id']); - $islot = mysql_fetch_array(mysql_query('SELECT `id`,`inslot` FROM `items_main` WHERE `id` = "'.$iu[$i].'" LIMIT 1')); - if(isset($islot['id'])) { - if( $islot['inslot'] == 3 ) { - if( $w3b == 1 ) { - $islot = 14; - }else{ - $islot = 3; - $w3b = 1; - } - }else{ - $islot = $islot['inslot']; - } - }else{ - $islot = 2000; - } - mysql_query('UPDATE `items_users` SET `inOdet` = "'.$islot.'" WHERE `id` = "'.$idiu.'" LIMIT 1'); - } - $i++; - } - - }else{ - $ret = false; - } - }else{ - $ret = false; - } - return $ret; - }else{ - return false; - } - } - } - - /* - * $iid id - * . - */ - public function buyItem($sid,$itm,$x,$mdata = NULL,$vip = false) { - global $c,$code,$sid; - // sid 700 - 730 ( 10) - $x = round((int)$x); - if($x<1){ $x = 1; } - if($x>99){ $x = 99; } - $i = mysql_fetch_array(mysql_query('SELECT `im`.*,`ish`.* FROM `items_shop` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`sid` = "'.mysql_real_escape_string($sid).'" AND `ish`.`kolvo` > 0 AND `ish`.`item_id` = "'.mysql_real_escape_string($itm).'" LIMIT 1')); - - $r = ''; - $vip = false; - if( $vip == true ) { - $test = $this->testVipItems($i['type']); - } - if( $vip == true && $test == false ) { - $r = ' VIP , '; - }elseif($this->info['allLock'] > time()) { - $r = ' '.date('d.m.y H:i',$this->info['allLock']).''; - }elseif(isset($i['id'])){ - if($i['price_4'] <= 0) { - $i['price_4'] = $i['price3']; - } - if($i['price_4'] > 0) { - if($i['kolvo']<$x){ - $x = $i['kolvo']; - } - if($x<1){ - $x = 1; - } - $price = $i['price_4']*$x; - $trnt = ''; $detrn = array(); - $trn = 1; - if($i['tr_items']!=''){ - $tims2 = explode(',',$i['tr_items']); - $j = 0; - while($j0 && $tims[1]>0){ - $tis = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`price4`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$tims[0].'" LIMIT 1')); - if(isset($tis['id'])){ - $num_rows = 0; - $s1p = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`4price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$tims[0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" LIMIT '.((int)$tims[1]*$x).''); - while($p1l = mysql_fetch_array($s1p)){ - $num_rows++; - } - if($num_rows < (int)$tims[1]*$x){ - $trn = 0; - }else{ - $detrn[count($detrn)] = array(0 => $tims[0], 1 => ((int)$tims[1]*$x)); //id_item - } - $trnt .= '['.$tis['name'].' (x'.$x.')]x'.$tims[1].', '; - } - } - $j++; - } - $trnt = rtrim($trnt,', '); - } - - if( $c['noitembuy'] == true ) { - $trn = 1; - } - - if( isset($i['tr_reputation']) && $i['tr_reputation']!=''){ // - $need_rep = 0; - $tr_rep = $this->lookStats($i['tr_reputation']); - foreach($tr_rep as $row){ - if( $this->rep[$row[0]] >= $row[1] ){ - $need_rep++; - } - } - } else $need_rep = 0; - - $mxby = 0; - if($i['max_buy'] > 0) { - $mxby = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE ( `delete` = "0" OR `delete` = "1000" ) AND `item_id` = "'.mysql_real_escape_string($itm).'" AND `uid` = "'.$this->info['id'].'" LIMIT '.$i['max_buy'])); - if($mxby[0] >= $i['max_buy']) { - $mxby = -1; - } - } - - if($i['max_buy'] < $x && $i['max_buy'] > 0) { - $r = ' '.$i['max_buy'].' .'; - }elseif( $need_rep > 0 ) { - $r = ' , .'; - }elseif($mxby == -1) { - $r = ' '; - }elseif($trn==0 && $this->info['admin'] == 0){ - $r = ' ( '.$trnt.')'; - }elseif($i['price_4']*$x > ($this->rep['rep3']-$this->rep['rep3_buy'])){ - $r = ' ( '.($price-($this->rep['rep3']-$this->rep['rep3_buy'])).' .)'; - }else{ - $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1')); - $this->rep['rep3_buy'] += $price; - $upd = mysql_query('UPDATE `rep` SET `rep3_buy` = "'.mysql_real_escape_string($this->rep['rep3_buy']).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - if($upd){ - // - $data = ''; - $data .= $d['data']; - if($mdata!=NULL){ - $data .= '|'.$mdata; - } - $ix = 1; $gix = 0; - while($ix<=$x){ - if($i['type']!=71) { - if( $i['iznos'] > 0 ) { - $i['iznosMAXi'] = $i['iznos']; - } - $ins = mysql_query('INSERT INTO `items_users` (`1price`,`2price`,`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`) VALUES ( - "1", - "1", - "'.$i['overType'].'", - "'.$i['item_id'].'", - "'.$this->info['id'].'", - "'.str_replace('sudba=0','',$data).'|sudba='.$this->info['login'].'|icos=WL|fromshop='.$sid.'", - "'.$i['iznosMAXi'].'", - "'.$i['geniration'].'", - "'.$i['magic_inc'].'", - "'.$this->info['city'].'", - "'.time().'", - "'.time().'")'); - }else{ - mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$this->info['id'].'" AND `sex` = "'.$i['sex'].'" AND `img` = "'.str_replace('.png','.gif',$i['img']).'" LIMIT 1'); - $ins = mysql_query('INSERT INTO `obraz` (`sex`,`img`,`level`,`uid`,`usr_add`) VALUES ("'.$i['sex'].'","'.str_replace('.png','.gif',$i['img']).'","'.$i['level'].'","'.$this->info['id'].'","'.time().'")'); - } - if($ins){ - $gix++; - } - $ix++; - } - if($ins){ - // - if($trnt!='' && $i['tr_items']!=''){ - $trnt = ', '.$trnt; - } - $r = ' "'.$i['name'].'" (x'.$x.' / '.$gix.') '.$price.' . '.$trnt.'
.'; - - $j = 0; - while($j ! ".$this->info['login']." "".$i['name']."" , !','-1','5','0')"); - mysql_query('UPDATE `items_shop` SET `kolvo` = "'.($i['kolvo']-$x).'" WHERE `iid` = "'.$i['iid'].'" LIMIT 1'); - $ld = $this->addDelo(1,$this->info['id'],'"Shop.'.$this->info['city'].'": "'.$i['name'].'" (x'.$x.') [#'.$i['iid'].'] '.$price.' .',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0); - }else{ - // - $r = ' "'.$i['name'].'". "'.$this->city_name[$this->info['city']].'" '.$price.' .
.'; - $ld = $this->addDelo(1,$this->info['id'],'"Shop.'.$this->info['city'].'": #'.$i['iid'].'. : '.$price.' . ',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0); - if(!$ld){ - echo '
, /db/usersDelo/!
'; - } - } - }else{ - $r = ' ...'; - } - } - }elseif($i['price_3'] > 0) { - if($i['kolvo']<$x){ - $x = $i['kolvo']; - } - if($x<1){ - $x = 1; - } - $price = $i['price_3']*$x; - $trnt = ''; $detrn = array(); - $trn = 1; - if($i['tr_items']!=''){ - $tims2 = explode(',',$i['tr_items']); - $j = 0; - while($j0 && $tims[1]>0){ - $tis = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`price4`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$tims[0].'" LIMIT 1')); - if(isset($tis['id'])){ - $num_rows = 0; - $s1p = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`4price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$tims[0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" LIMIT '.((int)$tims[1]*$x).''); - while($p1l = mysql_fetch_array($s1p)){ - $num_rows++; - } - if($num_rows < (int)$tims[1]*$x){ - $trn = 0; - }else{ - $detrn[count($detrn)] = array(0 => $tims[0], 1 => ((int)$tims[1]*$x)); //id_item - } - $trnt .= '['.$tis['name'].' (x'.$x.')]x'.$tims[1].', '; - } - } - $j++; - } - $trnt = rtrim($trnt,', '); - } - if( $c['noitembuy'] == true ) { - $trn = 1; - } - - if( isset($i['tr_reputation']) && $i['tr_reputation']!=''){ // - $need_rep = 0; - $tr_rep = $this->lookStats($i['tr_reputation']); - foreach($tr_rep as $row){ - if( $this->rep[$row[0]] >= $row[1] ){ - $need_rep++; - } - } - } else $need_rep = 0; - - $mxby = 0; - if($i['max_buy'] > 0) { - $mxby = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE ( `delete` = "0" OR `delete` = "1000" ) AND `item_id` = "'.mysql_real_escape_string($itm).'" AND `uid` = "'.$this->info['id'].'" LIMIT '.$i['max_buy'])); - if($mxby[0] >= $i['max_buy']) { - $mxby = -1; - } - } - - if($i['max_buy'] < $x && $i['max_buy'] > 0) { - $r = ' '.$i['max_buy'].' .'; - }elseif( $need_rep > 0 ) { - $r = ' , .'; - }elseif($mxby == -1) { - $r = ' '; - }elseif($trn==0 && $this->info['admin'] == 0){ - $r = ' ( '.$trnt.')'; - }elseif($i['price_3']*$x > $this->info['money3']){ - $r = ' ( '.($price-$this->info['money3']).' $)'; - }else{ - $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1')); - $this->info['money3'] -= $price; - $upd = mysql_query('UPDATE `users` SET `money3` = "'.mysql_real_escape_string($this->info['money3']).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - if($upd){ - // - $data = ''; - $data .= $d['data']; - if($mdata!=NULL){ - $data .= '|'.$mdata; - } - $ix = 1; $gix = 0; - while($ix<=$x){ - if($i['type']!=71) { - if( $i['iznos'] > 0 ) { - $i['iznosMAXi'] = $i['iznos']; - } - $ins = mysql_query('INSERT INTO `items_users` (`1price`,`2price`,`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`) VALUES ( - "1", - "1", - "'.$i['overType'].'", - "'.$i['item_id'].'", - "'.$this->info['id'].'", - "'.str_replace('sudba=0','',$data).'|sudba='.$this->info['login'].'|frombax=1|fromshop='.$sid.'", - "'.$i['iznosMAXi'].'", - "'.$i['geniration'].'", - "'.$i['magic_inc'].'", - "'.$this->info['city'].'", - "'.time().'", - "'.time().'")'); - }else{ - mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$this->info['id'].'" AND `sex` = "'.$i['sex'].'" AND `img` = "'.str_replace('.png','.gif',$i['img']).'" LIMIT 1'); - $ins = mysql_query('INSERT INTO `obraz` (`sex`,`img`,`level`,`uid`,`usr_add`) VALUES ("'.$i['sex'].'","'.str_replace('.png','.gif',$i['img']).'","'.$i['level'].'","'.$this->info['id'].'","'.time().'")'); - } - if($ins){ - $gix++; - } - $ix++; - } - if($ins){ - // - if($trnt!='' && $i['tr_items']!=''){ - $trnt = ', '.$trnt; - } - $r = ' "'.$i['name'].'" (x'.$x.' / '.$gix.') '.$price.' $. '.$trnt.'
.'; - - $j = 0; - while($j ! ".$this->info['login']." "".$i['name']."" , !','-1','5','0')"); - mysql_query('UPDATE `items_shop` SET `kolvo` = "'.($i['kolvo']-$x).'" WHERE `iid` = "'.$i['iid'].'" LIMIT 1'); - $ld = $this->addDelo(1,$this->info['id'],'"Shop.'.$this->info['city'].'": "'.$i['name'].'" (x'.$x.') [#'.$i['iid'].'] '.$price.' $',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0); - }else{ - // - $r = ' "'.$i['name'].'". "'.$this->city_name[$this->info['city']].'" '.$price.' $
.'; - $ld = $this->addDelo(1,$this->info['id'],'"Shop.'.$this->info['city'].'": #'.$i['iid'].'. : '.$price.' $ ',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0); - if(!$ld){ - echo '
, /db/usersDelo/!
'; - } - } - }else{ - $r = ' ...'; - } - } - }elseif($sid==2 || $sid==777) { - if($i['kolvo']<$x){ - $x = $i['kolvo']; - } - if($i['price_2']<=0){ - $i['price_2'] = $i['price2']; - } - if($i['price_1']<=0){ - $i['price_1'] = $i['price1']; - } - if( $vip == true ) { - $i['price_2'] = round($i['price_2']/20,2); - } - - // 5% - if( $this->stats['silver'] >= 1 ) { - if( $sid == 2 ) { - $i['price_1'] = round($i['price_1']/100*95 , 2); - } - } - - // 5% - if( $this->stats['silver'] >= 5 ) { - if( $sid == 2 ) { - $i['price_2'] = round($i['price_2']/100*95 , 2); - } - } - - $price = $i['price_2']*$x; - $mxby = 0; - if($i['max_buy'] > 0) { - $mxby = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE ( `delete` = "0" OR `delete` = "1000" ) AND `item_id` = "'.mysql_real_escape_string($itm).'" AND `uid` = "'.$this->info['id'].'" LIMIT '.$i['max_buy'])); - if($mxby[0] >= $i['max_buy']) { - $mxby = -1; - } - } - - if($i['max_buy'] < $x && $i['max_buy'] > 0) { - $r = ' '.$i['max_buy'].' .'; - }elseif($mxby == -1) { - $r = ' '; - }elseif($i['price_2']*$x>$this->info['money2']){ - $r = ' ( '.($price-$this->info['money2']).' .)'; - }else{ - $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1')); - $this->info['money2'] -= $price; - $upd = mysql_query('UPDATE `users` SET `money2` = "'.mysql_real_escape_string(round($this->info['money2'],2)).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - if($upd){ - $this->info['frg'] += $price; - mysql_query('UPDATE `users` SET `frg` = "'.floor($this->info['frg']).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - // - $data = ''; - $data .= $d['data']; - $i['time_create'] = time(); - if( $vip == true ) { - $i['time_create'] = $this->stats['slvtm']; - $mdata .= '|vip_sale=1|sudba='.$this->info['login'].''; - $data = str_replace('sudba=0','',$data); - $data = str_replace('sudba=1','',$data); - } - if($mdata!=NULL){ - $data .= '|'.$mdata; - } - $ix = 1; $gix = 0; - while($ix<=$x){ - if($i['type'] != 71) { - if( $i['iznos'] > 0 ) { - $i['iznosMAXi'] = $i['iznos']; - } - $ins = mysql_query('INSERT INTO `items_users` (`1price`,`2price`,`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`) VALUES ( - "'.($i['price_1']/2).'", - "'.$i['price_2'].'", - "'.$i['overType'].'", - "'.$i['item_id'].'", - "'.$this->info['id'].'", - "'.$data.'|fromshop='.$sid.'", - "'.$i['iznosMAXi'].'", - "'.$i['geniration'].'", - "'.$i['magic_inc'].'", - "'.$this->info['city'].'", - "'.time().'", - "'.$i['time_create'].'")'); - }else{ - mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$this->info['id'].'" AND `sex` = "'.$i['sex'].'" AND `img` = "'.str_replace('.png','.gif',$i['img']).'" LIMIT 1'); - $ins = mysql_query('INSERT INTO `obraz` (`sex`,`img`,`level`,`uid`,`usr_add`) VALUES ("'.$i['sex'].'","'.str_replace('.png','.gif',$i['img']).'","'.$i['level'].'","'.$this->info['id'].'","'.time().'")'); - } - if($ins){ - $gix++; - } - $ix++; - } - if($ins){ - // - $r = ' "'.$i['name'].'" (x'.$x.' / '.$gix.') '.$price.' .
.'; - mysql_query('UPDATE `items_shop` SET `kolvo` = "'.($i['kolvo']-$x).'" WHERE `iid` = "'.$i['iid'].'" LIMIT 1'); - $ld = $this->addDelo(1,$this->info['id'],'"EkrShop.'.$this->info['city'].'": "'.$i['name'].'" (x'.$x.',add items '.$gix.') [#'.$i['iid'].'] '.$price.' .',time(),$this->info['city'],'EkrShop.'.$this->info['city'].'',(int)$price,0); - }else{ - // - $r = ' "'.$i['name'].'". "'.$this->city_name[$this->info['city']].'" '.$price.' .
.'; - $ld = $this->addDelo(1,$this->info['id'],'"EkrShop.'.$this->info['city'].'": #'.$i['iid'].'. : '.$price.' .',time(),$this->info['city'],'EkrShop.'.$this->info['city'].'',0,0); - if(!$ld){ - echo '
, /db/usersDelo/!
'; - } - } - }else{ - $r = ' ...'; - } - } - } elseif( ($sid >= 700 && $sid <=730 ) /*OR ( $sid >= 800 && $sid <=805 )*/ ) { // nalpva2.php , , . - if( $i['kolvo'] < $x ) $x = $i['kolvo']; - if( $x < 1 ) $x = 1; - if( $i['price_1'] <= 0 && $i['tr_items']=='' ) $i['price_1'] = $i['price1']; - if( $i['price_2'] <= 0 && $i['tr_items']=='' ) $i['price_2'] = $i['price2']; - - $price = $i['price_1']*$x; - $trnt = ''; $detrn = array(); - $trn = 1; - if($i['tr_items']!='') { - $tims2 = explode(',',$i['tr_items']); - $j = 0; - while($j0 && $tims[1]>0){ - $tis = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$tims[0].'" LIMIT 1')); - if(isset($tis['id'])) { - $num_rows = 0; - $s1p = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$tims[0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" LIMIT '.((int)$tims[1]*$x).''); - while($p1l = mysql_fetch_array($s1p)){ - $num_rows++; - } - if($num_rows < (int)$tims[1]*$x){ - $trn = 0; - }else{ - $detrn[count($detrn)] = array(0 => $tims[0], 1 => ((int)$tims[1]*$x)); //id_item - } - $trnt .= '['.$tis['name'].' (x'.$x.')]x'.$tims[1].', '; - } - } - $j++; - } - $trnt = rtrim($trnt,', '); - } - if( $c['noitembuy'] == true ) { - $trn = 1; - } - - if( isset($i['tr_reputation']) && $i['tr_reputation'] != '' ) { // - $need_rep = 0; - $tr_rep = $this->lookStats($i['tr_reputation']); - foreach($tr_rep as $row){ - if( $this->rep[$row[0]] >= $row[1] ){ - $need_rep++; - } - } - } else $need_rep = 0; - - $mxby = 0; - if($i['max_buy'] > 0) { - $mxby = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE ( `delete` = "0" OR `delete` = "1000" ) AND `item_id` = "'.mysql_real_escape_string($itm).'" AND `uid` = "'.$this->info['id'].'" LIMIT '.$i['max_buy'])); - if($mxby[0] >= $i['max_buy']) { - $mxby = -1; - } - } - - if($i['max_buy'] < $x && $i['max_buy'] > 0) { - $r = ' '.$i['max_buy'].' .'; - }elseif( $need_rep > 0 ) { - $r = ' , .'; - }elseif($i['price_1']*$x>$this->info['money4'] && $zuby == 1){ - $r = ' .'; - }elseif($mxby == -1) { - $r = '
: '.$i['max_buy'].' .'; - }elseif($trn==0 && $this->info['admin'] == 0){ - $r = ' ( '.$trnt.')'; - }elseif($i['price_1']*$x>$this->info['money'] && $zuby == 0){ - $r = ' ( '.($price-$this->info['money']).' .)'; - }else{ - $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1')); - if($zuby == 0) { - $this->info['money'] -= $price; - } - $upd = mysql_query('UPDATE `users` SET `money` = "'.mysql_real_escape_string(round($this->info['money'],2)).'",`money4` = "'.mysql_real_escape_string(round($this->info['money4'],2)).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - if($upd){ - // - $data = ''; - $data .= $d['data']; - if($mdata!=NULL){ - $data .= '|'.$mdata; - } - $j=0; - $c_itm = 0; - $c_itm_data_a = array(); - while( $j < count($detrn) ) { - $itm= mysql_fetch_array(mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$detrn[$j][0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0") AND `inShop` = "0" ORDER BY `inGroup` DESC LIMIT 1')); - - if ( isset($itm['data']) && $itm['data'] != '' && $c_itm == 0){ - $po = $this->lookStats($itm['data']); - //if(isset($po['complect'])) { - // if(isset($po['complect'])) $c_itm_data_a['complect'] = $po['complect']; - //} - if(isset($po['sudba'])) { - if(isset($po['sudba'])) $c_itm_data_a['sudba'] = $po['sudba']; - } - if(isset($po['gravi']) && $po['gravi']!='') { - if(isset($po['gravi'])) $c_itm_data_a['gravi'] = $po['gravi']; - if(isset($po['gravic'])) $c_itm_data_a['gravic'] = $po['gravic']; - $c_itm++; - } - if(isset($po['imposed_id']) && $po['imposed_id']>0) { - if(isset($po['imposed'])) $c_itm_data_a['imposed'] = $po['imposed']; - if(isset($po['imposed_id'])) $c_itm_data_a['imposed_id'] = $po['imposed_id']; - if(isset($po['imposed_name'])) $c_itm_data_a['imposed_name'] = $po['imposed_name']; - if(isset($po['imposed_level'])) $c_itm_data_a['imposed_level'] = $po['imposed_level']; - if(isset($po['bm_a1'])) $c_itm_data_a['bm_a1'] = $po['bm_a1']; - $c_itm++; - } - if(isset($po['spell_id']) && $po['spell_id']>0) { - if(isset($po['spell'])) $c_itm_data_a['spell'] = $po['spell']; - if(isset($po['spell_id'])) $c_itm_data_a['spell_id'] = $po['spell_id']; - if(isset($po['spell_name'])) $c_itm_data_a['spell_name'] = $po['spell_name']; - if(isset($po['spell_lvl'])) $c_itm_data_a['spell_lvl'] = $po['spell_lvl']; - if(isset($po['spell_st_name'])) $c_itm_data_a['spell_st_name'] = $po['spell_st_name']; - if(isset($po['spell_st_val'])) $c_itm_data_a['spell_st_val'] = $po['spell_st_val']; - $c_itm++; - } - if(isset($po['rune_id']) && $po['rune_id']>0) { - if(isset($po['rune'])) $c_itm_data_a['rune'] = $po['rune']; - if(isset($po['rune_id'])) $c_itm_data_a['rune_id'] = $po['rune_id']; - if(isset($po['rune_name'])) $c_itm_data_a['rune_name'] = $po['rune_name']; - if(isset($po['rune_lvl'])) $c_itm_data_a['rune_lvl'] = $po['rune_lvl']; - $c_itm++; - } - if(isset($po['upatack_id']) && $po['upatack_id']>0) { - if(isset($po['upatack'])) $c_itm_data_a['upatack'] = $po['upatack']; - if(isset($po['upatack_id'])) $c_itm_data_a['upatack_id'] = $po['upatack_id']; - if(isset($po['upatack_name'])) $c_itm_data_a['upatack_name'] = $po['upatack_name']; - if(isset($po['upatack_lvl'])) $c_itm_data_a['upatack_lvl'] = $po['upatack_lvl']; - $c_itm++; - } - } - $j++; - } - if($c_itm>0){ - $data = $this->lookStats($data); - // - if( isset($c_itm_data_a['spell_st_name']) && isset($c_itm_data_a['spell_st_val']) && $c_itm_data_a['spell_st_name'] != '' && $c_itm_data_a['spell_st_val'] != '' ){ - $data['add_'.$c_itm_data_a['spell_st_name']] = (int)( isset($data['add_'.$c_itm_data_a['spell_st_name']]) ? (int)$data['add_'.$c_itm_data_a['spell_st_name']] : 0 ) + (int)$c_itm_data_a['spell_st_val']; - } - // - if(isset($c_itm_data_a['rune']) && $c_itm_data_a['rune'] > 0) { - - $ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$c_itm_data_a['rune_id'].'" LIMIT 1')); - $j = 0; - $data_r = $this->lookStats($ritm['data']); - while( $j < count($this->items['add']) ) { - if( isset($data_r['add_'.$this->items['add'][$j]]) ) { - $data['add_'.$this->items['add'][$j]] += $data_r['add_'.$this->items['add'][$j]]; - } - $j++; - } - - } - - $data = $this->impStats($data); - $c_itm_data = $this->impStats($c_itm_data_a); - $data .= '|'.$c_itm_data; - } - - $i['gift'] = ''; - - $ix = 1; $gix = 0; - while($ix<=$x){ - if($i['type'] != 71) { - if( $i['iznos'] > 0 ) { - $i['iznosMAXi'] = $i['iznos']; - } - // - $i['price_2'] = 0; - // - $ins = mysql_query('INSERT INTO `items_users` (`1price`,`2price`,`gift`,`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`) VALUES ( - "'.$i['price_1'].'", - "'.$i['price_2'].'", - "'.$i['gift'].'", - "'.$i['overType'].'", - "'.$i['item_id'].'", - "'.$this->info['id'].'", - "'.$data.'|fromshop='.$sid.'", - "'.$i['iznosMAXi'].'", - "'.$i['geniration'].'", - "'.$i['magic_inc'].'", - "'.$this->info['city'].'", - "'.time().'", - "'.time().'")'); - }else{ - mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$this->info['id'].'" AND `sex` = "'.$i['sex'].'" AND `img` = "'.str_replace('.png','.gif',$i['img']).'" LIMIT 1'); - $ins = mysql_query('INSERT INTO `obraz` (`sex`,`img`,`level`,`uid`,`usr_add`) VALUES ("'.$i['sex'].'","'.str_replace('.png','.gif',$i['img']).'","'.$i['level'].'","'.$this->info['id'].'","'.time().'")'); - } - if($ins){ - $gix++; - } - $ix++; - } - if($ins){ - // - if($trnt!='' && $i['tr_items']!=''){ - $trnt = ', '.$trnt; - } - - if($zuby == 0) { - $r = ' "'.$i['name'].'" (x'.$x.' / '.$gix.') '.$price.' . '.$trnt.'
.'; - }else{ - $r = ' "'.$i['name'].'" (x'.$x.' / '.$gix.') '.$this->zuby($price).'. '.$trnt.'
.'; - } - - $j = 0; - while($jaddDelo(1,$this->info['id'],'"Shop.'.$this->info['city'].'": "'.$i['name'].'" (x'.$x.') [#'.$i['iid'].'] '.$price.' .',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0); - }else{ - // - $r = ' "'.$i['name'].'". "'.$this->city_name[$this->info['city']].'" '.$price.' .
.'; - $ld = $this->addDelo(1,$this->info['id'],'"Shop.'.$this->info['city'].'": #'.$i['iid'].'. : '.$price.' .',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0); - if(!$ld){ - echo '
, /db/usersDelo/!
'; - } - } - }else{ - $r = ' ...'; - } - } - } else { // - if($i['kolvo']<$x){ - $x = $i['kolvo']; - } - if($x<1){ - $x = 1; - } - if($i['price_1']<=0 && $i['tr_items']==''){ - $i['price_1'] = $i['price1']; - } - if($i['price_2']<=0 && $i['tr_items']==''){ - $i['price_2'] = $i['price2']; - } - - // 5% - if( $this->stats['silver'] >= 1 ) { - if( $sid == 1 ) { - $i['price_1'] = round($i['price_1']/100*95 , 2); - } - } - - // 5% - if( $this->stats['silver'] >= 5 ) { - if( $sid == 2 ) { - $i['price_2'] = round($i['price_2']/100*95 , 2); - } - } - - $price = $i['price_1']*$x; - - $trnt = ''; $detrn = array(); - $trn = 1; - if($i['tr_items']!='') { - $tims2 = explode(',',$i['tr_items']); - $j = 0; - while($j0 && $tims[1]>0){ - $tis = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$tims[0].'" LIMIT 1')); - if(isset($tis['id'])){ - $num_rows = 0; - $s1p = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$tims[0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" LIMIT '.((int)$tims[1]*$x).''); - while($p1l = mysql_fetch_array($s1p)){ - $num_rows++; - } - if($num_rows < (int)$tims[1]*$x){ - $trn = 0; - }else{ - $detrn[count($detrn)] = array(0 => $tims[0], 1 => ((int)$tims[1]*$x)); //id_item - } - $trnt .= '['.$tis['name'].' (x'.$x.')]x'.$tims[1].', '; - } - } - $j++; - } - $trnt = rtrim($trnt,', '); - } - if( $c['noitembuy'] == true ) { - $trn = 1; - } - - if( isset($i['tr_reputation']) && $i['tr_reputation']!=''){ // - $need_rep = 0; - $tr_rep = $this->lookStats($i['tr_reputation']); - foreach($tr_rep as $key=>$val){ - if( (int)$this->rep[$key] > (int)$val ){ - $need_rep++; - } - } - } else unset($need_rep); - - $mxby = 0; - if($i['max_buy'] > 0) { - $mxby = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE ( `delete` = "0" OR `delete` = "1000" ) AND `item_id` = "'.mysql_real_escape_string($itm).'" AND `uid` = "'.$this->info['id'].'" LIMIT '.$i['max_buy'])); - if($mxby[0] >= $i['max_buy']) { - $mxby = -1; - } - } - - $zuby = 0; - if(isset($_GET['zuby']) && $i['level'] < 8 && $c['zuby'] == true) { - $zuby = 1; - } - - $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1')); - $po = $this->lookStats($d['data']); - - if( $zuby == 1 && $po['tr_lvl'] > 7 ) { - $r = ' .'; - }elseif(!isset($this->sid_zuby[$sid]) && $zuby == 1) { - $r = ' .'; - }elseif($zuby == 1 && $i['nozuby'] == 1) { - $r = ' .'; - }elseif($i['max_buy'] < $x && $i['max_buy'] > 0) { - $r = ' '.$i['max_buy'].' .'; - }elseif( isset($need_rep) && $need_rep == 0 ) { - $r = ' , .'; - }elseif($zuby == 1 && $this->info['money4'] < $i['price_1']) { - $r = ' .'; - }elseif($i['price_1']*$x>$this->info['money4'] && $zuby == 1){ - $r = ' .'; - }elseif($mxby == -1) { - $r = '
: '.$i['max_buy'].' .'; - }elseif($trn==0 && $this->info['admin'] == 0){ - $r = ' ( '.$trnt.')'; - }elseif($i['price_1']*$x > $this->info['money'] && $zuby == 0){ - $r = ' ( '.($price-$this->info['money']).' .)'; - }else{ - if($zuby == 0) { - $this->info['money'] -= $price; - }else{ - $this->info['money4'] -= $price; - } - $upd = mysql_query('UPDATE `users` SET `money` = "'.mysql_real_escape_string(round($this->info['money'],2)).'",`money4` = "'.mysql_real_escape_string(round($this->info['money4'],2)).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - if($upd){ - // - $data = ''; - $data .= $d['data']; - $data = str_replace('sudba=1','sudba='.$this->info['login'],$data); - - if($mdata!=NULL){ - $data .= '|'.$mdata; - } - - $i['gift'] = ''; - if($zuby == 1) { - $i['gift'] = '1'; - $data .= '|nosale=1|zazuby='.round($price/$x,2).''; - } - - if( $sid == 404 ) { - $data .= '|nosale=1|notransfer=1|fromshop=404|sudba=1'; - } - - $ix = 1; $gix = 0; - while($ix<=$x){ - if($i['type'] != 71) { - if( $i['iznos'] > 0 ) { - $i['iznosMAXi'] = $i['iznos']; - } - // - $i['price_2'] = 0; - // - $ins = mysql_query('INSERT INTO `items_users` (`1price`,`2price`,`gift`,`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`) VALUES ( - "'.$i['price_1'].'", - "'.$i['price_2'].'", - "'.$i['gift'].'", - "'.$i['overType'].'", - "'.$i['item_id'].'", - "'.$this->info['id'].'", - "'.$data.'|fromshop='.$sid.'", - "'.$i['iznosMAXi'].'", - "'.$i['geniration'].'", - "'.$i['magic_inc'].'", - "'.$this->info['city'].'", - "'.time().'", - "'.time().'")'); - }else{ - mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$this->info['id'].'" AND `sex` = "'.$i['sex'].'" AND `img` = "'.str_replace('.png','.gif',$i['img']).'" LIMIT 1'); - $ins = mysql_query('INSERT INTO `obraz` (`sex`,`img`,`level`,`uid`,`usr_add`) VALUES ("'.$i['sex'].'","'.str_replace('.png','.gif',$i['img']).'","'.$i['level'].'","'.$this->info['id'].'","'.time().'")'); - } - if($ins){ - $gix++; - } - $ix++; - } - if($ins){ - // - if($trnt!='' && $i['tr_items']!=''){ - $trnt = ', '.$trnt; - } - - if($zuby == 0) { - $r = ' "'.$i['name'].'" (x'.$x.' / '.$gix.') '.$price.' . '.$trnt.'
.'; - }else{ - $r = ' "'.$i['name'].'" (x'.$x.' / '.$gix.') '.$this->zuby($price).'. '.$trnt.'
.'; - } - - $zx = 0; $rs = 0; - while($zx < $x) { - - if( ( $sid == 1 || $sid == 5 ) && $i['level'] >= 4 && round($price/$x) > 25 ) { - if($this->stats['shopSale'] == 0 && $c['nosanich'] == false) { - // - $prmn = 0; // - $prmn = (1-( pow(0.5, ($price/$x/200) ) ))*100; - $prmn = round(20/100*$prmn); - if(rand(0,100) < 20+$prmn && rand(0,100) > 80-$prmn) { - //3143 - 3192 - if(rand(0,100) < 20+$prmn && rand(0,100) > 80-$prmn) { - // - $gitm = rand(3193,3195); - }else{ - $gitm = rand(3143,3192); - } - if($gitm == 3193) { - $gitm = 3194; - } - if($sid == 5) { - // - } - $this->addItem($gitm,$this->info['id']); - $rs++; - } - } - } - $zx++; - } - - if($rs > 1) { - if(rand(0,1) == 1) { - $r .= ' - . (x'.$rs.')'; - }elseif(rand(0,1)){ - $r .= ' . (x'.$rs.')'; - }else{ - $r .= ' - . (x'.$rs.')'; - } - }elseif($rs > 0) { - if(rand(0,1) == 1) { - $r .= ' - .'; - }elseif(rand(0,1)){ - $r .= ' .'; - }else{ - $r .= ' - .'; - } - } - - - $j = 0; - while($jaddDelo(1,$this->info['id'],'"Shop.'.$this->info['city'].'": "'.$i['name'].'" (x'.$x.') [#'.$i['iid'].'] '.$price.' .'.$zuby_inf.'',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0); - }else{ - // - $r = ' "'.$i['name'].'". "'.$this->city_name[$this->info['city']].'" '.$price.' .
.'; - $ld = $this->addDelo(1,$this->info['id'],'"Shop.'.$this->info['city'].'": #'.$i['iid'].'. : '.$price.' .',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0); - if(!$ld){ - echo '
, /db/usersDelo/!
'; - } - } - }else{ - $r = ' ...'; - } - } - } - }else{ - $r = ' '; - } - return '
'.$r.'
'; -} - - public function takeBonus() { - if(!isset($_GET['getb1w'])) { - /*$this->info['money'] += 25; - mysql_query('UPDATE `users` SET `money` = "'.$this->info['money'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - mysql_query('INSERT INTO `aaa_bonus` (`uid`,`time`) VALUES ( - "'.$this->info['id'].'","'.(time()+1*3600).'" - )'); - $this->error = ' 25 .';*/ - }else{ - if( $_GET['getb1w'] == 3 ) { - $pensia1 = $this->pensia(false); - $pensia2 = $this->pensia(true); - if( $this->info['timeMain'] < time() - 15 * 60 ) { - $afk = 1; - }else{ - $afk = 0; - } - if( $pensia2[0] == 1 ) { - $this->info['money'] += $pensia2[1]; - mysql_query('UPDATE `users` SET `money` = `money` + "'.$pensia2[1].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - }else{ - $this->info['money2'] += $pensia2[1]; - mysql_query('UPDATE `users` SET `money2` = `money2` + "'.$pensia2[1].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - $this->error = ' '.$pensia1.'! '; - mysql_query('INSERT INTO `aaa_bonus` ( - `uid`,`time`,`afk`,`type`,`money` - ) VALUES ( - "'.$this->info['id'].'","'.(time()+1*3600).'","'.$afk.'","'.$pensia2[0].'","'.$pensia2[1].'" - )'); - - } - } - } - - public function addDelo($tp,$uid,$txt,$tm,$ct,$frm,$mo,$mi,$vvv = false) - { - $inc = mysql_query("INSERT INTO `users_delo` (`dop`,`moneyOut`,`moneyIn`,`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('".mysql_real_escape_string($vvv)."','".mysql_real_escape_string($mo)."','".mysql_real_escape_string($mi)."','".mysql_real_escape_string($uid)."','".$_SERVER['HTTP_X_REAL_IP']."','".$ct."','".$tm."','".mysql_real_escape_string($txt)."','".mysql_real_escape_string($frm)."',".$tp.")"); - if($inc) - { - return true; - }else{ - return false; - } - } - - public function newAct($test){ - $r = true; - if($test!=$this->info['nextAct'] && $this->info['nextAct']!='0'){ - $r = false; - }else{ - $na = md5(time().'_nextAct_'.rand(0,100)); - $upd = mysql_query('UPDATE `stats` SET `nextAct` = "'.$na.'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - if(!$upd){ - $r = false; - }else{ - $this->info['nextAct'] = $na; - } - } - return $r; - } - - public function buyItemCommison($sid, $item, $iid = NULL) { - global $sid; - $sid = mysql_real_escape_string($sid); - $itme = mysql_real_escape_string($item); - $iid = mysql_real_escape_string($iid); - $i2 = mysql_fetch_array(mysql_query('SELECT `iu`.`uid`, `iu`.`id`, `iu`.`uid`, `iu`.`1price`, `iu`.inGroup, `iu`.`data`, `iu`.`inShop`, `iu`.`item_id`, `u`.`login` as login FROM `items_users` as `iu` LEFT JOIN `users` as `u` ON `u`.id=`iu`.uid WHERE `iu`.`id` = '.$iid.' AND `iu`.`inShop` = 30 LIMIT 1')); - $i1 = mysql_fetch_array(mysql_query('SELECT `name`,`price1` FROM `items_main` WHERE `id` = '.$i2['item_id'].' LIMIT 1')); - $price = $i2['1price']; - if(isset($i2['id']) && isset($iid) && $sid==1 && $i2['inShop']==30){ - if($price>$this->info['money']) - $r = ' ( '.($price-$this->info['money']).' .)'; - else{ - $UpdMoney = mysql_query('UPDATE `users` SET `money` = "'.mysql_real_escape_string(round($this->info['money']-$price,2)).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - if($UpdMoney) { - $this->info['money'] -= $price; - $UpMoney2 = mysql_query('UPDATE `users` SET `money` = `money` + '.$price.' WHERE `id` = '.$i2['uid'].' LIMIT 1'); - #$UpItems = mysql_query('UPDATE `items_users` SET `uid` = '.$this->info['id'].', `1price` = "'.$i1['price1'].'", `lastUPD` = "'.time().'", `inShop` = 0 WHERE `id` = '.$iid.' and `inShop` = 30 LIMIT 1'); - - $col = $this->itemsX($iid); - if($col > 1) { - $UpItems = mysql_query('UPDATE `items_users` SET `uid` = '.$this->info['id'].', `inGroup` = `inGroup`+1000, `1price` = "'.$i1['price1'].'", `lastUPD` = "'.time().'", `inShop` = 0 WHERE `inShop` = 30 AND `inOdet` = "0"AND `item_id`="'.$i2['item_id'].'" AND `uid`="'.$i2['uid'].'" AND `inGroup` = "'.$i2['inGroup'].'" LIMIT '.$col.''); - } else { - $UpItems = mysql_query('UPDATE `items_users` SET `uid` = '.$this->info['id'].', `1price` = "'.$i1['price1'].'", `lastUPD` = "'.time().'", `inShop` = 0 WHERE `id` = "'.$iid.'" AND `inOdet` = "0" AND `delete` = "0" AND `uid`="'.$i2['uid'].'" LIMIT 1'); - } - // - if($UpItems){ - // - $r = ' "'.$i1['name'].( $col>1 ? ' (x'.$col.')' : '').'" '.$price.' .
.'; - $ld = $this->addDelo(1,$this->info['id'],'"ComissShop.'.$this->info['city'].'": "'.$i1['name'].( $col>1 ? ' (x'.$col.')' : '').'" [item:'.$iid.'] '.$price.' . [: '.( $i2['login']!='' ? ''.$i2['login'].'' : '('.$i2['uid'].')').']',time(),$this->info['city'],'Shop.'.$this->info['city'].'',$price,0); - $u2s = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$i2['uid'].'" LIMIT 1')); - $ld = $this->addDelo(1,$u2s['id'],'"ComissShop.'.$this->info['city'].'": "'.$i1['name'].( $col>1 ? ' (x'.$col.')' : '').'" [item:'.$iid.'] '.$price.' . [: '.$this->info['login'].']',time(),$this->info['city'],'Shop.'.$this->info['city'].'',0,$price); - } else { - // - $r = ' "'.$i1['name'].( $col>1 ? ' (x'.$col.')' : '').'". "'.$this->city_name[$this->info['city']].'" '.$price.' .
.'; - $ld = $this->addDelo(1,$this->info['id'],'"EkrShop.'.$this->info['city'].'": #'.$i1['iid'].'. : '.$price.' .',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0); - if(!$ld) echo '
, /db/usersDelo/!
'; - } - } else { - $r = ' ...'; - } - } - }else - $r = ' '; - return '
'.$r.'
'; - } - - public function commisonRent($action,$iid,$price=NULL) { - if($action==" " && isset($iid) && $price >0 ) { - $ChImtem = mysql_fetch_array(mysql_query('SELECT `id`, `item_id`, `data`, `inGroup`, `uid` FROM `items_users` WHERE `id` = '.$iid.' LIMIT 1')); - $ChSudba = $this->lookStats($ChImtem['data']); - if(isset($ChSudba['sudba']) || $ChSudba['sudba'] != 0 || $ChSudba['sudba']==1 || isset($ChSudba['toclan'])) { - continue; - } else { - if( isset($ChImtem['inGroup']) AND $ChImtem['inGroup'] > 0 ) { - $col = $this->itemsX($ChImtem['id']); - if($col > 1){ - mysql_query('UPDATE `items_users` SET `inShop` = 30, `1price` = '.$price.' WHERE `item_id`="'.$ChImtem['item_id'].'" AND `uid`="'.$ChImtem['uid'].'" AND `inGroup` = "'.$ChImtem['inGroup'].'" LIMIT '.$col.''); - } else { - mysql_query('UPDATE `items_users` SET `inShop` = 30, `1price` = '.$price.' WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$iid.'" AND `inOdet` = "0" AND `delete` = "0" '); - } - } else { - mysql_query('UPDATE `items_users` set `inShop` = 30, `1price` = '.$price.' where `uid` = "'.$this->info['id'].'" AND `id` = "'.$iid.'" AND `inOdet` = "0" AND `delete` = "0" '); - } - } - }elseif($action=="" && isset($iid)) { - $i = mysql_fetch_array(mysql_query('SELECT `im`.`price1`,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.$iid.'" AND `iu`.`inShop` = "30" AND `iu`.`delete` = "0" LIMIT 1')); - if( isset($i['inGroup']) AND $i['inGroup'] > 0 ){ - $col = $this->itemsX($i['id']); - if($col > 1){ - mysql_query('UPDATE `items_users` SET `inShop` = 0, `1price` = '.$i['price1'].' WHERE `item_id`="'.$i['item_id'].'" AND `inShop` = "30" AND `uid`="'.$i['uid'].'" AND `inGroup` = "'.$i['inGroup'].'" LIMIT '.$col.''); - } else { - mysql_query('UPDATE `items_users` SET `inShop` = 0, `1price` = '.$i['price1'].' WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$iid.'" AND `inOdet` = "0" AND `delete` = "0" '); - } - } else { - mysql_query('UPDATE `items_users` SET `inShop` = 0, `1price` = "'.$i['price1'].'" WHERE `id` = "'.$iid.'" and `inShop` = "30" LIMIT 1'); - } - } - } - - public function bronFx($br) { - $r = ''; - if( $br[0] > 0 ) { - $r .= $br[0]-1; - }else{ - $r .= 0; - } - $r .= 'd'; - if( $br[0] > 0 ) { - $r .= $br[1]-$br[0]; - }else{ - $r .= 0; - } - return $r; - } - - /*public function commisionShop($sid,$preview = "full"){ - global $c,$code,$sid; - - switch ((int)$_GET['otdel']) { - case 1:$typeOtdel = 18; break; - case 2:$typeOtdel = 19; break; - case 3:$typeOtdel = 20; break; - case 4:$typeOtdel = 21; break; - case 5:$typeOtdel = 22; break; - case 6:$typeOtdel = 15; break; - case 7:$typeOtdel = 12; break; - case 8:$typeOtdel = 4; break; - case 9:$typeOtdel = 5; break; - case 10:$typeOtdel = 6; break; - case 11:$typeOtdel = 1; break; - case 12:$typeOtdel = 3; break; - case 13:$typeOtdel = 8; break; - case 14:$typeOtdel = 14; break; - case 15:$typeOtdel = 13; break; - case 16:$typeOtdel = 9; break; - case 17:$typeOtdel = 10; break; - case 18:$typeOtdel = 11; break; - case 19:$typeOtdel = 29; break; - case 20:$typeOtdel = 30; break; - case 1050:$typeOtdel = 1050; break; - default :$typeOtdel = 18; - } - - - // - - if( $typeOtdel == 1050 ) { - // - if($preview == "full") { - - }else{ - $sp = mysql_query('SELECT `a`.*,`b`.* FROM `items_users` AS `a` LEFT JOIN `items_main` AS `b` ON `a`.`item_id` = `b`.`id` WHERE `a`.`inShop` = "30" AND - `b`.`type` != "18" AND - `b`.`type` != "19" AND - `b`.`type` != "20" AND - `b`.`type` != "21" AND - `b`.`type` != "22" AND - `b`.`type` != "15" AND - `b`.`type` != "12" AND - `b`.`type` != "4" AND - `b`.`type` != "5" AND - `b`.`type` != "6" AND - `b`.`type` != "1" AND - `b`.`type` != "3" AND - `b`.`type` != "8" AND - `b`.`type` != "14" AND - `b`.`type` != "13" AND - `b`.`type` != "9" AND - `b`.`type` != "10" AND - `b`.`type` != "11" AND - `b`.`type` != "29" AND - `b`.`type` != "30" - - GROUP BY `b`.`name` - - '); - } - }else{ - // - if($preview == "full") { - - }else{ - $sp = mysql_query('SELECT `a`.*,`b`.* FROM `items_users` AS `a` LEFT JOIN `items_main` AS `b` ON `a`.`item_id` = `b`.`id` WHERE `a`.`inShop` = "30" AND `b`.`type` = "'.mysql_real_escape_string($typeOtdel).'" GROUP BY `b`.`name` ORDER BY `b`.`name` DESC'); - } - // - } - $cr = 'c8c8c8'; - $i = 0; - $steckCikl = 1; - while($pl = mysql_fetch_array($sp)) { - // - $is1 = ''; - $is2 = ''; - // - if($preview == "full") { - - }else{ - // - //$pvr1 = mysql_fetch_array(mysql_query('SELECT `1price` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `1price` ASC LIMIT 1')); - //$pvr2 = mysql_fetch_array(mysql_query('SELECT `1price` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `1price` DESC LIMIT 1')); - // - $is2 .= ''.$pl['name'].'   (: '.$pl['massa'].')'; - //$is2 .= '
: '.$pvr1[0].'-'.$pvr2[0].' . (: 0)'; - // - //$pvr1 = mysql_fetch_array(mysql_query('SELECT `iznosNOW`,`iznosMAX` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `iznosNOW` ASC LIMIT 1')); - //$pvr2 = mysql_fetch_array(mysql_query('SELECT `iznosNOW`,`iznosMAX` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `iznosNOW` DESC LIMIT 1')); - // - //$is2 .= '
: '.floor($pvr1[0]).'-'.floor($pvr1[1]).'/'.floor($pvr2[0]).'-'.floor($pvr2[1]).''; - // - $is1 .= '
'; - $is1 .= '
'; - } - echo '
'; - if( $cr == 'c8c8c8' ) { - $cr = 'd4d4d4'; - }else{ - $cr = 'c8c8c8'; - } - $i++; - } - // - if( $i == 0 ) { - echo ''; - } - // - //* * * * * * * * * * * - }*/ - - public function commisionShop($sid,$preview = "full"){ - global $c,$code,$sid; - switch ((int)$_GET['otdel']){ - case 1:$typeOtdel = 18; break; - case 2:$typeOtdel = 19; break; - case 3:$typeOtdel = 20; break; - case 4:$typeOtdel = 21; break; - case 5:$typeOtdel = 22; break; - case 6:$typeOtdel = 15; break; - case 7:$typeOtdel = 12; break; - case 8:$typeOtdel = 4; break; - case 9:$typeOtdel = 5; break; - case 10:$typeOtdel = 6; break; - case 11:$typeOtdel = 1; break; - case 12:$typeOtdel = 3; break; - case 13:$typeOtdel = 8; break; - case 14:$typeOtdel = 14; break; - case 15:$typeOtdel = 13; break; - case 16:$typeOtdel = 9; break; - case 17:$typeOtdel = 10; break; - case 18:$typeOtdel = 11; break; - case 19:$typeOtdel = 29; break; - case 20:$typeOtdel = 30; break; - case 1050:$typeOtdel = 1050; break; - default :$typeOtdel = 18; - } - if($typeOtdel != 1050) { - if($preview == "full"){ - $cl = mysql_query('SELECT `items_users`.`id`,`items_users`.`item_id`,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id`,`items_main`.`name`,`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,`items_main`.`lvl_aexp`, count(`items_users`.`id`) as inGroupCount -FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`) -WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp() OR `items_main`.srok = "0") AND `items_users`.`delete`="0" AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` = "'.mysql_real_escape_string($typeOtdel).'" and `items_users`.`item_id` = "'.(INT)$_GET['itemid'].'" GROUP BY `items_users`.`inGroup`, `items_users`.`uid`,`items_users`.`1price` HAVING `items_users`.inGroup > 0 -UNION ALL SELECT `items_users`.`id`,`items_users`.`item_id`,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id`,`items_main`.`name`,`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,`items_main`.`lvl_aexp`, count(`items_users`.`id`) as inGroupCount -FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`) -WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp() OR `items_main`.srok = "0") AND `items_users`.`delete`="0" AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` = "'.mysql_real_escape_string($typeOtdel).'" and `items_users`.`item_id` = "'.(INT)$_GET['itemid'].'" GROUP BY `items_users`.`uid`, `items_users`.`1price` HAVING `items_users`.inGroup = 0 -ORDER BY `1price`ASC , inGroupCount DESC'); - } else { - $cl = mysql_query('SELECT `items_users`.`id`,`items_users`.`item_id`,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id`,`items_main`.`name`,`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,`items_main`.`lvl_aexp` FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`) WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp() OR `items_main`.srok = "0") AND `items_users`.`delete`="0" AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` = "'.mysql_real_escape_string($typeOtdel).'" GROUP BY `items_users`.`item_id` ORDER BY `items_main`.`id` DESC'); - } - } else { - if($preview == "full"){ - $cl = mysql_query('SELECT -`items_users`.`id` as id, `items_users`.`id` AS `idu`,`items_users`.`item_id` as item_id,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`, -`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`, -`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`, -`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`, -`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id` as item_id,`items_main`.`name`, -`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`, -`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`, -`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`, -`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`, -`items_main`.`lvl_aexp` , count(`items_users`.`id`) as inGroupCount -FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`) -WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp() OR `items_main`.srok = "0") AND `items_users`.`delete`="0" AND `items_users`.`item_id` = "'.(INT)$_GET['itemid'].'" -AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` != "18" AND `items_main`.`type` != "19" AND `items_main`.`type` != "20" AND `items_main`.`type` != "21" AND `items_main`.`type` != "22" AND `items_main`.`type` != "15" AND `items_main`.`type` != "12" AND `items_main`.`type` != "4" AND `items_main`.`type` != "5" AND `items_main`.`type` != "6" AND `items_main`.`type` != "1" AND `items_main`.`type` != "3" AND `items_main`.`type` != "8" AND `items_main`.`type` != "14" AND `items_main`.`type` != "13" AND `items_main`.`type` != "9" AND `items_main`.`type` != "10" AND `items_main`.`type` != "11" AND `items_main`.`type` != "29" AND `items_main`.`type` != "30" -GROUP BY `items_users`.`inGroup`, `items_users`.`uid`,`items_users`.`1price` HAVING `items_users`.inGroup > 0 -UNION ALL -SELECT `items_users`.`id` as id, `items_users`.`id` AS `idu`,`items_users`.`item_id` as item_id,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`, -`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`, -`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`, -`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`, -`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id` as item_id,`items_main`.`name`, -`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`, -`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`, -`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`, -`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`, -`items_main`.`lvl_aexp`, count(`items_users`.`id`) as inGroupCount -FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`) -WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp() OR `items_main`.srok = "0") AND `items_users`.`delete`="0" AND `items_users`.`item_id` = "'.(INT)$_GET['itemid'].'" -AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` != "18" AND `items_main`.`type` != "19" AND `items_main`.`type` != "20" AND `items_main`.`type` != "21" AND `items_main`.`type` != "22" AND `items_main`.`type` != "15" AND `items_main`.`type` != "12" AND `items_main`.`type` != "4" AND `items_main`.`type` != "5" AND `items_main`.`type` != "6" AND `items_main`.`type` != "1" AND `items_main`.`type` != "3" AND `items_main`.`type` != "8" AND `items_main`.`type` != "14" AND `items_main`.`type` != "13" AND `items_main`.`type` != "9" AND `items_main`.`type` != "10" AND `items_main`.`type` != "11" AND `items_main`.`type` != "29" AND `items_main`.`type` != "30" -GROUP BY `items_users`.`uid`,`items_users`.`1price` HAVING `items_users`.inGroup = 0 -ORDER BY `1price`ASC , inGroupCount DESC'); - } else { - $cl = mysql_query('SELECT `items_users`.`id`, `items_users`.`id` AS `idu`,`items_users`.`item_id`,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id`,`items_main`.`name`,`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,`items_main`.`lvl_aexp` FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`) WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp() OR `items_main`.srok = "0") AND `items_users`.`delete`="0" AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` != "18" AND `items_main`.`type` != "19" AND `items_main`.`type` != "20" AND `items_main`.`type` != "21" AND `items_main`.`type` != "22" AND `items_main`.`type` != "15" AND `items_main`.`type` != "12" AND `items_main`.`type` != "4" AND `items_main`.`type` != "5" AND `items_main`.`type` != "6" AND `items_main`.`type` != "1" AND `items_main`.`type` != "3" AND `items_main`.`type` != "8" AND `items_main`.`type` != "14" AND `items_main`.`type` != "13" AND `items_main`.`type` != "9" AND `items_main`.`type` != "10" AND `items_main`.`type` != "11" AND `items_main`.`type` != "29" AND `items_main`.`type` != "30" GROUP BY `items_users`.`item_id` ORDER BY `items_main`.`id` DESC'); - } - } - $cr = 'c8c8c8'; - $i = 0; - $steckCikl = 1; - while($pl = mysql_fetch_array($cl)){ - // - if ( $preview == "preview" ) { - //$steck = mysql_fetch_array(mysql_query('SELECT COUNT(`item_id`) FROM `items_users` WHERE `item_id` = "'.$pl['item_id'].'" AND `inShop` = 30 LIMIT 1')); - $steck = array('--' , '--' , '--' , '--'); - } - if($cr=='d4d4d4'){ $cr = 'c8c8c8'; } else { $cr = 'd4d4d4'; } - if( $preview == "preview" && ($steck[0]>1 && $steck[0]>$steckCikl )){ - ++$steckCikl; - continue; - } else { - $steckCikl = 1; - $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$pl['item_id'].'" LIMIT 1')); - if($steck[0]>1 && $preview == "preview") { - $po = $this->lookStats($d['data']); - } else { - $po = $this->lookStats($pl['data']); - } - if(($pl['type']>=18 && $pl['type']<=24) || $pl['type']==26 || $pl['type']==27) { - // + - if($pl['inOdet'] != 14) { - $po['zonb']++; - } - } - $is2 = ''; - $is1 = '
'; - if ($preview == "full"){ - $is1 .= ' '; - } elseif($preview=="preview") { - $is1 .= ' '; - } - // - - $col = $this->itemsX($pl[0]); - if($col>1 && $pl['inGroup']!=0 && $pl['inGroupCount']>1) { - $pl['kolvo'] = $col; - $pl['name'] .= ' (x'.$col.')'; - } - $is2 .= ''.$pl['name'].'    '; - if($pl['massa']>0 && $preview == "full") { - $is2 .= '(: '.round($pl['massa'],2).')'; - if($pl['gift']!=''){ - $ttl = ''; - if($pl['gift']==1){ - $ttl = ' -'; - }else{ - $ttl = ' '.$pl['gift'].'. - '; - } - $is2 .= ' '; - } - if(isset($po['art'])){ - $is2 .= ' '; - } - if(isset($po['sudba'])){ - if($po['sudba']=='0'){ - $is2 .= ' '; - }elseif($po['sudba']=='1'){ - $is2 .= ' '; - }else{ - $is2 .= ' '; - } - } - } - // - $is2 .= '
: '; - if($steck[0]>1 && $preview == "preview") { - $is2 .= $steck[3].'-'.$steck[4].' . '; - } else { - $is2 .= $pl['1price'].' . '; - } - if($pl['pricerep']>0){ - $is2 .= ' ('.round($pl['pricerep'],2).' )'; - } - - // - if($pl['iznosMAX']>0){ - $izcol = ''; - if(floor($pl['iznosNOW'])>=(floor($pl['iznosMAX'])-ceil($pl['iznosMAX'])/100*20)){ - $izcol = 'brown'; - } - } - if ($preview == "preview") { - $is2 .= '
: '.floor($steck[1]).'/'.ceil($steck[2]).''; - } else { - if($pl['iznosMAXi'] == 999999999) { - $is2 .= '
: '; - } else { - $is2 .= '
: '.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']).''; - } - } - // - - if($po['srok'] > 0){ - $pl['srok'] = $po['srok']; - } - if( $pl['srok'] > 0 AND $preview!="preview" ) { - if( $pl['time_create']+$pl['srok'] < time() ){ - $is2 .= '
: '.$this->timeOut($pl['srok']).' ()'; - } else { - $is2 .= '
: '.$this->timeOut($pl['srok']).' ( '.date('d.m.Y H:i',$pl['time_create']+$pl['srok']).')'; - } - }elseif( $pl['srok'] > 0 ){ - $is2 .= '
: '.$this->timeOut($pl['srok']); - } - if($pl['magic_chance'] > 0) { - $is2 .= '
: '.min(array($pl['magic_chance'],100)).'%'; - } - - // : - if((int)$pl['magic_inci'] > 0){ - $efi = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`type1`,`img`,`mdata`,`actionTime`,`type2`,`type3`,`onlyOne`,`oneType`,`noAce`,`see`,`info`,`overch`,`bp`,`noch` FROM `eff_main` WHERE `id2` = "'.((int)$pl['magic_inci']).'" LIMIT 1')); - if( isset($efi['id2']) && $efi['actionTime'] > 0 ){ - $is2 .= '
: '.$this->timeOut($efi['actionTime']); - } - } - if ($preview == "full" || $preview == "preview"){ - // : - $tr = ''; - $t = $this->items['tr']; - $x = 0; - while($x $this->stats[$n]){ - if( $n == 'rep' ) { - $temp = explode('::',$po['tr_'.$n]); - if( $this->rep['rep'.$temp[1]] < $temp[0] ) { $tr .= ''; $notr++; } - unset($temp); - } elseif( $n != 'align' || floor($this->info['align']) != $po['tr_'.$n] ) { - $tr .= ''; $notr++; - } - } - $tr .= '
'; - if( $n == 'rep' ) { - $temp = explode('::',$po['tr_'.$n]); - $tr .= $this->is[$n].' '.ucfirst(str_replace('city',' city',$temp[1])).': '.$temp[0]; - unset($temp); - }elseif( $n != 'align' ) { - if( $n == 'sex' ) { - if( $po['tr_'.$n] == 1 ) { - $tr .= $this->is[$n].': '; - }else{ - $tr .= $this->is[$n].': '; - } - }else{ - $tr .= $this->is[$n].': '.$po['tr_'.$n]; - } - }else{ - $tr .= $this->is[$n].': '.$this->align_nm[$po['tr_'.$n]]; - } - if($po['tr_'.$n] > $this->stats[$n]){ - if( $n != 'align' || floor($this->info['align']) != $po['tr_'.$n] ) { - $tr .= '
'; - } - } - } - $x++; - } - - if($tr!=''){ - $is2 .= '
:'.$tr; - } - // : - $tr = ''; $t = $this->items['add']; - $x = 0; - while($xis[$n])){ - $z = '+'; - if($po['add_'.$n]<0){ - $z = ''; - } - $tr .= '
'.$this->is[$n].': '.$z.''.$po['add_'.$n]; - } - $x++; - } - // () - $i = 1; $bn = array(1=>'',2=>'',3=>'',4=>''); - while($i<=4){ - if(isset($po['add_mab'.$i])){ - if($po['add_mab'.$i]==$po['add_mib'.$i] && $pl['geniration']==1){ - $z = '+'; - if($po['add_mab'.$i]<0){ - $z = ''; - } - $tr .= '
'.$bn[$i].': '.$z.''.$po['add_mab'.$i]; - }else{ - $tr .= '
'.$bn[$i].': '.$po['add_mib'.$i].'-'.$po['add_mab'.$i].' ('.$this->bronFx(array($po['add_mib'.$i],$po['add_mab'.$i])).')'; - } - } - $i++; - } - if($tr!=''){ - $is2 .= '
:'.$tr; - } - // : - $tr = ''; $t = $this->items['sv']; - if(isset($po['sv_yron_min'],$po['sv_yron_max'])){ - $tr .= '
: '.$po['sv_yron_min'].' - '.$po['sv_yron_max']; - } - $x = 0; - while($xis[$n].': '.$z.''.$po['sv_'.$n]; - } - $x++; - } - if($pl['2too']==1){ - $tr .= '
'; - } - if($pl['2h']==1){ - $tr .= '
'; - } - if(isset($po['zonb'])){ - $tr .= '
: '; - if($po['zonb']>0){ - $x = 1; - while($x<=$po['zonb']){ - $tr .= '+'; - $x++; - } - }else{ - $tr .= ''; - } - } - - if($tr!=''){ - $is2 .= '
:'.$tr; - } - - // - /*$tr = ''; - $x = 1; - while($x<=4){ - if($po['tya'.$x]>0){ - $tyc = ' '; - if($po['tya'.$x]>6){ - $tyc = ''; - } - if($po['tya'.$x]>14){ - $tyc = ''; - } - if($po['tya'.$x]>34){ - $tyc = ''; - } - if($po['tya'.$x]>79){ - $tyc = ''; - } - if($po['tya'.$x]>89){ - $tyc = ''; - } - if($po['tya'.$x]>=100){ - $tyc = ''; - } - $tr .= '
'.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)'; - } - $x++; - } - $x = 1; - while($x<=7){ - if($po['tym'.$x]>0){ - $tyc = ' '; - if($po['tym'.$x]>6){ - $tyc = ''; - } - if($po['tym'.$x]>14){ - $tyc = ''; - } - if($po['tym'.$x]>34){ - $tyc = ''; - } - if($po['tym'.$x]>79){ - $tyc = ''; - } - if($po['tym'.$x]>89){ - $tyc = ''; - } - if($po['tym'.$x]>=100){ - $tyc = ''; - } - $tr .= '
'.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)'; - } - $x++; - } - - if($tr!=''){ - $is2 .= '
:'.$tr; - }*/ - - $tr = ''; - - if(isset($po['imposed']) && $po['imposed']>0) { - if($po['imposed_lvl'] == 0) { - $rnc = 'maroon'; - }elseif($po['imposed_lvl'] == 1) { - $rnc = '#624542'; - }elseif($po['imposed_lvl'] == 2) { - $rnc = '#77090b'; - }elseif($po['imposed_lvl'] == 3) { - $rnc = '#d99800'; - }else{ - $rnc = '#282828'; - } - $po['imposed_name'] = str_replace(' ','',$po['imposed_name']); - $tr .= '
: '.$po['imposed_name'].' '; - unset($rnc); - } - if($tr!='') { - $is2 .= '
:'; - $is2 .= $tr; - } - - if($notr==0){ - $d[0] = 1; - if($pl['magic_inc']!=''){ - $d[2] = 1; - } - } - if(isset($po['free_stats']) && $po['free_stats']>0){ - $is2 .= '
:'; - $is2 .= '• : '.$po['free_stats'].''; - } - if(floor($pl['iznosNOW'])>=ceil($pl['iznosMAX'])){ - $d[0] = 0; - $d[2] = 0; - } - if(isset($po['complect']) || isset($po['complect2'])){ - $is2 .= '
:'; - } - if(isset($po['complect'])){ - // - $com1 = array('name'=>' ','x'=>0,'text'=>''); - $spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.$po['complect'].'" ORDER BY `x` ASC LIMIT 20'); - while($plc = mysql_fetch_array($spc)){ - $com1['name'] = $plc['name']; - $com1['text'] .= '    • '.$plc['x'].': '; - // - $i1c = 0; $i2c = 0; - $i1e = $this->lookStats($plc['data']); - while($i1citems['add'])){ - if(isset($i1e[$this->items['add'][$i1c]])){ - $i3c = $i1e[$this->items['add'][$i1c]]; - if($i3c>0){ - $i3c = '+'.$i3c; - } - if($i2c>0){ - $com1['text'] .= '    '.$this->is[$this->items['add'][$i1c]].': '.$i3c; - }else{ - $com1['text'] .= $this->is[$this->items['add'][$i1c]].': '.$i3c; - } - $com1['text'] .= '
'; - $i2c++; - } - $i1c++; - } - unset($i1c,$i2c,$i3c); - $com1['x']++; - } - $is2 .= '
• : '.$com1['name'].'
'; - $is2 .= $com1['text']; - $is2 .= ''; - } - if(isset($po['complect2'])){ - // - $com1 = array('name'=>' ','x'=>0,'text'=>''); - $spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.$po['complect2'].'" ORDER BY `x` ASC LIMIT 20'); - while($plc = mysql_fetch_array($spc)){ - $com1['name'] = $plc['name']; - $com1['text'] .= '    • '.$plc['x'].': '; - // - $i1c = 0; $i2c = 0; - $i1e = $this->lookStats($plc['data']); - while($i1citems['add'])){ - if(isset($i1e[$this->items['add'][$i1c]])){ - $i3c = $i1e[$this->items['add'][$i1c]]; - if($i3c>0){ - $i3c = '+'.$i3c; - } - if($i2c>0){ - $com1['text'] .= '    '.$this->is[$this->items['add'][$i1c]].': '.$i3c; - }else{ - $com1['text'] .= $this->is[$this->items['add'][$i1c]].': '.$i3c; - } - $com1['text'] .= '
'; - $i2c++; - } - $i1c++; - } - unset($i1c,$i2c,$i3c); - $com1['x']++; - } - $is2 .= '
• (): '.$com1['name'].'
'; - $is2 .= $com1['text']; - $is2 .= ''; - } - - $is2 .= ''; - if(isset($po['gravi'])) { - $is2 .= '
: '.$po['gravi'].''; - } - if($pl['info']!=''){ - $is2 .= '
:
'.$pl['info'].'
'; - } - if($po['info']!=''){ - $is2 .= '
'.$po['info'].'
'; - } - if($pl['max_text']-$pl['use_text'] > 0) { - $is2 .= '
: '.($pl['max_text']-$pl['use_text']).'
'; - } - if($pl['maidin']!=''){ - // $is2 .= '
'.$this->city_name[$pl['maidin']].'
'; - } - if(isset($po['noremont'])){ - $is2 .= '
'; - } - if(isset($po['nosale'])){ - $is2 .= '
'; - } - if(isset($po['nomodif'])){ - $is2 .= '
'; - } - if(isset($po['nodelete'])){ - $is2 .= '
'; - } - if(isset($po['frompisher']) && $po['frompisher']>0){ - $is2 .= '
'; - } - if(isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0 ) { - $is2 .= '
'; - } - if(isset($po['fromlaba']) && $po['fromlaba']>0){ - $is2 .= '
'; - } - if(isset($po['vip_sale']) && $po['vip_sale']>0) { - $is2 .= '
10%
'; - } - if($pl['dn_delete']>0){ - $is2 .= '
'; - } - if( $this->pokol > $pl['geni'] ) { - $is2 .= '
'; - } - if(isset($po['zazuby']) && $po['zazuby']>0){ - $is2 .= '
'; - } - //$is2 .= '
'.$this->city_name[$this->info['city']].'
'; - $is2 .= '
'; - } - if ($preview == "preview"){ - $kolvoprint = ": $steck[0] ."; - } - echo '
'; - $i++; - } - } - if($i==0) echo ''; - } - - public $sid_zuby = array( - // - 1 => 1, // - 9 => 1, // - 8 => 1 // - ); - - public function shopItems($sid,$plu = '') - { - global $c,$code,$sid; - - $sid_zuby = 0; - - if(isset($this->sid_zuby[$sid])) { - $sid_zuby = 1; - } - - if( $this->info['admin'] > 0 ) { - $ishp = mysql_fetch_array(mysql_query('SELECT * FROM `items_shop` WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.mysql_real_escape_string($_GET['itmid']).'" AND `kolvo` > 0 LIMIT 1')); - if( isset($_GET['itmup']) ) { - //mysql_query('UPDATE `items_shop` SET `pos` = "'.($ishp['pos']+1).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `pos` = "'.($ishp['pos']-1).'" LIMIT 1'); - mysql_query('UPDATE `items_shop` SET `pos` = "'.($ishp['pos']-1).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.mysql_real_escape_string($_GET['itmid']).'" AND `kolvo` > 0 LIMIT 1'); - }elseif( isset($_GET['itmdown']) ) { - //mysql_query('UPDATE `items_shop` SET `pos` = "'.($ishp['pos']-1).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `pos` = "'.($ishp['pos']+1).'" LIMIT 1'); - mysql_query('UPDATE `items_shop` SET `pos` = "'.($ishp['pos']+1).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.mysql_real_escape_string($_GET['itmid']).'" AND `kolvo` > 0 LIMIT 1'); - }elseif( isset($_GET['itmid']) ) { - //mysql_query('UPDATE `items_shop` SET `pos` = "'.mysql_real_escape_string($_GET['itmpos']).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.mysql_real_escape_string($_GET['itmid']).'" LIMIT 1'); - } - } - - - - - $cl = mysql_query('SELECT - `ish`.`price_4`,`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, - `ish`.`iid`,`ish`.`item_id`,`ish`.`data2`,`ish`.`iznos`,`ish`.`pos`,`ish`.`cantBuy`,`ish`.`kolvo`,`ish`.`geniration`,`ish`.`magic_inc`,`ish`.`timeOver`,`ish`.`overType`,`ish`.`secret_id`,`ish`.`sid`,`ish`.`r`,`ish`.`price_1`,`ish`.`price_2`,`ish`.`price_3`,`ish`.`level`,`ish`.`tr_items`,`ish`.`max_buy`,`ish`.`real`,`ish`.`nozuby` - FROM `items_shop` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`sid` = "'.mysql_real_escape_string($sid).'" AND `ish`.`r` = "'.mysql_real_escape_string($_GET['otdel']).'" ORDER BY `ish`.`pos` ASC'); - - - - /* - $cl = mysql_query('SELECT - `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, - `ish`.`iid`,`ish`.`item_id`,`ish`.`data2`,`ish`.`iznos`,`ish`.`pos`,`ish`.`cantBuy`,`ish`.`kolvo`,`ish`.`geniration`,`ish`.`magic_inc`,`ish`.`timeOver`,`ish`.`overType`,`ish`.`secret_id`,`ish`.`sid`,`ish`.`r`,`ish`.`price_1`,`ish`.`price_2`,`ish`.`price_3`,`ish`.`level`,`ish`.`tr_items`,`ish`.`max_buy`,`ish`.`real`,`ish`.`nozuby` - FROM `items_shop` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`sid` = "'.mysql_real_escape_string($sid).'" AND `ish`.`r` = "'.mysql_real_escape_string($_GET['otdel']).'" ORDER BY `ish`.`pos` ASC'); - */ - - $cr = 'c8c8c8'; - $i = 0; - $jid = 0; - while($pl = mysql_fetch_array($cl)) - { - /*if($pl['price_1']==0 && $pl['price1']>0) - { - mysql_query('UPDATE `items_shop` SET `price_1` = "'.$pl['price1'].'" WHERE `iid` = "'.$pl['iid'].'" LIMIT 1'); - } - if($pl['price_2']==0 && $pl['price2']>0) - { - mysql_query('UPDATE `items_shop` SET `price_2` = "'.$pl['price2'].'" WHERE `iid` = "'.$pl['iid'].'" LIMIT 1'); - }*/ - - if($pl['kolvo']>0) - { - $jid++; - //if( $pl['pos'] != $jid ) { - // $pl['pos'] = $jid; - // mysql_query('UPDATE `items_shop` SET `pos` = "'.($jid).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.$pl['id'].'" AND `kolvo` > 0 LIMIT 1'); - //} - if($cr=='d4d4d4') - { - $cr = 'c8c8c8'; - }else{ - $cr = 'd4d4d4'; - } - if($pl['price_1']<0.01 && $pl['tr_items']=='') - { - $pl['price_1'] = $pl['price1']; - } - if($pl['price_2']<0.01 && $pl['tr_items']=='') - { - $pl['price_2'] = $pl['price2']; - } - - if($pl['price_1']<0){ $pl['price_1'] = 0; } - if($pl['price_2']<0){ $pl['price_2'] = 0; } - $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$pl['id'].'" LIMIT 1')); - $po = $this->lookStats($d['data']); - - if( $sid == 609 ) { - $po['icos'] = 'WL'; - } - - /* - if($pl['level']==0 && $po['tr_lvl']>0) - { - mysql_query('UPDATE `items_shop` SET `level` = "'.$po['tr_lvl'].'" WHERE `iid` = "'.$pl['iid'].'" LIMIT 1'); - mysql_query('UPDATE `items_main` SET `level` = "'.$po['tr_lvl'].'" WHERE `iid` = "'.$pl['id'].'" LIMIT 1'); - }*/ - - if(($pl['type']>=18 && $pl['type']<=24) || $pl['type']==26 || $pl['type']==27) - { - // + - $po['zonb']++; - } - - $is2 = ''; - if($pl['type'] == 71) { - $is1 = '
'; - }else{ - $is1 = '
'; - } - if( $sid == 609 ) { - $is1 .= ''; - }else{ - //if($this->info['money']>$pl['price']) - //{ - if($sid==2 || $sid==777) { - $is1 .= ' '; - }else{ - $is1 .= ' '; - } - //} - if( $sid == 777 && $this->stats['silver'] > 1 ) { - //$is1 .= '
VIP ('.round($pl['price_2']/20,2).' .) '; - } - if($pl['nozuby'] == 0) { - if($this->info['level'] > 0 && $this->info['level'] < 8) { - if($pl['level'] < 8 && $sid_zuby == 1 && $pl['nozuby'] == 0 && $c['zuby'] == true) { - $is1 .= '
'; - /*if( $this->info['admin'] > 0 ) { - if( isset($_GET['nozbpl']) && $pl['iid'] == $_GET['nozbpl'] ) { - mysql_query('UPDATE `items_shop` SET `nozuby` = 1 WHERE `iid` = "'.$pl['iid'].'" LIMIT 1'); - } - $is1 .= '

( )'; - }*/ - } - } - }/*elseif( $this->info['admin'] > 0 ) { - if( isset($_GET['nozbpl']) && $pl['iid'] == $_GET['nozbpl'] ) { - mysql_query('UPDATE `items_shop` SET `nozuby` = 0 WHERE `iid` = "'.$pl['iid'].'" LIMIT 1'); - } - $is1 .= '

( )'; - }*/ - } - /* - if($this->info['admin'] > 0) { - $is1 .= '

:
'. - ' '. - ', '. - ', '. - ', '. - ', '. - ', '. - ',
'; - } - - if($this->info['admin'] > 0) { - $is1 .= '
:
'. - ' '. - ', '. - ', '. - ', '. - ', '. - ', '. - ',
'; - // - - } - - if($this->info['admin']>0) { - if(isset($_GET['add_class']) && isset($_GET['itm_id']) && $_GET['itm_id'] == $pl['id']) { - mysql_query('UPDATE `items_main` SET `class` = "'.mysql_real_escape_string($_GET['add_class']).'" WHERE `id` = "'.$pl['item_id'].'" LIMIT 1'); - $pl['class'] = $_GET['add_class']; - } - if(isset($_GET['add_aclass']) && isset($_GET['itm_id']) && $_GET['itm_id'] == $pl['id']) { - mysql_query('UPDATE `items_main` SET `anti_class` = "'.mysql_real_escape_string($_GET['add_aclass']).'" WHERE `id` = "'.$pl['item_id'].'" LIMIT 1'); - $pl['anti_class'] = $_GET['add_aclass']; - } - - if($pl['class'] > 0) { - $clnm = array('','','','','','',''); - $is1 .= '

'.$clnm[$pl['class']].''; - unset($clnm); - } - - if($pl['anti_class'] > 0) { - $clnm = array('','','','','','',''); - $is1 .= '
'.$clnm[$pl['anti_class']].''; - unset($clnm); - } - } - */ - // - - if(isset($po['tr_align']) && !isset($po['tr_align_bs'])) { - $pl['name'] .= ''; - } elseif(isset($po['tr_align_bs'])) { - if($po['tr_align_bs'] == '1') { - $pl['name'] .= ''; - } elseif($po['tr_align_bs'] == '3') { - $pl['name'] .= ''; - } - } - - if( isset($po['tr_rep']) && isset($po['tr_dungeon']) ) { - //$pl['name'] .= ''; - } - if( isset($po['renameadd']) && $po['renameadd'] != '' ) { - $pl['name'] .= ' (: '.$po['renameadd'].')'; - } - if( isset($po['icos']) ) { - $pl['name'] = ''.$pl['name'].'  '.$po['icos'].' '; - } - $is2 .= ''.$pl['name'].'    '; - - - if($pl['massa']>0) - { - $is2 .= '(: '.round($pl['massa'],2).')'; - } - - if(isset($po['art'])) - { - $is2 .= ' '; - } - - if(isset($po['sudba'])) - { - if($po['sudba']=='0') - { - $is2 .= ' '; - }elseif($po['sudba']=='1'){ - $is2 .= ' '; - }else{ - $is2 .= ' '; - } - } - - // - if( $this->info['admin'] > 0 ) { - $is2 .= '
  '.$pl['pos'].'  
'; - } - $is2 .= '
: '; - if( $this->stats['silver'] >= 1 && $sid == 1 ) { - $is2 .= ''; - }elseif( $this->stats['silver'] >= 5 && ($sid == 2 || $sid == 777) ) { - $is2 .= ''; - } - if( $sid == 609 ) { - if($pl['price_4'] > ($this->rep['rep3']-$this->rep['rep3_buy'])) - { - $is2 .= ''.round($pl['price_4']).''; - }else{ - $is2 .= ''.round($pl['price_4']).''; - } - - $is2 .= ' '; - }elseif($pl['price_3'] > 0) { - if($pl['price_3']>$this->info['money3']) - { - $is2 .= ''.$pl['price_3'].''; - }else{ - $is2 .= $pl['price_3']; - } - $is2 .= ' $ '; - }elseif($sid==2 || $sid==777) - { - $is .= ''; - if($pl['price_2']>$this->info['money2']) - { - $is2 .= ''.$pl['price_2'].''; - }else{ - $is2 .= $pl['price_2']; - } - $is2 .= ' . '; - }else{ - if($pl['price_1']>$this->info['money']) - { - $is2 .= ''.$pl['price_1'].''; - }else{ - $is2 .= $pl['price_1']; - } - $is2 .= ' . '; - } - if( $this->stats['silver'] >= 1 && $sid == 1 ) { - $is2 .= '   '; - if($pl['price_1']>$this->info['money']) - { - $is2 .= ''.round($pl['price_1']*0.95,2).''; - }else{ - $is2 .= round($pl['price_1']*0.95,2); - } - $is2 .= ' . -5%'; - }elseif( $this->stats['silver'] >= 5 && ($sid == 2 || $sid == 777) ) { - $is2 .= '   '; - if($pl['price_2']>$this->info['money2']) - { - $is2 .= ''.round($pl['price_2']*0.95,2).''; - }else{ - $is2 .= round($pl['price_2']*0.95,2); - } - $is2 .= ' . -5%'; - } - - if($pl['pricerep']>0) - { - $is2 .= ' ('.round($pl['pricerep'],2).' )'; - } - - if($pl['kolvo'] < 100000) { - $is2 .= '     (: '.$pl['kolvo'].')'; - } - - if($pl['nozuby'] == 0 && $sid != 609 && $c['zuby'] == true) { - if($this->info['level'] > 0 && $this->info['level'] < 8) { - if($pl['level'] < 8 && $sid_zuby == 1) { - if( $this->stats['silver'] > 0 && $sid == 1 ) { - $is2 .= ' ('.ltrim($this->zuby(round($pl['price_1']*0.95,2)),' ').')'; - }else{ - $is2 .= ' ('.ltrim($this->zuby($pl['price_1']),' ').')'; - } - } - } - } - - if($pl['tr_items']!='') - { - $ttmm = ''; - $trn = 1; - $tims2 = explode(',',$pl['tr_items']); - $j = 0; - while($j0 && $tims[1]>0) - { - $tis = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$tims[0].'" LIMIT 1')); - if(isset($tis['id'])) - { - $num_rows = 0; - $s1p = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$tims[0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0"'); - while($p1l = mysql_fetch_array($s1p)) - { - $num_rows++; - } - if($num_rows < (int)$tims[1]) - { - $trn = 0; - } - $ttmm .= '['.$tis['name'].'] x'.$tims[1].', '; - } - } - $j++; - } - if( $c['noitembuy'] == true ) { - $trn = 1; - $ttmm = ''; - } - - if($ttmm!='') - { - $ttmm = '
: '.rtrim($ttmm,', ').' '; - if($trn==0) - { - $ttmm = ''.$ttmm.''; - } - } - } - - $is2 .= $ttmm.'
'; - unset($ttmm); - - - // - if( $pl['iznos'] > 0 ) { - $pl['iznosMAXi'] = $pl['iznos']; - } - if($pl['iznosMAXi']>0) - { - if($pl['iznosMAXi'] == 999999999) { - $is2 .= ':
'; - }else{ - $is2 .= ': 0/'.$pl['iznosMAXi'].'
'; - } - } - - if( $po['battleUseZd'] > 0 ) { - $is2 .= ' : '.$this->timeOut($po['battleUseZd']).'
'; - } - - $is2 = rtrim($is2,'
'); - - // - if($po['srok'] > 0) - { - $pl['srok'] = $po['srok']; - } - if($pl['srok'] > 0) - { - $is2 .= '
: '.$this->timeOut($pl['srok']); - } - if($pl['magic_chance'] > 0) { - $is2 .= '
: '.min(array($pl['magic_chance'],100)).'%'; - } - - // : - if((int)$pl['magic_inci'] > 0) - { - $efi = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`type1`,`img`,`mdata`,`actionTime`,`type2`,`type3`,`onlyOne`,`oneType`,`noAce`,`see`,`info`,`overch`,`bp`,`noch` FROM `eff_main` WHERE `id2` = "'.((int)$pl['magic_inci']).'" LIMIT 1')); - if(isset($efi['id2']) && $efi['actionTime']>0) - { - $is2 .= '
: '.$this->timeOut($efi['actionTime']); - } - } - - // : - $tr = ''; $t = $this->items['tr']; - $x = 0; - while($x $this->stats[$n]) - { - if( $n == 'rep' ) { - $temp = explode('::',$po['tr_'.$n]); - if( $this->rep['rep'.$temp[1]] < $temp[0] ) { $tr .= ''; $notr++; } - unset($temp); - } elseif( $n != 'align' || floor($this->info['align']) != $po['tr_'.$n] ) { - $tr .= ''; $notr++; - } - } - $tr .= '
'; - if( $n == 'rep' ) { - $temp = explode('::',$po['tr_'.$n]); - $tr .= $this->is[$n].' '.ucfirst(str_replace('city',' city',$temp[1])).': '.$temp[0]; - unset($temp); - }elseif( $n != 'align' ) { - if( $n == 'sex' ) { - if( $po['tr_'.$n] == 1 ) { - $tr .= $this->is[$n].': '; - }else{ - $tr .= $this->is[$n].': '; - } - }else{ - $tr .= $this->is[$n].': '.$po['tr_'.$n]; - } - }else{ - $tr .= $this->is[$n].': '.$this->align_nm[$po['tr_'.$n]]; - } - if($po['tr_'.$n] > $this->stats[$n]) - { - if( $n != 'align' || floor($this->info['align']) != $po['tr_'.$n] ) { - $tr .= '
'; - } - } - } - $x++; - } - if($tr!='') - { - - $is2 .= '
:'.$tr; - } - // : - $tr = ''; $t = $this->items['add']; - $x = 0; - while($xis[$n])) - { - $z = '+'; - if($po['add_'.$n]<0) - { - $z = ''; - } - $tr .= '
'.$this->is[$n].': '.$z.''.$po['add_'.$n]; - } - $x++; - } - // () - $i = 1; $bn = array(1=>'',2=>'',3=>'',4=>''); - while($i<=4) - { - if(isset($po['add_mab'.$i])) - { - if($po['add_mab'.$i]==$po['add_mib'.$i] && $pl['geniration']==1) - { - $z = '+'; - if($po['add_mab'.$i]<0) - { - $z = ''; - } - $tr .= '
'.$bn[$i].': '.$z.''.$po['add_mab'.$i]; - }else{ - $tr .= '
'.$bn[$i].': '.$po['add_mib'.$i].'-'.$po['add_mab'.$i]; - } - } - $i++; - } - - if($tr!='') - { - $is2 .= '
:'.$tr; - } - // : - $tr = ''; $t = $this->items['sv']; - if(isset($po['sv_yron_min'],$po['sv_yron_max'])) - { - $tr .= '
: '.$po['sv_yron_min'].' - '.$po['sv_yron_max']; - } - $x = 0; - while($xis[$n].': '.$z.''.$po['sv_'.$n]; - } - $x++; - } - if($pl['2too']==1) - { - $tr .= '
'; - } - if($pl['2h']==1) - { - $tr .= '
'; - } - if(isset($po['zonb'])) - { - $tr .= '
: '; - if($po['zonb']>0) - { - $x = 1; - while($x<=$po['zonb']) - { - $tr .= '+'; - $x++; - } - }else{ - $tr .= ''; - } - } - if($tr!='') - { - $is2 .= '
:'.$tr; - } - - // - /*$tr = ''; - $x = 1; - while($x<=4) - { - if($po['tya'.$x]>0) - { - $tyc = ' '; - if($po['tya'.$x]>6) - { - $tyc = ''; - } - if($po['tya'.$x]>14) - { - $tyc = ''; - } - if($po['tya'.$x]>34) - { - $tyc = ''; - } - if($po['tya'.$x]>79) - { - $tyc = ''; - } - if($po['tya'.$x]>89) - { - $tyc = ''; - } - if($po['tya'.$x]>=100) - { - $tyc = ''; - } - $tr .= '
'.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)'; - } - $x++; - } - $x = 1; - while($x<=7) - { - if(@$po['tym'.$x]>0) - { - $tyc = ' '; - if($po['tym'.$x]>6) - { - $tyc = ''; - } - if($po['tym'.$x]>14) - { - $tyc = ''; - } - if($po['tym'.$x]>34) - { - $tyc = ''; - } - if($po['tym'.$x]>79) - { - $tyc = ''; - } - if($po['tym'.$x]>89) - { - $tyc = ''; - } - if($po['tym'.$x]>=100) - { - $tyc = ''; - } - $tr .= '
'.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)'; - } - $x++; - } - if($tr!='') - { - $is2 .= '
:'.$tr; - }*/ - - $tr = ''; - - if(isset($po['imposed']) && $po['imposed']>0) { - if($po['imposed_lvl'] == 0) { - $rnc = 'maroon'; - }elseif($po['imposed_lvl'] == 1) { - $rnc = '#624542'; - }elseif($po['imposed_lvl'] == 2) { - $rnc = '#77090b'; - }elseif($po['imposed_lvl'] == 3) { - $rnc = '#d99800'; - }else{ - $rnc = '#282828'; - } - $po['imposed_name'] = str_replace(' ','',$po['imposed_name']); - $tr .= '
: '.$po['imposed_name'].' '; - unset($rnc); - } - if($tr!='') { - $is2 .= '
:'; - $is2 .= $tr; - } - - - if($notr==0) - { - $d[0] = 1; - if($pl['magic_inc']!='') - { - $d[2] = 1; - } - } - - if(isset($po['free_stats']) && $po['free_stats']>0) - { - $is2 .= '
:
'; - $is2 .= '• : +'.$po['free_stats'].' '; - } - - // - if($pl['magic_inci']!='' || $pl['magic_inc']!='') { - if($pl['magic_inc'] == '') { - $pl['magic_inc'] = $pl['magic_inci']; - } - $mgi = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "'.$pl['magic_inc'].'" AND `type1` = "12345" LIMIT 1')); - if(isset($mgi['id2'])) { - $is2 .= '
'.$mgi['minfo'].'
'; - } - } - - if(floor($pl['iznosNOW'])>=ceil($pl['iznosMAX'])) - { - $d[0] = 0; - $d[2] = 0; - } - if(isset($po['complect'])) - { - $is2 .= '
:'; - } - if(isset($po['complect'])) - { - // - $com1 = array('name'=>' ','x'=>0,'text'=>''); - $spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.$po['complect'].'" ORDER BY `x` ASC LIMIT 20'); - while($plc = mysql_fetch_array($spc)) - { - $com1['name'] = $plc['name']; - $com1['text'] .= '    • '.$plc['x'].': '; - // - $i1c = 0; $i2c = 0; - $i1e = $this->lookStats($plc['data']); - while($i1citems['add'])) - { - if(isset($i1e[$this->items['add'][$i1c]])) - { - $i3c = $i1e[$this->items['add'][$i1c]]; - if($i3c>0) - { - $i3c = '+'.$i3c; - } - if($i2c>0) - { - $com1['text'] .= '    '.$this->is[$this->items['add'][$i1c]].': '.$i3c; - }else{ - $com1['text'] .= $this->is[$this->items['add'][$i1c]].': '.$i3c; - } - $com1['text'] .= '
'; - $i2c++; - } - $i1c++; - } - unset($i1c,$i2c,$i3c); - $com1['x']++; - } - $is2 .= '
• : '.$com1['name'].'
'; - $is2 .= $com1['text']; - $is2 .= ''; - } - - if($pl['max_text']-$pl['use_text'] > 0) { - $is2 .= '
: '.($pl['max_text']-$pl['use_text']).'
'; - } - - $is2 .= ''; - - if(isset($po['gravi'])) { - $is2 .= '
: '.$po['gravi'].''; - } - - if($pl['info']!='') - { - $is2 .= '
:
'.$pl['info'].'
'; - } - - if($po['info']!='') - { - $is2 .= '
'.$po['info'].'
'; - } - - if($pl['maidin']!='') - { - // $is2 .= '
'.$this->city_name[$pl['maidin']].'
'; - } - - if(isset($po['noremont'])) - { - $is2 .= '
'; - } - - if(isset($po['nosale'])) - { - $is2 .= '
'; - } - - if(isset($po['nomodif'])) - { - $is2 .= '
'; - } - - if(isset($po['nodelete'])) - { - $is2 .= '
'; - } - - if(isset($po['frompisher']) && $po['frompisher']>0) - { - $is2 .= '
'; - } - - if(isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0 ) { - $is2 .= '
'; - } - - if(isset($po['fromlaba']) && $po['fromlaba']>0) - { - $is2 .= '
'; - } - - if(isset($po['vip_sale']) && $po['vip_sale']>0) - { - $is2 .= '
10%
'; - } - - if($pl['dn_delete']>0) - { - $is2 .= '
'; - } - - if( $this->pokol > $pl['geni'] ) { - $is2 .= '
'; - } - - if(isset($po['zazuby']) && $po['zazuby']>0) - { - $is2 .= '
'; - } - - //$is2 .= '
'.$this->city_name[$this->info['city']].'
'; - - $is2 .= '
'; - - $crd = ''; - - if($this->info['admin'] > 0) { - $crd = '  
'; - } - - echo '
'; - $i++; - } - - } - if($i==0) - { - echo ''; - } - } - - public function price($vl) - { - if($vl==round($vl)) - { - $vl = $vl.'.00'; - } - $vl = explode('.',$vl); - $vl = $vl[0].'.'.$vl[1].''; - return $vl; - } - - public function testBagStats() - { - $st = $this->lookStats($this->info['stats']); - $n1 = $this->info['ability']; - $i = 1; - while($i<=10) - { - $n1 += $st['s'.$i]; - $i++; - } - $n2 = $this->info['skills']; - $i = 1; - while($i<=7) - { - $n2 += $st['a'.$i]+$st['mg'.$i]; - $i++; - } - - $n01 = 12; - $n02 = 1; $ll = 0; - $lvl = mysql_query('SELECT `bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel` < "'.$this->info['upLevel'].'"'); - while($pl = mysql_fetch_array($lvl)) - { - $n01 += $pl['ability']; - $n02 += $pl['skills']; - if($ll<$pl['nextLevel']) - { - $n01 += 1; // - if($this->info['level']>=9) - { - $n01 += 1; - } - if($this->info['level']>=10) - { - $n01 += 2; - } - if($this->info['level']>=11) - { - $n01 += 4; - } - $ll++; - } - } - - if($n1-$n01!=3 || $n2!=$n02) - { - if($this->info['bagStats']!=$bg) - { - $bg = '['.$n1.'|'.$n01.'|'.$n2.'|'.$n02.']'; - mysql_query('UPDATE `stats` SET `bagStats` = "'.$bg.'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - $this->info['bagStats'] = $bg; - } - }else{ - if($this->info['bagStats']!='0') - { - mysql_query('UPDATE `stats` SET `bagStats` = "0" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - $this->info['bagStats'] = 0; - } - } - } - - public function wipe() - { - if($this->info['wipe']>0 && $this->info['battle']==0) - { - //wipe = 1 , - if($this->info['wipe']<4) - { - $st = $this->lookStats($this->info['stats']); - $n1 = $this->info['ability']; // - $n2 = $this->info['skills']; // - $n3 = $this->info['sskills']; // - $n4 = $this->info['nskills']; //??? - if($this->info['wipe']==1 || $this->info['wipe']==2) - - { - $i = 1; - while($i<=11) - { - if($i<=4) - { - $n1 += $st['s'.$i]-3; - $st['s'.$i] = 3; - }else{ - $n1 += $st['s'.$i]; - $st['s'.$i] = 0; - } - $i++; - } - $n1 -= $this->info['level']; - $st['s4'] = 3+$this->info['level']; - if($this->info['level']>=9) - { - $st['s4'] += 1; - $n1 -= 1; - } - if($this->info['level']>=10) - { - $st['s4'] += 2; - $n1 -= 2; - } - if($this->info['level']>=11) - { - $st['s4'] += 4; - $n1 -= 4; - } - } - - if($this->info['wipe']==1 || $this->info['wipe']==3) - { - $i = 1; - while($i<=7) - { - $n2 += $st['a'.$i]; - $n2 += $st['mg'.$i]; - $st['a'.$i] = 0; - $st['mg'.$i] = 0; - $i++; - } - } - if($this->info['wipe']==1 || $this->info['wipe']==3.5)#--- - { - $i = 1; - while($i<=11) - { - $n3 += $st['os'.$i]; - $st['os'.$i] = 0; - $i++; - } - } - // - $st = $this->impStats($st); - $upd = mysql_query('UPDATE `stats` SET `wipe`="0",`stats`="'.$st.'",`ability`="'.$n1.'",`skills`="'.$n2.'",`sskills`="'.$n3.'",`nskills`="'.$n4.'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - if($upd) - { - $this->info['stats'] = $st; - $this->info['ability'] = $n1; - $this->info['skills'] = $n2; - $this->info['sskills'] = $n3; - $this->info['nskills'] = $n4; - } - } - } - } - - public function __clone() - { - trigger_error(' .', E_USER_ERROR); - } - - // - public function trItem($po) - { - $tr = ''; $t = $this->items['tr']; - $x = 0; $notr = 0; - while($xinfo['sex'] != $po['tr_'.$n] ) { - $notr++; - } - }elseif($po['tr_'.$n] > $this->stats[$n] && $n != 'align') - { - $notr++; - } - } - $x++; - } - return $notr; - } - - public function freeStatsMod($id,$s,$uid) - { - $itm = mysql_fetch_array(mysql_query('SELECT - `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, - `iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` - FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.((int)$id).'" AND `iu`.`uid` = "'.$uid.'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0" LIMIT 1')); - if(isset($itm['id'])) - { - $po = $this->lookStats($itm['data']); -/* - mf_stats - mf_mod - mf_mib -*/ - // - if($_GET['mf'] == 's1' || $_GET['mf'] == 's2' || $_GET['mf'] == 's3' || $_GET['mf'] == 's5') { - if(isset($po['mf_stats']) && $po['mf_stats']>0 && isset($po['add_'.$_GET['mf']])) { - $po['mf_stats'] = (int)$po['mf_stats']; - $po['mf_stats'] -= 1; - $po['add_'.$_GET['mf']] += 1; - - $po = $this->impStats($po); - mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - } - }elseif($_GET['mf'] == 'm1' || $_GET['mf'] == 'm2' || $_GET['mf'] == 'm4' || $_GET['mf'] == 'm5') { - if(isset($po['mf_mod']) && $po['mf_mod']>0 && isset($po['add_'.$_GET['mf']])) { - $po['mf_mod'] = (int)$po['mf_mod']; - $po['mf_mod'] -= 1; - $po['add_'.$_GET['mf']] += 1; - - $po = $this->impStats($po); - mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - } - }elseif($_GET['mf'] == 'mib1' || $_GET['mf'] == 'mib2' || $_GET['mf'] == 'mib3' || $_GET['mf'] == 'mib4') { - $s = $_GET['mf']; - $s = str_replace('mib','',$s); - $s = (int)$s; - if(isset($po['mf_mib']) && $po['mf_mib']>0 && (isset($po['add_mib'.$s]) || isset($po['add_mab'.$s]))) { - $po['mf_mib'] = (int)$po['mf_mib']; - $po['mf_mib'] -= 1; - if(isset($po['add_mab'.$s])) { - $po['add_mab'.$s] += 1; - } - if(isset($po['add_mib'.$s])) { - $po['add_mib'.$s] += 1; - } - - $po = $this->impStats($po); - mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - } - } - - } - } - - public function freeStatsItem($id,$s,$uid) - { - $itm = mysql_fetch_array(mysql_query('SELECT - `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, - `iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` - FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.((int)$id).'" AND `iu`.`uid` = "'.$uid.'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0" LIMIT 1')); - if(isset($itm['id']) && ( $s == 1 || $s == 2 || $s == 3 || $s == 5 ) ) - { - $po = $this->lookStats($itm['data']); - if(isset($po['free_stats']) && $po['free_stats']>0) - { - $s = (int)$s; - if($s>=1 || $s<=3 || $s==5) - { - $po['free_stats'] = (int)$po['free_stats']; - $po['free_stats'] -= 1; - $po['add_s'.$s] += 1; - } - } - $po = $this->impStats($po); - - mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - } - } - - public function freeStats2Item($id,$s,$uid,$tp) - { - - $itm = mysql_fetch_array(mysql_query('SELECT - `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, - `iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` - FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.((int)$id).'" AND `iu`.`uid` = "'.$uid.'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0" LIMIT 1')); - if(isset($itm['id'])) - { - $po = $this->lookStats($itm['data']); - if($itm['so'] > 0) - { - $s = (int)$s; - if($tp == 1) { - // - if($s == 1 || $s == 2 || $s == 3 || $s == 5) { - if(10+25*$po['add_s'.$s] <= $itm['so'] && $itm['so'] > 0) { - $itm['so'] -= 10+25*$po['add_s'.$s]; - $po['add_s'.$s]++; - $this->error = ' ...'; - }else{ - $this->error = ' ...'; - } - } - }elseif($tp == 2) { - // - if($s > 0 && $s < 13) { - $s2 = 0; - if($s == 9 || $s == 12) { - if($s == 9) { - $s = 'm10'; - }elseif($s == 12) { - $s = 'zm'; - } - $s2 = 4+4*$po['add_'.$s]; - }else{ - if($s == 1) { - $s = 'm1'; - }elseif($s == 2) { - $s = 'm2'; - }elseif($s == 3) { - $s = 'm4'; - }elseif($s == 4) { - $s = 'm5'; - }elseif($s == 5) { - $s = 'mab1'; - }elseif($s == 6) { - $s = 'mab2'; - }elseif($s == 7) { - $s = 'mab3'; - }elseif($s == 8) { - $s = 'mab4'; - }elseif($s == 10) { - $s = 'za'; - }elseif($s == 11) { - $s = 'm11a'; - } - $s2 = 5+5*$po['add_'.$s]; - } - - if(4+4*$po['add_'.$s] <= $itm['so'] && $itm['so'] > 0) { - $itm['so'] -= $s2; - if($s=='mab1') { - $po['add_mib1']++; - }elseif($s=='mab2') { - $po['add_mib2']++; - }elseif($s=='mab3') { - $po['add_mib3']++; - }elseif($s=='mab4') { - $po['add_mib4']++; - } - $po['add_'.$s]++; - }else{ - $this->error = ' ...'; - } - } - } - } - $po = $this->impStats($po); - mysql_query('UPDATE `items_users` SET `data` = "'.$po.'",`so` = "'.$itm['so'].'" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - } - } - - public function obj_addItem($id){ - $itm = mysql_fetch_array(mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "'.((int)$id).'" LIMIT 1')); - if( $this->info['transfers'] < 1 ) { - $this->error = ' .'; - }elseif(isset($itm['id'])){ - if( isset($itm['inGroup']) AND $itm['inGroup'] > 0 ) { - $col = $this->itemsX($itm['id']); - if($col > 1){ - $upd = mysql_query('UPDATE `items_users` SET `inShop` = 1 WHERE `item_id`="'.$itm['item_id'].'" AND `inShop` != "30" AND `uid`="'.$itm['uid'].'" AND `inGroup` = "'.$itm['inGroup'].'" LIMIT '.$col.''); - } else { - $upd = mysql_query('UPDATE `items_users` SET `inShop` = 1 WHERE `uid` = "'.$this->info['id'].'" AND `inShop` != "30" AND `id` = "'.$itm['id'].'" AND `inOdet` = "0" AND `delete` = "0" '); - } - } else { - $upd = mysql_query('UPDATE `items_users` SET `inShop` = 1 WHERE `uid` = "'.$this->info['id'].'" AND `inShop` != "30" AND `id` = "'.$id.'" AND `inOdet` = "0" AND `delete` = "0" '); - } - if($upd) { /* - if($col>1) { $col = ' (x'.$col.')'; }else{ $col = ''; } - $this->info['transfers']--; - mysql_query('UPDATE `stats` SET `transfers` = "'.$this->info['transfers'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - $this->error = ' "'.$itm['name'].''.$col.'" '; - */ - } - } else { - $this->error = ' '; - } - } - - public function obj_takeItem($id){ - $itm = mysql_fetch_array(mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` -FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="1" AND `iu`.`id` = "'.((int)$id).'" LIMIT 1')); - if( $this->info['transfers'] < 1 ) { - $this->error = ' .'; - }elseif(isset($itm['id'])){ - if( isset($itm['inGroup']) && $itm['inGroup'] > 0 ) { - $col = $this->itemsX($itm['id']); - if($col > 1){ - $upd = mysql_query('UPDATE `items_users` SET `inShop` = 0 WHERE `uid` = "'.$this->info['id'].'" AND ( `id` = "'.$itm['id'].'" OR `inGroup` = "'.$itm['inGroup'].'") AND `inShop` != "30" AND `inOdet` = "0" AND `delete` = "0" '); - } else { - $upd = mysql_query('UPDATE `items_users` SET `inShop` = 0 WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$itm['id'].'" AND `inShop` != "30" AND `inOdet` = "0" AND `delete` = "0" '); - } - } else { - $upd = mysql_query('UPDATE `items_users` SET `inShop` = 0 WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$id.'" AND `inShop` != "30" AND `inOdet` = "0" AND `delete` = "0" '); - } - if($upd){ /* - if($col>1) { $col = ' (x'.$col.')'; }else{ $col = ''; } - $this->error = ' "'.$itm['name'].''.$col.'" '; - $this->info['transfers']--; - mysql_query('UPDATE `stats` SET `transfers` = "'.$this->info['transfers'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - */ - } - }else{ - $this->error = ' '; - } - } - - public function itemsSmSave($id,$s,$uid){ - $itm = mysql_fetch_array(mysql_query('SELECT - `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, - `iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` - FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.((int)$id).'" AND `iu`.`uid` = "'.$uid.'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0" LIMIT 1')); - if(isset($itm['id'])) - { - $s = (int)$s; - $po = $this->lookStats($itm['data']); - if(!isset($po['sudba']) || $po['sudba']!='0') - { - if(isset($po['sm_skill']) && $s>100) - { - $mx2 = 1; $mx1 = 0; $mx3 = $this->lookStats($this->info['stats']); - while($mx2<=7) - { - $mx1 += ($mx3['a'.$mx2]+$mx3['mg'.$mx2])-($po['add_a'.$mx2]+$po['add_mg'.$mx2]); - $mx2++; - } - $mx1 += $this->info['skills']; - if($mx1>0) - { - // - $s = $s - 100; - if($s>5 && $s<=12) - { - // - $po['add_mg'.($s-5)]++; - }elseif($s>0) - { - // - $po['add_a'.$s]++; - } - } - }elseif(isset($po['sm_abil']) && $s<11 && $s>0) - { - $mx2 = 1; $mx1 = 0; $mx3 = $this->lookStats($this->info['stats']); - while($mx2<=7) - { - $mx1 += $mx3['s'.$mx2]-$po['add_s'.$mx2]; - $mx2++; - } - $mx1 += $this->info['ability']; - if($mx1>0) - { - $po['add_s'.$s]++; - } - } - - $po = $this->impStats($po); - mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - - unset($mx1,$mx2,$mx3,$po); - } - } - } - - public function runeItem($id,$name,$ruid) { - - if($id == NULL) { - - if($ruid < 1 && isset($_GET['use_rune'])) { - $ruid = $_GET['use_rune']; - } - $rune = mysql_fetch_array(mysql_query('SELECT - `i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl` - ,`m`.`name`,`m`.`type`,`m`.`level` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE - `i`.`id` = "'.mysql_real_escape_string($ruid).'" - AND `i`.`uid` = "'.$this->info['id'].'" AND `i`.`delete` = "0" AND `i`.`inShop` = "0" LIMIT 1')); - - $it_type = 0; - if(isset($_GET['item_rune'])) { - $name = $_GET['item_rune']; - } - $vi = 0; - $vid = ''; - if( isset($_GET['item_rune_id']) ) { - $sp = mysql_query('SELECT - `i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl` - ,`m`.`type`,`m`.`2h`,`m`.`inslot`,`m`.`name`,`m`.`img` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON (`i`.`item_id` = `m`.`id`) - WHERE `i`.`inShop` = "0" AND - - ( (`m`.`inslot` > 0 AND `m`.`inslot` < 18) OR "'.$rune['type'].'" = "37" ) - - AND `i`.`delete` = "0" AND `i`.`inOdet` = "0" AND `i`.`id` = "'.mysql_real_escape_string($_GET['item_rune_id']).'" AND `i`.`uid` = "'.mysql_real_escape_string($this->info['id']).'"'); - $vi = -1; - }else{ - $sp = mysql_query('SELECT - `i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl` - ,`m`.`type`,`m`.`2h`,`m`.`inslot`,`m`.`name`,`m`.`img` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON (`i`.`item_id` = `m`.`id`) - - WHERE - - ( (`m`.`inslot` > 0 AND `m`.`inslot` < 18) OR "'.$rune['type'].'" = "37" ) AND - - `i`.`inShop` = "0" AND `i`.`delete` = "0" AND `i`.`inOdet` = "0" AND `m`.`name` LIKE "%'.mysql_real_escape_string(str_replace('"','"',$name)).'%" AND `i`.`uid` = "'.mysql_real_escape_string($this->info['id']).'"'); - } - while($pl = mysql_fetch_array($sp)) { - $vibor .= '
'; - if(!isset($id['id'])) { - //if($pl['type']!=4 && $pl['type']!=2 && $pl['type']!=7 ) { - $dt = $this->lookStats($pl['data']); - $id = array(); - $id = $pl; - $id_type = $pl['type']; - //} - } - if( $vi != -1 ) { - $vi++; - $vid .= '`iu`.`id` = "'.$pl[0].'" OR'; - } - } - } - - if( $vi > 0 ) { - $itm_inv = $this->genInv(80,' '.rtrim($vid,'OR').' '); - echo ' "'.$rune['name'].'":

+

@@ -2394,16 +2247,16 @@ function user_browser($agent) { 1 && $inf['align']<2) { ?> /' target='_blank'>
- /' target='_blank'> + /' target='_blank'>Орден Света =3.01 && $inf['align']<=3.99) { ?> /'>
- /' target='_blank'> + /' target='_blank'>Армада =2 && $inf['align']<3) { ?> /'>
- /' target='_blank'> + /' target='_blank'>Цитадель Хаоса
-
+ Новости
'.$is1.''.$is2.'
'.$is1.''.$kolvoprint.$is2.'
'.$is1.' '.$crd.''.$is2.'
'.$itm_inv[2].'
'; - die(); - }else{ - unset($rune); - } - - if($id['id'] > 0) { - - if($ruid < 1 && isset($_GET['use_rune'])) { - $ruid = $_GET['use_rune']; - } - - $idtrue = false; - - $rune = mysql_fetch_array(mysql_query('SELECT - `i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl` - ,`m`.`name`,`m`.`type`,`m`.`level` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE `i`.`id` = "'.mysql_real_escape_string($ruid).'" AND `i`.`uid` = "'.$this->info['id'].'" AND `i`.`delete` = "0" AND `i`.`inShop` = "0" LIMIT 1')); - if($rune['level'] > $this->info['level'] && $rune['type']==31) { - $this->error = ' '; - }elseif($rune['type']==31 ) { - // - if( $idt['type'] == 7 ){ $idt['type'] = 6; } - if( $idt['type'] == 5 ){ $idt['type'] = 6; } - if( $idt['type'] == 4 ){ $idt['type'] = 6; } - $data = $this->lookStats($id['data']); - $type_rune = array( - '' => 9, // - '' => 10, // - '' => 11, // - '' => 12, // - '' => 14, // - '' => 15, // - '' => 1, // - '' => 3, // - '' => 6, // - '' => 8 // - ); - if( $rune['type'] == 5 ) { - $type_rune[''] = 5; - } - // - //$idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT` 1')); - //if( $idt['type'] == 5 ){ $idt['type'] = 6; } - //$id['type'] = $idt['type']; - // - $type_rune = $type_rune[substr($rune['name'], -2, 2)]; - if( $type_rune != $id['type'] && $type_rune != '' ) { - $type_rune2 = array( - '' => '', // - '' => '', // - '' => '', // - '' => '', // - '' => '', // - '' => '', // - '' => '', // - '' => '', // - '' => '', // - '' => '' // - ); - $this->error = ' '.$type_rune2[substr($rune['name'], -2, 2)].' ( : '.$id['type'].'. : '.$type_rune.')'; - }elseif(isset($data['nomodif'])) { - $this->error = ' '; - }elseif(isset($data['art']) && $data['tr_lvl'] < 0) { - $this->error = ' 10- '; - }else{ - if(isset($data['rune']) && $data['rune'] > 0) { - $ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$data['rune_id'].'" LIMIT 1')); - $j = 0; - $data_r = $this->lookStats($ritm['data']); - while($j < count($this->items['add'])) { - if(isset($data_r['add_'.$this->items['add'][$j]])) { - $data['add_'.$this->items['add'][$j]] -= $data_r['add_'.$this->items['add'][$j]]; - } - $j++; - } - } - $data['rune'] = $rune['id']; - $data['rune_id'] = $rune['item_id']; - $data['rune_name'] = $rune['name']; - $data['rune_lvl'] = $rune['level']; - // - $add = $this->lookStats($rune['data']); - $i = 0; - while($iitems['add'])) { - if(isset($add['add_'.$this->items['add'][$i]])) { - $data['add_'.$this->items['add'][$i]] += $add['add_'.$this->items['add'][$i]]; - } - $i++; - } - //if( $rune['level'] > $data['tr_lvl'] ) { - // $data['tr_lvl'] = $rune['level']; - //} - $data = $this->impStats($data); - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `items_users` SET `data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - - - - - - $this->error = ' '; - } - }else{ - $rune = mysql_fetch_array(mysql_query('SELECT - `i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl` - ,`m`.`name`,`m`.`level`,`m`.`type` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE `i`.`id` = "'.mysql_real_escape_string($ruid).'" AND `i`.`uid` = "'.$this->info['id'].'" AND `i`.`delete` = "0" AND `i`.`inShop` = "0" LIMIT 1')); - if(!isset($rune['id'])) { - $this->error = ' '; - }elseif($rune['type']==62) { - - $idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT` 1')); - if( $idt['type'] == 7 ){ $idt['type'] = 6; } - if( $idt['type'] == 5 ){ $idt['type'] = 6; } - if( $idt['type'] == 4 ){ $idt['type'] = 6; } - //$id['type'] = $idt['type']; - // - $data = $this->lookStats($id['data']); - $add = $this->lookStats($rune['data']); - if(isset($data['nomodif'])) { - $this->error = ' '; - }elseif(isset($data['art']) && $data['tr_lvl'] < 0) { - $this->error = ' 10- '; - }elseif(isset($add['onimposed'])) { - // - // - $i = 0; $j = 0; - $utp = explode(',',$add['onItemType']); - while($i 0 ) { - - unset($data['imposed'],$data['imposed_name'],$data['bm_a1']); - - $imposed = array( - 'imposed' => 1, - 'imposed_name' => $add['onSpellName'], - 'bm_a1' => $add['onSpellFile'] - ); - - if(!isset($add['onSpellFile'])) { - unset($imposed['bm_a1']); - // - if(isset($add['onSpell_mpAll'])) { - $imposed['addspell_mpAll'] = $add['onSpell_mpAll']; - $imposed['add_mpAll'] = $data['add_mpAll'] + $add['onSpell_mpAll'] - $data['addspell_mpAll']; - } - // - } - - $imposed['sudba'] = 1; - - $data = array_merge($data, $imposed); - $data = $this->impStats($data); - - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `items_users` SET `data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - $this->error = ' "'.$add['onSpellName'].'" "'.$id['name'].'"'; - }else{ - $this->error = ' "'.$id['name'].'" .,.'; - } - }else{ - if(isset($data['spell']) && $data['spell'] > 0) { - // - $litm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$id['item_id'].'" LIMIT 1')); - - $data_l = $this->lookStats($litm['data']); - $pvr = array( - 'i' => 0, - 'spell' => array(), - 'rune' => array(), - 'atack' => array(), - 'podgon'=> array() - ); - - if( isset($data['podgon']) ) { - if($data['tr_lvl'] > $id['level']) { - $id['level'] = $data['tr_lvl']; - } - $pvr['podgon']['hpAll'] = 6*$id['level']+6; - } - if( isset($data['addspell_hpAll']) ) { - $pvr['podgon']['hpAll'] += $data['addspell_hpAll']; - } - if( isset($data['rune_id']) && $data['rune_id'] > 0 ) { - $ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$data['rune_id'].'" LIMIT 1')); - $j = 0; - $data_r = $this->lookStats($ritm['data']); - while($j < count($this->items['add'])) { - if(isset($data_r['add_'.$this->items['add'][$j]])) { - $pvr['rune'][$this->items['add'][$j]] = $data_r['add_'.$this->items['add'][$j]]; - } - $j++; - } - } - - if(isset($data['spell_st_val_hp'])) { - $data['add_hpAll'] -= $data['spell_st_val_hp']; - } - - //$i = 0; - //while( $i < count($data)) { - if( !isset($data['spell_st_name']) ) { - $delk = count($this->items['add']); - $this->items['add'][] = 'mib1'; - $this->items['add'][] = 'mib2'; - $this->items['add'][] = 'mib3'; - $this->items['add'][] = 'mib4'; - $this->items['add'][] = 'mab1'; - $this->items['add'][] = 'mab2'; - $this->items['add'][] = 'mab3'; - $this->items['add'][] = 'mab4'; - $j = 0; - while($j < count($this->items['add'])) { - if(isset($data['add_'.$this->items['add'][$j]])) { - if( $data_l['add_'.$this->items['add'][$j]] != $data['add_'.$this->items['add'][$j]] - $pvr['rune'][$this->items['add'][$j]] - $pvr['podgon'][$this->items['add'][$j]] ) { - //echo ''.$this->items['add'][$j].' -> '.$data_l['add_'.$this->items['add'][$j]].' / '.$data['add_'.$this->items['add'][$j]].'
'; - if(!isset($data_l['add_'.$this->items['add'][$j]])) { - unset($data['add_'.$this->items['add'][$j]]); - }else{ - $data['add_'.$this->items['add'][$j]] = $data_l['add_'.$this->items['add'][$j]]; - } - } - } - $j++; - } - $i = 0; - while( $i < 8 ) { - unset($this->items['add'][$delk+$i]); - $i++; - } - //$i++; - //} - } - } - // - $i = 0; - $utp = explode(',',$add['onItemType']); - while($iitems['add'])) { - if(isset($add[$tw.'add'.$utp[$i].'_'.$this->items['add'][$j]])) { - $rnda[count($rnda)] = $this->items['add'][$j]; - } - $j++; - } - - if( isset($add['imposed']) && $add['imposed'] != '' ) { - $imposed = array( - 'imposed'=>'1', // - 'imposed_id'=>$rune['id'], // ID - 'imposed_name'=>$rune['name'], // , - 'imposed_level'=>$rune['level'], // . : 0; - 'bm_a1'=>$add['imposed'], // . - 'sudba'=>$this->info['login'] // . : 0; - ); - if( isset($add['imposed_name']) ) $imposed['imposed_name']=$add['imposed_name']; - if( isset($add['imposed_level']) ) $imposed['imposed_level']=$add['imposed_level']; - $rnda[0] = 1; - } - if( count($rnda) >= 0 ) { - $rnda = $rnda[rand(0,count($rnda)-1)]; - if( $rnda == 'mib1' || $rnda == 'mib2' || $rnda == 'mib3' || $rnda == 'mib4' ) { - $rnda = str_replace('mib','mab',$rnda); - } - - if( !isset($this->is[$rnda]) && isset($imposed) ){ - $data = array_merge($data, $imposed); - $data = $this->impStats($data); - - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `items_users` SET `data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - $this->error = ' "'.$imposed['imposed_name'].'" "'.$id['name'].'"'; - - } elseif( !isset($this->is[$rnda]) - && $rnda != 'mib1' && $rnda != 'mib2' && $rnda != 'mib3' && $rnda != 'mib4' - && $rnda != 'mab1' && $rnda != 'mab2' && $rnda != 'mab3' && $rnda != 'mab4' - ) { - $this->error = ' . ( '.$rnda.' )'; - } else { - $data['add_'.$rnda] += $add[$tw.'add'.$utp[$i].'_'.$rnda]; - if( $rnda == 'mab1' || $rnda == 'mab2' || $rnda == 'mab3' || $rnda == 'mab4' ) { - $data['add_'.str_replace('mab','mib',$rnda)] += $add[$tw.'add'.$utp[$i].'_'.$rnda]; - } - /*$jkh = 1; - while( $jkh <= 4 ) { - if($rnda == 'mib'.$jkh) { - $data['add_mab'.$jkh] += $add['add'.$utp[$i].'_'.$rnda]; - }elseif($rnda == 'mab'.$jkh) { - $data['add_mib'.$jkh] += $add['add'.$utp[$i].'_'.$rnda]; - } - $jkh++; - }*/ - - $data['spell'] = $rune['id']; - if( !isset($data['sudba']) ) { - $data['sudba'] = '0'; - } - - if( isset($data['spell_st_name']) ) { - $data['add_' . $data['spell_st_name']] -= $data['spell_st_val']; - if( $data['spell_st_name'] == 'mab1' || $data['spell_st_name'] == 'mab2' || $data['spell_st_name'] == 'mab3' || $data['spell_st_name'] == 'mab4' ) { - $data['add_'.str_replace('mab','mib',$data['spell_st_name'])] -= $data['spell_st_val']; - } - /*$jkh = 1; - while( $jkh <= 4 ) { - if( $data['spell_st_name'] == 'mib'.$jkh ) { - $data['add_' . str_replace('mib','mab',$data['spell_st_name'])] -= $data['spell_st_val']; - }elseif( $data['spell_st_name'] == 'mab'.$jkh ) { - $data['add_' . str_replace('mab','mib',$data['spell_st_name'])] -= $data['spell_st_val']; - } - $jkh++; - }*/ - if( $data['add_' . $data['spell_st_name']] == 0 ) { - unset($data['add_' . $data['spell_st_name']]); - } - //die(' : '.$data['spell_st_name'].' +'.$data['spell_st_val'].'
...'); - } - - $data['spell_id'] = $rune['item_id']; - $data['spell_name'] = $rune['name']; - $data['spell_lvl'] = $rune['level']; - $data['spell_st_name'] = $rnda; - $data['spell_st_val'] = $add[$tw.'add'.$utp[$i].'_'.$rnda]; - if(isset($add['addspell_hpAll'])) { - $data['spell_st_val_hp'] = $add['addspell_hpAll']; - $data['add_hpAll'] += $add['addspell_hpAll']; - }else{ - unset($data['spell_st_val_hp']); - } - $data = $this->impStats($data); - - $this->is['mab1'] = ' '; - $this->is['mab2'] = ' '; - $this->is['mab3'] = ' '; - $this->is['mab4'] = ' '; - $this->error = ' "'.$id['name'].'", '.$this->is[$rnda].': +'.$add[$tw.'add'.$utp[$i].'_'.$rnda]; - - //$this->error = '


"'.$id['name'].'", '.$this->is[$rnda].': +'.$add['add'.$utp[$i].'_'.$rnda]."

$:".$idt['2h']."<"; - - unset($this->is['mab1'],$this->is['mab2'],$this->is['mab3'],$this->is['mab4']); - - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `items_users` SET `data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - } - }else{ - $this->error = '- , '; - } - $i = 100499; - } - $i++; - } - if($i < 100500) { - $this->error = ' ...'; - } - } - - } elseif($rune['type']==47) { - $add = $this->lookStats($id['data']); - $data = $this->lookStats($rune['data']); - if($add['art'] ==1) { - if($id['iznosNOW'] > 0) { - $id['iznosNOW'] -= $data['repairLevel']; - if($id['iznosNOW'] < 0) { $id['iznosNOW'] = 0; } - mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$id['iznosNOW'].'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - $this->error = ' '.$id['name'].' .'; - } else { - $this->error = ' ...'; - } - } else { - $this->error = ' ...'; - } - } elseif($rune['type']==46) { - $idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT` 1')); - if( $idt['type'] == 5 ){ $idt['type'] = 6; } - $id['type'] = $idt['type']; - if($id_type < 18 || $id_type > 24) { - $add = $this->lookStats($rune['data']); - if( isset($add['uptimeitem']) ) { - $data = $this->lookStats($id['data']); - if( $data['srok'] > 0 || $id['srok'] > 0 ) { - if( !isset($data['srok']) ) { - $data['srok'] = $id['srok']; - } - if( $data['srok'] + $id['time_create'] - time() > 86400 + 30 ) { - $this->error = ' 30 .'; - }elseif( $id['inslot'] > 0 && $id['inslot'] < 20 ) { - $this->error = ' "'.$id['name'].'" '.$this->timeOut($add['uptimeitem']).'.'; - - if( isset($data['sleep_moroz']) ) { - unset($data['sleep_moroz']); - } - - $data = $this->impStats($data); - - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `items_users` SET `data` = "'.$data.'",`time_create` = `time_create` + '.floor($add['uptimeitem']).' WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - - }else{ - $this->error = ' ...'; - } - }else{ - $this->error = ' ...'; - } - }else{ - $this->error = ' ...'; - } - }else{ - // - $data = $this->lookStats($id['data']); - $add = $this->lookStats($rune['data']); - if(isset($data['upatack_id'])) { - $this->error = ' , .'; - }elseif(isset($data['nomodif'])) { - $this->error = ' '; - }elseif($add['uptype'] != $id_type || $add['uptype'] == 0) { - $this->error = ' ...'; - }else{ - - if(isset($data['upatack_id']) && $data['upatack_id'] > 0) { - $ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$data['upatack_id'].'" LIMIT 1')); - $data_r = $this->lookStats($ritm['data']); - if( $id_type == 22 ) { - $data['add_m11'] -= $data_r['upatack']*2; - }elseif( $id['2h'] == 1 ) { - $data['sv_yron_min'] -= $data_r['upatack']*2; - $data['sv_yron_max'] -= $data_r['upatack']*2; - }else{ - $data['sv_yron_min'] -= $data_r['upatack']; - $data['sv_yron_max'] -= $data_r['upatack']; - } - } - $data['upatack'] = $rune['id']; - $data['upatack_id'] = $rune['item_id']; - $data['upatack_name'] = $rune['name']; - $data['upatack_lvl'] = $add['upatack']; - $data['upatack_lvl'] = $add['upatack']; - if(!isset($data['base_price1'])) { - //$data['base_price1'] = $id['1price']; - //$data['base_price2'] = $id['2price']; - } - - // - $i = 0; - while($iitems['add'])) { - if(isset($add['add_'.$this->items['add'][$i]])) { - $data['add_'.$this->items['add'][$i]] += $add['add_'.$this->items['add'][$i]]; - } - $i++; - } - - if( $id_type == 22 ) { - $data['add_m11'] += $add['upatack']*2; - //print_r($data); - //die(' .'); - }elseif( $id['2h'] == 1 ) { - $data['sv_yron_min'] += $add['upatack']*2; - $data['sv_yron_max'] += $add['upatack']*2; - }else{ - $data['sv_yron_min'] += $add['upatack']; - $data['sv_yron_max'] += $add['upatack']; - } - - if( !isset($add['nosale']) && !isset($add['frompisher']) ) { - //$id['1price'] = $data['base_price1']+$rune['1price']; - //$id['2price'] = $data['base_price2']+$rune['2price']; - } - - $this->addDelo(2,$this->info['id'],'"System.remont.upatack": "'.$data['upatack_name'].'" "'.$id['name'].'" [itm:'.$id['id'].']',time(),$this->info['city'],'System.remont.upatack',0,0); - - - $data = $this->impStats($data); - - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `items_users` SET `1price` = "'.$id['1price'].'",`2price` = "'.$id['2price'].'",`data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - $this->error = ' "'.$id['name'].'" '; - } - } - }elseif($rune['type']==68) { - $idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT` 1')); - if( $idt['type'] == 5 ){ $idt['type'] = 6; } - $id['type'] = $idt['type']; - - // - $data = $this->lookStats($id['data']); - $add = $this->lookStats($rune['data']); - if(isset($data['nomodif'])) { - $this->error = ' '; - }elseif(!isset($data['close']) && $data['close'] != 0) { - $this->error = ' , ...'; - }else{ - $data['unopen'] = $rune['id']; - $data['unopen_id'] = $rune['item_id']; - $data['unopen_name'] = $rune['name']; - - unset($data['close']); - - $data['open'] = 1; - - $data = $this->impStats($data); - - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - mysql_query('UPDATE `items_users` SET `data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - $this->error = ' "'.$id['name'].'" '; - } - - }elseif($rune['type']==37) { - $idt = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT 1')); - if($idt['type'] != 37) { - // - $data = $this->lookStats($id['data']); - $add = $this->lookStats($rune['data']); - // - if($id['gift'] == '' || $id['gift'] == '0') { - if(isset($data['notransfer'])) { - $this->error = ' ...'; - }elseif(isset($data['sudba']) && $data['sudba'] != 0) { - $this->error = ' ...'; - }else{ - if(isset($add['item_inbox']) && $add['item_inbox'] > 0) { - $this->error = ' - , !'; - }elseif($id['inTransfer'] > 0 || $id['inShop'] > 0 || $id['inGroup'] > 0) { - $this->error = ' , , ...'; - }else{ - // - $add['item_inbox'] = $id['id']; - $add['open'] = 1; - $add['nosale'] = 1; - $add = $this->impStats($add); - // - mysql_query('UPDATE `items_users` SET `inGroup` = 0,`data` = "'.$add.'" WHERE `id` = "'.$rune['id'].'" LIMIT 1'); - mysql_query('UPDATE `items_users` SET `uid` = -1 WHERE `id` = "'.$id['id'].'" LIMIT 1'); - // - $this->error = ' "'.$idt['name'].'" .'; - // - } - } - }else{ - $this->error = ' ...'; - } - // - }else{ - $this->error = ' ...'; - } - }else{ - $this->error = '('.$rune['type'].') ...'; - } - } - }else{ - $this->error = ' ...'; - } - } - - public function floordec($zahl,$decimals=2){ - return floor($zahl*pow(10,$decimals))/pow(10,$decimals); - } - - public function testBattle( $id ) { - $r = true; - if( $id == 0 ) { - $r = false; - }else{ - $btla = mysql_fetch_array(mysql_query('SELECT `id`,`team_win` FROM `battle` WHERE `id` = "'.mysql_real_escape_string($id).'" LIMIT 1')); - if( isset($btla['id']) ) { - if( $btla['team_win'] > -1 ) { - $r = false; - } - } - } - return $r; - } - - public function testVipItems($slot_new) { - $sp = mysql_query('SELECT `i`.`id`,`m`.`type`,`i`.`2price`,`m`.`price2` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `i`.`item_id` WHERE `i`.`uid` = "'.$this->info['id'].'" AND `i`.`delete` = "0" AND `i`.`data` LIKE "%vip_sale%" LIMIT 20'); - $itm = array(); - $slot = array(); - $j = 0; - if( $slot_new > 0 ) { - $itm[$j] = array('new'); - $slot[$slot_new][] = $j; - $j++; - } - $r = true; - while( $pl = mysql_fetch_array($sp)) { - $itm[$j] = $pl; - $slot[$pl['type']][] = $j; - $j++; - } - $l = count($slot[18])+count($slot[19])+count($slot[20])+count($slot[21])+count($slot[22])+count($slot[23])+count($slot[24])+count($slot[25])+count($slot[26])+count($slot[27])+count($slot[28]); - $v = count($slot[9])+count($slot[10])+count($slot[11]); - $a = count($itm)-$l-$v; - if( $this->stats['silver'] == 2 ) { - // 3 (1 ) - if( $j > 3 || $l > 1 || $v > 0 ) { - $r = false; - } - }elseif( $this->stats['silver'] == 3 ) { - // 6 (1 , 1 4 ) - if( $j > 6 || $l > 1 || $v > 1 ) { - $r = false; - } - }elseif( $this->stats['silver'] == 4 ) { - // 9 (2 , 2 5 ) - if( $j > 9 || $l > 2 || $v > 2 ) { - $r = false; - } - }elseif( $this->stats['silver'] == 5 ) { - // - } - return $r; - } - - public function berezCena() { - global $c; - $r = 0; - if( $this->stats['silver'] > 0 ) { - $r = 50+(($this->stats['silver']-1)*5); - $r = $r/100; - } - $r = $c['shop_type2']; - //$r = 1; // 100% - $r = round(($r/100),2); - return $r; - } - - public function genInv($type, $sort){ - global $c,$code; - - $i = 0; // , . - $j = 0; // while ++ - $k = 1; // 0 1 - $rt = array( 0=>0, 1=>0, 2=>'' ); // ? - $clr = array( 0=>'c8c8c8', 1=>'d4d4d4' ); // - $sort = explode('ORDER BY', $sort); - if( isset($sort[0],$sort[1])){ - $where= $sort[0]; - if($sort[1] !='' )$sort = $sort[1].''; else $sort =''; - } else { - $where = $sort[0]; $sort = ' `lastUPD` DESC'; - } - $cl = mysql_query('SELECT count(`iu`.item_id) as inGroupCount, `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`so`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE '.$where.' GROUP BY `im`.id,`iu`.item_id, `iu`.inGroup HAVING `iu`.inGroup > 0 UNION ALL SELECT count(`iu`.item_id) as inGroupCount, `im`.`id`,`im`.`name`,`im`.`img`, `im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`, `im`.`iznosMAXi`,`im`.`inRazdel`, `im`.`price1`,`im`.`price2`, `im`.`pricerep`,`im`.`magic_chance`, `im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`, `im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`, `im`.`ts`,`im`.`srok`,`im`.`class`, `im`.`class_point`,`im`.`anti_class`, `im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`, `im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`so`,`iu`.`id`,`iu`.`item_id`, `iu`.`1price`,`iu`.`2price`,`iu`.`uid`, `iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`, `iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`, `iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`, `iu`.`magic_inc`, `iu`.`maidin`,`iu`.`lastUPD`, `iu`.`timeOver`, `iu`.`overType`, `iu`.`secret_id`, `iu`.`time_create`, `iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`, `iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.inGroup=0 AND '.$where.' GROUP BY `iu`.id, `iu`.item_id ORDER BY '.$sort.' -'); - - if($type == 15) { - $anm = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `id` = "'.$this->info['animal'].'" AND `pet_in_cage` = 0 AND `delete` = "0" LIMIT 1')); - } - while($pl = mysql_fetch_array($cl)) { - if($type==30){ - $ChSudba = $this->lookStats($pl['data']); - if(isset($ChSudba['sudba']) || $ChSudba['sudba'] != 0 || $ChSudba['nosale']==1) - continue; - } - if($pl['1price']>0) { - $pl['price1'] = $pl['1price']; - } - $is1 = ''; - $is2 = ''; - $d = array(); - // - $d[0] = 0; - $d[1] = 1; - $d[2] = 0; - $po = $this->lookStats($pl['data']); - - $see1 = 1; - if($type == 15) { // - if($anm['type'] == 3 && substr_count($pl['img'],'wisp') == 0) { - $see1 = 0; // - }elseif($anm['type'] == 2 && substr_count($pl['img'],'owl') == 0) { - $see1 = 0; // - }elseif($anm['type'] == 1 && substr_count($pl['img'],'cat') == 0) { - $see1 = 0; // - }elseif($anm['type'] == 4 && substr_count($pl['img'],'chrt') == 0) { - $see1 = 0; // - }elseif($anm['type'] == 5 && substr_count($pl['img'],'dog') == 0) { - $see1 = 0; // - }elseif($anm['type'] == 6 && substr_count($pl['img'],'pig') == 0) { - $see1 = 0; // - }elseif($anm['type'] == 7 && substr_count($pl['img'],'dragon') == 0) { - $see1 = 0; // - } - }elseif(isset($po['nosale']) && $type==2){ - $see1 = 0; - - }elseif(isset($po['noremont']) && $type==4){ - $see1 = 0; - }elseif($type==5 && $pl['gift']!=''){ - $see1 = 0; - }elseif(($type==9 || $type==10) && $pl['gift']==''){ - $see1 = 0; - }elseif($type==5 && isset($po['sudba']) && $po['sudba']!='0'){ - $see1 = 0; - }elseif($type==5 && $pl['inTransfer']>0){ - $see1 = 0; - }elseif($type==6 && !isset($po['fshop'])){ - $see1 = 0; - } elseif($type == 67 && isset($po['art'])) { - $see1 = 0; - }elseif($type == 67 && isset($po['sudba'])) { - $see1 = 0; - } elseif($type == 67 && $pl['gift']!='') { - $see1 = 0; - }elseif($type==11) { // ( ) - if($pl['inTransfer']>0 || ($po['sudba'] != '' && $po['sudba'] != 0 && $po['sudba'] != 1 && $po['sudba'] != $this->info['id']) ){ - $see1 = 0; - } - if($pl['type']!=1 && $pl['type']!=3 && $pl['type']!=9 && $pl['type']!=10 && $pl['type']!=11 && $pl['type']!=5 && $pl['type']!=6 && $pl['type']!=8 && $pl['type']!=12 && $pl['type']!=14 && $pl['type']!=15 && $pl['type']!=18 && $pl['type']!=19 && $pl['type']!=20 && $pl['type']!=21 && $pl['type']!=22 && $pl['type']!=13 && $pl['item_id']!=1035){ - $see1 = 0; - } - if($po['tr_lvl']<4 && $pl['item_id']!=1035){ - $see1 = 0; - } - }elseif($type==14) { // ( ) - if($pl['inTransfer'] > 0){ - $see1 = 0; - } - if($pl['type'] != 31){ - $see1 = 0; - } - }elseif($type==12){ - if($pl['inslot']!=3 && $pl['inslot']!=14 && $pl['type']!=31){ - $see1 = 0; - } - if(!isset($po['frompisher']) && $pl['type']!=31){ - $see1 = 0; - } - }elseif($type==56 && ($pl['inslot'] != 5 || isset($po['podgon']))){ - $see1 = 0; - }elseif(isset($po['musor']) && $po['musor']>0 && $pl['iznosNOW']>=$pl['iznosMAX']){ - $see1 = 0; - }elseif($type==57) { - // - if($pl['type'] < 18 || $pl['type'] > 28 || $pl['type'] == 25) { - $see1 = 0; - } - }elseif($type==58) { - // - if(!isset($po['rune_id'])) { - $see1 = 0; - } - }elseif($type == 65) { - if(isset($po['sudba']) && $po['sudba'] != '0') { - $see1 = 0; - } - if(isset($po['toclan'])) { - $po['toclan1'] = explode('#',$po['toclan']); - $po['toclan1'] = $po['toclan1'][0]; - if($po['toclan1'] != $this->info['clan']) { - $see1 = 0; - } - } - }elseif($type == 67) { - $po['toclan1'] = explode('#',$po['toclan']); - $po['toclan1'] = $po['toclan1'][0]; - if($po['toclan1'] > 0) { - $see1 = 0; - } - if($this->itemsX($pl['id']) > 1) { - #$see1 = 0; - } - if($po['frompisher'] > 0) { - $see1 = 0; - } - if($pl['gift'] > 0) { - $see1 = 0; - } - if($po['sudba'] > 0) { - $see1 = 0; - } - }elseif($type == 69) { - $po['toclan1'] = explode('#',$po['toclan']); - $po['toclan1'] = $po['toclan1'][0]; - if($po['toclan1'] > 0) { - $see1 = 0; - } - if($po['frompisher'] == 0) { - $see1 = 0; - } - if($pl['gift'] > 0) { - $see1 = 0; - } - } - - if($see1==1){ - if($k==1){ - $k = 0; - }else{ - $k = 1; - } - if(($pl['type']>=18 && $pl['type']<=24) || $pl['type']==26 || $pl['type']==27){ // + - if(!isset($po['zonb'])) { $po['zonb'] = 0; } - $po['zonb']++; - } - // - $mx = ''; - if(isset($po['upatack_lvl'])) { - $mx .= ' +'.$po['upatack_lvl']; - } - if(isset($po['modif'])) { - $mx .= ' ()'; - } - $col = $this->itemsX($pl['id']); - if($col>1 && $pl['inGroup']!=0 ){ - $pl['kolvo'] = $col; - $mx .= ' (x'.$col.')'; - } - if(isset($po['tr_align']) && !isset($po['tr_align_bs'])) { - $pl['name'] .= ''; - } elseif(isset($po['tr_align_bs'])) { - if($po['tr_align_bs'] == '1') { - $pl['name'] .= ''; - } elseif($po['tr_align_bs'] == '3') { - $pl['name'] .= ''; - } - } - if( isset($po['renameadd']) && $po['renameadd'] != '' ) { - $pl['name'] .= ' (: '.$po['renameadd'].')'; - } - if( isset($po['icos']) ) { - $pl['name'] = ''.$pl['name'].'  '.$po['icos'].' '; - } - $is2 = ''.$pl['name'].''.$mx.''; - $is2 .= '  '; - if($pl['massa']>0){ - $is2 .= ' (: '.($pl['massa']*$col).')'; - } - if($pl['gift']!=''){ - $ttl = ''; - if($pl['gift']==1){ - $ttl = ' -'; - }else{ - $ttl = ' '.$pl['gift'].'. - '; - } - $is2 .= ' '; - } - - if(isset($po['art'])){ - $is2 .= ' '; - } - - if(isset($po['sudba'])){ - if($po['sudba']=='0'){ - $is2 .= ' '; - }elseif($po['sudba']=='1'){ - $is2 .= ' '; - }else{ - $is2 .= ' '; - } - } - if($pl['price1']>0){ // - $pex = explode('.',$pl['price1']); - if($pex[1]=='00'){ - $pl['price1'] = $pex[0]; - } - if($_GET['toRent']==2){ - $is2 .= '
: '.($pl['price1']).' .'; - } else{ - $is2 .= '
: '.($pl['price1']*$col).' .'; - } - } - if($pl['pricerep']>0){ - $is2 .= ' ('.round($pl['pricerep']*$col,2).' )'; - } - if($pl['iznosMAX']>0){ // - $izcol = ''; - if(floor($pl['iznosNOW'])>=(floor($pl['iznosMAX'])-ceil($pl['iznosMAX'])/100*20)){ - $izcol = 'brown'; - } - if($pl['iznosMAXi'] == 999999999) { - $is2 .= '
: '; - }else{ - $is2 .= '
: '.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']).''; - } - } - if( $po['battleUseZd'] > 0 ) { - $is2 .= '
: '.$this->timeOut($po['battleUseZd']).''; - } - if(isset($po['srok']) && $po['srok'] > 0){ - $pl['srok'] = $po['srok']; - } - if($pl['srok'] > 0){ // - $is2 .= '
: '.$this->timeOut($pl['srok']).' ( '.date('d.m.Y H:i',$pl['time_create']+$pl['srok']).')'; - } - if($pl['magic_chance'] > 0) { - $is2 .= '
: '.min(array($pl['magic_chance'],100)).'%'; - } - if((int)$pl['magic_inci'] > 0){ // : - $efi = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`type1`,`img`,`mdata`,`actionTime`,`type2`,`type3`,`onlyOne`,`oneType`,`noAce`,`see`,`info`,`overch`,`bp`,`noch` FROM `eff_main` WHERE `id2` = "'.((int)$pl['magic_inci']).'" LIMIT 1')); - if(isset($efi['id2']) && $efi['actionTime']>0){ - $is2 .= '
: '.$this->timeOut($efi['actionTime']); - } - } - - $notr = 0; - if(isset($po['sudba']) && $po['sudba']!='0' && $po['sudba']!=$this->info['login']){ - $notr++; - } - // : - $tr = ''; $t = $this->items['tr']; - $x = 0; - while($x < count($t)){ - $n = $t[$x]; - if(isset($po['tr_'.$n]) && $po['tr_'.$n] != 0) { - if( $n == 'sex' ) { - if( $this->info['sex'] != $po['tr_'.$n] ) { - $tr .= ''; $notr++; - } - }elseif($po['tr_'.$n] > $this->stats[$n]) { - if($n == 'align_bs' && $this->info['inTurnir'] > 0) { - if($po['tr_align_bs'] == '1') { - if($this->info['align_real'] <= 1 || $this->info['align_real'] >= 2) { $pal = false; } else { $pal = true; } - } elseif($po['tr_align_bs'] == '3') { - if($this->info['align_real'] <= 3 || $this->info['align_real'] >= 4) { $tar = false; } else { $tar = true; } - } - } - if($n == 'rep') { - $temp = explode('::', $po['tr_'.$n]); - if($this->rep['rep'.$temp[1]] < $temp[0]) { $tr .= ''; $notr++; } - unset($temp); - }elseif($n == 'align_bs' && $this->info['inTurnir'] > 0 && ($pal = false || $tar = false)) { - $tr .= ''; $notr++; - } elseif($n != 'align' && $n != 'align_bs' || floor($this->info['align']) != $po['tr_'.$n]) { - $tr .= ''; $notr++; - } - } - $tr .= '
'; - if($n == 'rep') { - $temp = explode('::',$po['tr_'.$n]); - $tr .= $this->is[$n].' '.ucfirst(str_replace('city',' city',$temp[1])).': '.$temp[0]; - unset($temp); - } elseif($n != 'align' && $n != 'align_bs') { - if( $n == 'sex' ) { - if( $po['tr_'.$n] == 1 ) { - $tr .= $this->is[$n].': '; - }else{ - $tr .= $this->is[$n].': '; - } - }else{ - $tr .= $this->is[$n].': '.$po['tr_'.$n]; - } - } else { - $tr .= $this->is[$n].': '.$this->align_nm[$po['tr_'.$n]]; - } - if( $n == 'sex' ) { - if( $this->info['sex'] != $po['tr_'.$n] ) { - $tr .= '
'; - } - }elseif($po['tr_'.$n] > $this->stats[$n]) { - if($n == 'align_bs' && $this->info['inTurnir'] > 0 && ($pal = false || $tar = false)) { - $tr .= '
'; - } elseif($n != 'align' && $n != 'align_bs' || floor($this->info['align']) != $po['tr_'.$n]) { - $tr .= '
'; - } - } - } - $x++; - } - if($tr!=''){ - $is2 .= '
:'.$tr; - } - // : - $tr = ''; $t = $this->items['add']; - if(isset($po['mf_stats']) && $po['mf_stats'] > 0) { - $tr .= '
: '.$po['mf_stats']; - } - if(isset($po['mf_mod']) && $po['mf_mod'] > 0) { - $tr .= '
: '.$po['mf_mod']; - } - if(isset($po['mf_mib']) && $po['mf_mib'] > 0) { - $tr .= '
: '.$po['mf_mib']; - } - - $x = 0; - while($xis[$n])){ - $z = '+'; - if($po['add_'.$n]<0){ - $z = ''; - } - $tr .= '
'.$this->is[$n].': '.$z.''.$po['add_'.$n]; - if(isset($po['mf_stats']) && $po['mf_stats'] > 0) { - if($n == 's1' || $n == 's2' || $n == 's3' || $n == 's5') { - $tr .= ' '; - } - } - if(isset($po['mf_mod']) && $po['mf_mod'] > 0) { - if($n == 'm1' || $n == 'm2' || $n == 'm4' || $n == 'm5') { - $tr .= ' '; - } - } - } - $x++; - } - // () - $i = 1; $bn = array(1=>'',2=>'',3=>'',4=>''); - while($i<=4){ - if(isset($po['add_mab'.$i])){ - if($po['add_mab'.$i]==$po['add_mib'.$i] && $pl['geniration']==1){ - $z = '+'; - if($po['add_mab'.$i]<0){ - $z = ''; - } - $tr .= '
'.$bn[$i].': '.$z.''.$po['add_mab'.$i]; - }else{ - $tr .= '
'.$bn[$i].': '.$po['add_mib'.$i].'-'.$po['add_mab'.$i]; - } - if(isset($po['mf_mib']) && $po['mf_mib'] > 0) { - $tr .= ' '; - } - } - $i++; - } - - if($tr!=''){ - $is2 .= '
:'.$tr; - } - // : - $tr = ''; $t = $this->items['sv']; - if(isset($po['sv_yron_min'],$po['sv_yron_max'])){ - $tr .= '
: '.$po['sv_yron_min'].' - '.$po['sv_yron_max']; - } - $x = 0; - while($xis[$n].': '.$z.''.$po['sv_'.$n]; - } - $x++; - } - if($pl['2too']==1){ - $tr .= '
'; - } - if($pl['2h']==1){ - $tr .= '
'; - } - if(isset($po['zonb'])){ - $tr .= '
: '; - if($po['zonb']>0){ - $x = 1; - while($x<=$po['zonb']){ - $tr .= '+'; - $x++; - } - }else{ - $tr .= ''; - } - } - if($tr!=''){ - $is2 .= '
:'.$tr; - } - - // - /*$tr = ''; - $x = 1; - while($x<=4){ - if(isset($po['tya'.$x]) && $po['tya'.$x]>0){ - $tyc = ' '; - if($po['tya'.$x]>6){ - $tyc = ''; - } - if($po['tya'.$x]>14){ - $tyc = ''; - } - if($po['tya'.$x]>34){ - $tyc = ''; - } - if($po['tya'.$x]>79){ - $tyc = ''; - } - if($po['tya'.$x]>89){ - $tyc = ''; - } - if($po['tya'.$x]>=100){ - $tyc = ''; - } - $tr .= '
'.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)'; - } - $x++; - } - $x = 1; - while($x<=7){ - if(isset($po['tym'.$x]) && $po['tym'.$x]>0){ - $tyc = ' '; - if($po['tym'.$x]>6){ - $tyc = ''; - } - if($po['tym'.$x]>14){ - $tyc = ''; - } - if($po['tym'.$x]>34){ - $tyc = ''; - } - if($po['tym'.$x]>79){ - $tyc = ''; - } - if($po['tym'.$x]>89){ - $tyc = ''; - } - if($po['tym'.$x]>=100){ - $tyc = ''; - } - $tr .= '
'.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)'; - } - $x++; - } - if($tr!=''){ - $is2 .= '
:'.$tr; - }*/ - if($notr==0){ - $d[0] = 1; - if($pl['magic_inci']!='' || $pl['magic_inc']!=''){ - $d[2] = 1; - } - } - - $tr = ''; - - if(floor($pl['iznosNOW'])>=ceil($pl['iznosMAX'])){ - $d[0] = 0; - $d[2] = 0; - } - // - $tr = ''; - // - if($pl['magic_inci']!='' || $pl['magic_inc']!='') { - if($pl['magic_inc'] == '') { - $pl['magic_inc'] = $pl['magic_inci']; - } - $mgi = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "'.$pl['magic_inc'].'" AND `type1` = "12345" LIMIT 1')); - if(isset($mgi['id2'])) { - $is2 .= '
'.$mgi['minfo'].'
'; - } - } - - if(isset($po['rune']) && $po['rune']>0) { - $rnc = explode(' ',$po['rune_name']); - if($rnc[0] == '') { - $rnc = '#9b5d40'; - }elseif($rnc[0] == '') { - $rnc = '#3a2b64'; - }elseif($rnc[0] == '') { - $rnc = '#20a3b0'; - }elseif($rnc[0] == '') { - $rnc = '#4c7718'; - }else{ - $rnc = '#4c4c4c'; - } - - $tr .= '
• : '.$po['rune_name'].''; - unset($rnc); - } - - if(isset($po['spell']) && $po['spell']>0) { - $rnc = explode(' ',$po['spell_name']); - if($rnc[2] == '[0]') { - $rnc = '#282828'; - }elseif($rnc[2] == '[1]') { - $rnc = '#624542'; - }elseif($rnc[2] == '[2]') { - $rnc = '#77090b'; - }elseif($rnc[2] == '[3]') { - $rnc = '#d99800'; - }else{ - $rnc = '#282828'; - } - $po['spell_name'] = str_replace(' ','',$po['spell_name']); - $this->is['mab1'] = ' '; - $this->is['mab2'] = ' '; - $this->is['mab3'] = ' '; - $this->is['mab4'] = ' '; - $tr .= '
• : '.$po['spell_name'].' ('.$this->is[$po['spell_st_name']].': +'.$po['spell_st_val'].')'; - unset($this->is['mab1'],$this->is['mab2'],$this->is['mab3'],$this->is['mab4']); - unset($rnc); - } - - if(isset($po['imposed']) && $po['imposed']>0) { - if($po['imposed_lvl'] == 0) { - $rnc = 'maroon'; - }elseif($po['imposed_lvl'] == 1) { - $rnc = '#624542'; - }elseif($po['imposed_lvl'] == 2) { - $rnc = '#77090b'; - }elseif($po['imposed_lvl'] == 3) { - $rnc = '#d99800'; - }else{ - $rnc = '#282828'; - } - $po['imposed_name'] = str_replace(' ','',$po['imposed_name']); - $tr .= '
: '.$po['imposed_name'].' '; - unset($rnc); - } - if($tr!='') { - $is2 .= '
:'; - $is2 .= $tr; - } - - /* - if($pl['lvl_itm']>0) { - $is2 .= '
: ['.$pl['blvl'].'/100]'; - } - - if($pl['so']>0) { - $is2 .= '
• :'; - - $is2 .= '
- -: '.(0+$po['add_s1']).' '.(10+25*$po['add_s1']).' -
: '.$po['add_s2'].' '.(10+25*$po['add_s2']).' -
: '.$po['add_s3'].' '.(10+25*$po['add_s3']).' -
: '.$po['add_s5'].' '.(10+25*$po['add_s5']).' - -
. . : '.$po['add_m1'].' '.(1+2*$po['add_m1']).' -
. . : '.$po['add_m2'].' '.(1+2*$po['add_m2']).' -
. : '.$po['add_m4'].' '.(1+2*$po['add_m4']).' -
. : '.$po['add_m5'].' '.(1+2*$po['add_m5']).' - -
: '.(0+$po['add_mib1']).'-'.(0+$po['add_mab1']).' '.(5+5*$po['add_mab1']).' -
: '.(0+$po['add_mib2']).'-'.(0+$po['add_mab2']).' '.(5+5*$po['add_mab2']).' -
: '.(0+$po['add_mib3']).'-'.(0+$po['add_mab3']).' '.(5+5*$po['add_mab3']).' -
: '.(0+$po['add_mib4']).'-'.(0+$po['add_mab4']).' '.(5+5*$po['add_mab4']).' - -
: '.$po['add_m10'].' '.(4+4*$po['add_m10']).' -
: '.$po['add_m11a'].' '.(5+5*$po['add_m11a']).' - -
: '.$po['add_za'].' '.(5+5*$po['add_za']).' -
: '.$po['add_zm'].' '.(4+4*$po['add_zm']).' - -
'; - - $is2 .= '• : '.$pl['so'].''; - } - */ - - if(isset($po['free_stats']) && $po['free_stats']>0){ - $is2 .= '
:'; - $is2 .= '
: '.$po['add_s1'].'
: '.$po['add_s2'].'
: '.$po['add_s3'].'
: '.$po['add_s5'].'
'; - $is2 .= '• : '.$po['free_stats'].''; - } - - if(isset($po['sm_abil'])) { - // - $mx2 = 1; $mx1 = 0; $mx3 = $this->lookStats($this->info['stats']); - while($mx2<=7){ - $mx1 += $mx3['s'.$mx2]-$po['add_s'.$mx2]; - $mx2++; - } - $mx1 += $this->info['ability']; - if($mx1>0) { - $is2 .= '
:'; - if(isset($po['sudba']) && $po['sudba']=='0') { - $mx1 = 0; - $is2 .= '
'; - }else{ - $is2 .= '
- : '.(0+$po['add_s1']).'
- : '.(0+$po['add_s2']).'
- : '.(0+$po['add_s3']).'
- : '.(0+$po['add_s4']).'
- : '.(0+$po['add_s5']).'
- : '.(0+$po['add_s6']).'
-
'; - $is2 .= ' : '.$mx1; - } - } - unset($mx1,$mx2,$mx3); - } - - if(isset($po['sm_skill'])){ - // - $mx2 = 1; $mx1 = 0; $mx3 = $this->lookStats($this->info['stats']); - while($mx2<=7){ - $mx1 += ($mx3['a'.$mx2]+$mx3['mg'.$mx2])-($po['add_a'.$mx2]+$po['add_mg'.$mx2]); - $mx2++; - } - $mx1 += $this->info['skills']; - if($mx1>0){ - $is2 .= '
:'; - if(isset($po['sudba']) && $po['sudba']=='0'){ - $mx1 = 0; - $is2 .= '
'; - }else{ - $is2 .= '
- : '.(0+$po['add_a1']).'
- , : '.(0+$po['add_a2']).'
- , : '.(0+$po['add_a3']).'
- , : '.(0+$po['add_a4']).'
- : '.(0+$po['add_a5']).'
- : '.(0+$po['add_mg1']).'
- : '.(0+$po['add_mg2']).'
- : '.(0+$po['add_mg3']).'
- : '.(0+$po['add_mg4']).'
- : '.(0+$po['add_mg5']).'
- : '.(0+$po['add_mg6']).'
- : '.(0+$po['add_mg7']).'
-
'; - $is2 .= ' : '.$mx1; - } - } - unset($mx1,$mx2,$mx3); - } - - if(isset($po['complect']) || isset($po['complect2'])){ - $is2 .= '
:'; - } - if(isset($po['complect'])){ - // - $com1 = array('name'=>' ','x'=>0,'text'=>''); - $spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.$po['complect'].'" ORDER BY `x` ASC LIMIT 20'); - while($plc = mysql_fetch_array($spc)){ - $com1['name'] = $plc['name']; - $com1['text'] .= '    • '.$plc['x'].': '; - // - $i1c = 0; $i2c = 0; - $i1e = $this->lookStats($plc['data']); - while($i1citems['add'])){ - if(isset($i1e[$this->items['add'][$i1c]])){ - $i3c = $i1e[$this->items['add'][$i1c]]; - if($i3c>0){ - $i3c = '+'.$i3c; - } - if($i2c>0){ - $com1['text'] .= '    '.$this->is[$this->items['add'][$i1c]].': '.$i3c; - }else{ - $com1['text'] .= $this->is[$this->items['add'][$i1c]].': '.$i3c; - } - $com1['text'] .= '
'; - $i2c++; - } - $i1c++; - } - unset($i1c,$i2c,$i3c); - $com1['x']++; - } - $is2 .= '
• : '.$com1['name'].'
'; - $is2 .= $com1['text']; - $is2 .= ''; - } - if(isset($po['complect2'])){ - // - $com1 = array('name'=>' ','x'=>0,'text'=>''); - $spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.$po['complect2'].'" ORDER BY `x` ASC LIMIT 20'); - while($plc = mysql_fetch_array($spc)){ - $com1['name'] = $plc['name']; - $com1['text'] .= '    • '.$plc['x'].': '; - // - $i1c = 0; $i2c = 0; - $i1e = $this->lookStats($plc['data']); - while($i1citems['add'])){ - if(isset($i1e[$this->items['add'][$i1c]])){ - $i3c = $i1e[$this->items['add'][$i1c]]; - if($i3c>0){ - $i3c = '+'.$i3c; - } - if($i2c>0){ - $com1['text'] .= '    '.$this->is[$this->items['add'][$i1c]].': '.$i3c; - }else{ - $com1['text'] .= $this->is[$this->items['add'][$i1c]].': '.$i3c; - } - $com1['text'] .= '
'; - $i2c++; - } - $i1c++; - } - unset($i1c,$i2c,$i3c); - $com1['x']++; - } - $is2 .= '
• (): '.$com1['name'].'
'; - $is2 .= $com1['text']; - $is2 .= ''; - } - - if($pl['max_text'] > 0) { - // - $sm_sp = mysql_query('SELECT `id`,`item_id`,`time`,`login`,`type`,`text`,`city`,`x` FROM `items_text` WHERE `item_id` = "'.$pl['id'].'" ORDER BY `id` ASC LIMIT 500'); - $sma = 0; $smt = ''; $ixi = 0; - while($sm_pl = mysql_fetch_array($sm_sp)) { - if($sm_pl['type']==0) { - $smt .= ''.date('d.m.Y H:i',$sm_pl['time']).' '.$sm_pl['login'].'. '.$sm_pl['text'].'
'; - }else{ - $smt .= $sm_pl['text'].'
'; - } - if($ixi == 2) { - $smt .= ''; - if($pl['max_text']-$pl['use_text'] > 0) { - $is2 .= '
: '.($pl['max_text']-$pl['use_text']).'
'; - } - if($sma > 0) { - $is2 .= '
:
- - - - - -
'.$smt.'
-
'; - } - unset($sm_sp,$sma,$sm_pl); - }elseif(isset($po['onitm_text'])) { - $is2 .= '
:
- - - - -
'.$po['onitm_text'].'
-
'; - } - - if(isset($po['gravi'])) { - $is2 .= '
: '.$po['gravi'].''; - } - - $is2 .= ''; - - if($pl['info']!=''){ - $is2 .= '
:
'.$pl['info'].'
'; - } - - if(isset($po['info']) && $po['info']!=''){ - $is2 .= '
'.$po['info'].'
'; - } - - if($pl['maidin']!=''){ - //$is2 .= '
'.$this->city_name[$pl['maidin']].'
'; - } - - if(isset($po['toclan'])) { - $po['toclan1'] = explode('#',$po['toclan']); - $clpo = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$po['toclan1'][0].'" LIMIT 1')); - if(isset($clpo['id'])) { - $is2 .= '
'.$clpo['name'].''; - $plpo = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`cityreg` FROM `users` WHERE `id` = "'.$po['toclan1'][1].'" LIMIT 1')); - if(isset($plpo['id'])) { - $is2 .= ' ( '.$plpo['login'].')'; - if( $plpo['login'] == $this->info['login'] ) { - if( isset($_GET['backmyitm']) ) { - $pl['inOdet'] = 0; - $pl['uid'] = $plpo['id']; - unset($po['toclan1'],$po['toclan']); - $pl['data'] = $this->impStats($po); - mysql_query('UPDATE `items_users` SET `data` = "'.mysql_real_escape_string($pl['data']).'",`inOdet` = 0,`uid` = "'.$pl['uid'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - $is2 .= '
( : )'; - } - } - $is2 .= '
'; - } - } - if(isset($po['noremont'])){ - $is2 .= '
'; - } - if(isset($po['nosale'])){ - $is2 .= '
'; - } - if(isset($po['nomodif'])){ - $is2 .= '
'; - } - if(isset($po['nodelete'])){ - $is2 .= '
'; - } - if(isset($po['frompisher'])){ - $is2 .= '
'; - } - if(isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0 ) { - $is2 .= '
'; - } - - if(isset($po['fromlaba']) && $po['fromlaba']>0){ - $is2 .= '
'; - } - - if(isset($po['vip_sale']) && $po['vip_sale']>0){ - if( $this->stats['slvtm'] > time() && $this->stats['silver'] > 1 ) { - if( $pl['time_create'] != $this->stats['slvtm'] ) { - $pl['time_create'] = $this->stats['slvtm']; - mysql_query('UPDATE `items_users` SET `time_create` = "'.$pl['time_create'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - $is2 .= '
'.$this->timeOut($pl['time_create']-time()).'
'; - //$is2 .= '
'.$this->timeOut($pl['time_create']-time()+86400*30).'
'; - }else{ - $is2 .= '
, VIP
'; - if( ($pl['time_create']-time()+86400*30) < 1 ) { - $is2 .= '
...
'; - }else{ - $is2 .= '
'.$this->timeOut($pl['time_create']-time()+86400*30).'
'; - } - } - } - - if($pl['dn_delete']>0){ - $is2 .= '
'; - } - - if( $this->pokol > $pl['geni'] ) { - $is2 .= '
'; - } - - if(isset($po['zazuby']) && $po['zazuby']>0){ - $is2 .= '
'; - } - - $is2 .= '
'; - - if($col > 1000) { - $is1 .= ' - - - - - - -
x'.$col.'
'; - - }else{ - $is1 .= ''; - } - - //$is1 .= '
(id'.$pl['id'].')
'; - - $is1 .= '
'; - - if($type == 81) { - $is1 .= ' '; - }elseif($type == 80) { - $is1 .= ' '; - }elseif($type == 69) { - if(!isset($po['hprs'])) { - $po['hprs'] = 0.001; - } - if(!isset($po['hprp'])) { - $po['hprp'] = 0.0001; - } - $prs1 = $this->floordec($po['hprs']*$col,2); - $rps1 = $this->floordec($po['hprp']*$col); - $is1 .= ' '.$prs1.' .
'.$rps1.' . '; - $is1 .= '
'; - }elseif($type == 68) { - $is1 .= '
'; - if($pl['lastUPD'] > 0) { - $is1 .= '

('.$this->timeOut(($pl['lastUPD']+7*24*60*60) - time()).')'; - } - $is1 .= '
'; - }elseif($type == 67) { - $is1 .= ' '.(round(1+$pl['price1']/100*7)*$col).' .'; - }elseif($type == 66) { - $pos = explode('#', $po['toclan']); - $us_1 = $pos[1]; - if($pl['uid'] < 1) { - $is1 .= ' '; - }else{ - $yui = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`cityreg` FROM `users` WHERE `id` = "'.mysql_real_escape_string($pl['uid']).'" LIMIT 1')); - $is1 .= '
'.$yui['login'].'
'; - if($this->info['tt'][14][0] == 1 || ($this->info['id'] == $us_1)) { - $is1 .= '
'; - } - } - }elseif($type == 65) { - if(!isset($po['toclan'])) { - $is1 .= ''; - }else{ - $is1 .= ''; - } - }elseif($type == 62) { - $upgitm = mysql_fetch_array(mysql_query('SELECT * FROM `items_upgrade` WHERE `iid` = "'.$pl['item_id'].'" LIMIT 1')); - if(!isset($upgitm['id'])) { - $is1 .= ' '; - }else{ - $prcup = ''; - if($upgitm['price1'] > 0) { - $prcup .= $upgitm['price1'].' .'; - } - if($upgitm['price2'] > 0) { - if($prcup!='') { - $prcup .= ' '; - } - $prcup .= $upgitm['price2'].' .'; - } - $is1 .= ' '.$prcup.''; - unset($prcup); - } - }elseif($type == 63) { - $prcup = ''; - $is1 .= ''; - unset($prcup); - }elseif($type == 64) { - $prcup = ''; - $is1 .= ' '; - unset($prcup); - }elseif($type==61) { // - if($pl['price1']>$pl['1price']) { - $pl['1price'] = $pl['price1']; - } - $prpod = $pl['1price']/2.37; - if($pl['price2']>$pl['2price']) { - $pl['2price'] = $pl['price2']; - } - $prpod2 = 30*($pl['2price']/2.37); - if($prpod2 > $prpod) { - $prpod = $prpod2; - } - if(!isset($po['add_s1']) && !isset($po['add_s2']) && !isset($po['add_s3']) && !isset($po['add_s5'])) { - $prpod = $prpod/2.37; - } - $prpod = round($prpod+$prpod/100*(37.795*($po['upgrade']+1))); - $is1 .= ' '.$prpod.' .'; - }elseif($type==60) { // - if($pl['price1']>$pl['1price']) { - $pl['1price'] = $pl['price1']; - } - $prpod = $pl['1price']/2; - if($pl['price2']>$pl['2price']) { - $pl['2price'] = $pl['price2']; - } - $prpod2 = 30*($pl['2price']/2.37); - if($prpod2 > $prpod) { - $prpod = $prpod2; - } - if(!isset($po['add_s1']) && !isset($po['add_s2']) && !isset($po['add_s3']) && !isset($po['add_s5'])) { - $prpod = $prpod/2; - } - $prpod = round($prpod); - $is1 .= ' '.$prpod.' .'; - - }elseif($type==59) { // - if($po['tr_lvl'] > $pl['level']) { - $pl['level'] = $po['tr_lvl']; - } - //$prpod = $pl['level']*200; - $prpod = 250; - $prpod_ekr = $pl['level']*0.25; - //$is1 .= ' '.$prpod.' .'; - - if($this->stats['repair_z'] >=1) { - $is1 .= ' '; - }else{ - $is1 .= ' '.$prpod.' . - '; - } - }elseif($type==58) { // - if($po['tr_lvl'] > $pl['level']) { - $pl['level'] = $po['tr_lvl']; - } - //$prpod = 50*$pl['level']+200; - $prpod = 250; - $prpod_ekr = $pl['level']*0.15; - if($this->stats['repair_r']>=1){ - $is1 .= ' '; - }else{ - $is1 .= ' '.$prpod.' .
- '; - } - } elseif($type == 57) { - $prpod = 30; - if($pl['type'] == 22) { $prpod = 35; } elseif($pl['type'] == 18) { $prpod = 15; } - if(isset($po['gravi'])) { - $is1 .= ' '.$prpod.' .'; - } else { - $is1 .= ' '.$prpod.' .'; - } - } elseif($type==56) { // - if($po['tr_lvl']>$pl['level']) { - $pl['level'] = $po['tr_lvl']; - } - $prpod = 5*$pl['level']+10; - $prhp = 6*$pl['level']+6; - $is1 .= ' '.$prpod.' .'; - }elseif($type==15) { // - $is1 .= ''; - }elseif($type==11){ - $pl['rep'] = 0; - if($this->rep['rep1']<100) { - if( $po['tr_lvl'] >= 4 && $po['tr_lvl'] <= 6 ) { - $pl['rep'] = 1; - } - if($pl['item_id']==1035){ - $pl['rep'] = 2; - } - }elseif($this->rep['rep1']>99 && $this->rep['rep1']<1000) { - if( $po['tr_lvl'] >= 7 && $po['tr_lvl'] <= 8 ) { - $pl['rep'] = 1; - } - if($pl['item_id']==1035){ - $pl['rep'] = 1; - } - }elseif($this->rep['rep1']>999) { - if( $po['tr_lvl'] >= 9 && $po['tr_lvl'] <= 10 ) { - $pl['rep'] = 1; - } - if($pl['item_id']==1035){ - $pl['rep'] = 1; - } - }else{ - if($pl['item_id']==1035){ - $pl['rep'] = 2; - } - } - $is1 .= ''; - }elseif($type==14){ - $is1 .= ''; - }elseif($type==12){ - $is1 .= ''; - }elseif($type==10){ - // ( ( )) - $is1 .= ' '; - }elseif($type==9){ - // ( ( )) - $is1 .= ' '; - }elseif($type==8){ - // ( ) - $is1 .= ' '; - }elseif($type==7){ - // ( ) - $is1 .= ' '; - }elseif($type==6){ - // - $is1 .= ''; - }elseif($type==5){ - // - $is1 .= '

(: 1 .)'; - }elseif($type==12){ - // - $skcd = round($col*($pl['price1']*0.06-0.01*$this->stats['os1']),2); - if($skcd < 0.06) { - $skcd = 0.06; - } - $is1 .= '  '.(1+$skcd).' .'; - }elseif($type==13){ - // - if($pl['1price']>0){ - $mess = " ? !"; - $pl['name']= ' '.$pl['1price'].' .'; - }else{ - $mess = " ? "; - } - $date1 = $pl['delete']-time(); - $is1 .='
-


('.date("j . H .",$date1).' )
'; - }elseif($type==4){ - // - $r1 = round($pl['price1']*0.1/100,2); - $r2 = round($pl['price1']*0.1/10,2); - $r3 = round($pl['price1']*$pl['iznosNOW']*0.10/100,2); - - if( $this->stats['repair_discount'] >= 1 ) { - $r1 = round(($r1/100*25),2); - $r2 = round(($r2/100*25),2); - $r3 = round(($r3/100*25),2); - } - - if($r1<0.01){ $r1 = 0.01; } - if($r2<0.01){ $r2 = 0.01; } - if($r3<0.01){ $r3 = 0.01; } - $is1 .= ' 1 . '.$r1.' .
'; - if($pl['iznosNOW']>=10){$is1 .= ' 10 . '.$r2.' .
';} - $is1 .= ' '.$r3.' .
'; - if($c['zuby'] == true) { - if( $this->info['level'] < 8 ) { - $is1 .= '
1 . '.$this->zuby($r1).'
'; - if($pl['iznosNOW']>=10){$is1 .= ' 10 . '.$this->zuby($r2).'
';} - $is1 .= ' '.$this->zuby($r3).'
'; - } - } - }elseif($type==3){ - $is1 .= ''; - }elseif($type==2){ - global $shopProcent; - $shpCena = $pl['1price']; - if( $pl['1price'] == 0 ) { - $shpCena = $pl['price1']; - } - $plmx = 0; - if($pl['iznosMAXi']!=$pl['iznosMAX'] && $pl['iznosMAX']!=0){ - $plmx = $pl['iznosMAX']; - }else{ - $plmx = $pl['iznosMAXi']; - } - if($pl['iznosNOW']>0){ - $prc1 = floor($pl['iznosNOW'])/ceil($plmx)*100; - }else{ - $prc1 = 0; - } - $shpCena = $this->shopSaleM($shpCena,$pl); - $shpCena = $shpCena/100*(100-$prc1); - if( $pl['iznosMAXi'] < 999999999 ) { - if($pl['iznosMAX']>0 && $pl['iznosMAXi']>0 && $pl['iznosMAXi']>ceil($pl['iznosMAX'])) - { - $shpCena = $shpCena/100*(ceil($pl['iznosMAX'])/$pl['iznosMAXi']*100); - } - } - $shpCena = $this->round2($shpCena/100*(100-$shopProcent)); - if($shpCena<0){ - $shpCena = 0; - } - if($pl['kolvo']>0){ - $shpCena = $shpCena*$pl['kolvo']; - } - if(isset($po['toclan'])) { - $po['toclan1'] = explode('#',$po['toclan']); - $us_1 = $po['toclan1'][1]; - if($us_1 != $this->info['id']) { - $d_s = false; - } else { - $d_s = true; - } - } else { - $d_s = true; - } - if($d_s == true) { // - $is1 .= ' '.$shpCena.' .'; - if($pl['pricerep'] > 0) { - $is1 .= '
'.floor($pl['pricerep']*$pl['kolvo']/2).' c. '; - } - } else { - $is1 .= ' .'; - } - }elseif($type==16){ - $shpCena = $pl['price2']; - if($pl['2price'] > 0 ) { - $shpCena = $pl['2price']; - } - $shpCena = $this->shopSaleM($shpCena,$pl); - if($pl['kolvo']>0){ - $shpCena = $shpCena*$pl['kolvo']; - } - $plmx = 0; - if($pl['iznosMAXi']!=$pl['iznosMAX'] && $pl['iznosMAX']!=0){ - $plmx = $pl['iznosMAX']; - }else{ - $plmx = $pl['iznosMAXi']; - } - if($pl['iznosNOW']>0){ - $prc1 = floor($pl['iznosNOW'])/ceil($plmx)*100; - }else{ - $prc1 = 0; - } - $shpCena = $shpCena/100*(100-$prc1); - if($pl['iznosMAX']>0 && $pl['iznosMAXi']>0 && $pl['iznosMAXi']>$pl['iznosMAX']){ - $shpCena = $shpCena/100*($pl['iznosMAX']/$pl['iznosMAXi']*100); - } - //$shpCena = $this->round2($shpCena*0.5); // - if( isset($po['art']) ) { - $shpCena = $this->round2($shpCena*$this->berezCena()); // - }else{ - $shpCena = $this->round2($shpCena*$this->berezCena()); // - } - if($shpCena<0){ - $shpCena = 0; - } - if(isset($po['toclan'])) { - $po['toclan1'] = explode('#',$po['toclan']); - $us_1 = $po['toclan1'][1]; - if($us_1 != $this->info['id']) { - $d_s = false; - } else { - $d_s = true; - } - } else { - $d_s = true; - } - if($d_s == true) { - $is1 .= ' '.$shpCena.' .'; - } else { - $is1 .= ' .'; - } - }elseif($type==30){ - if(isset($po['toclan'])) { - $po['toclan1'] = explode('#',$po['toclan']); - $us_1 = $po['toclan1'][1]; - if($us_1 != $this->info['id']) { - $d_s = false; - } else { - $d_s = true; - } - } else { - $d_s = true; - } - if($d_s == true) { - $is1.= '
'; - } else { - $is1.= ' .'; - } - }elseif($type==31){ - $is1.= '
'; - }else{ - if($d[2]==1) { // - $inv1 = ''; - if(isset($_GET['inv'])) { - $inv1 = 'inv=1&'; - } - if($pl['item_id']==74){ - $is1 .= '-'; - }else{ - $useUrl = ''; - if($pl['magic_inc']==''){ - $pl['magic_inc'] = $pl['magic_inci']; - } - if($pl['magic_inc'] && $pl['type']==30){ - // - $pldate = '
"'.$pl['name'].'"
?
'; - $useUrl = 'top.useiteminv(\''.(0+$pl['id']).'\',\''.$pl['img'].'\',\''.$pl['img'].'\',1,\''.$pldate.'\',\''.(0+$_GET['otdel']).'\');'; - }elseif($pl['magic_inc'] && $pl['type']==29){ // - if(isset($po['useOnLogin']) && !isset($po['zazuby'])){ // - $useUrl = 'top.useMagic(\''.$pl['name'].'\','.(0+$pl['id']).',\''.$pl['img'].'\',1,\'main.php?'.$inv1.'otdel='.((int)$_GET['otdel']).'&use_pid='.$pl['id'].'&rnd='.$code.'\');'; - }else{ // ( , \) - $pldate = '
"'.$pl['name'].'"
?
'; - $useUrl = 'top.useiteminv(\''.(0+$pl['id']).'\',\''.$pl['img'].'\',\''.$pl['img'].'\',1,\''.$pldate.'\',\''.(0+$_GET['otdel']).'\','.(0+$_GET['otdel']).');'; - } - // - } - if($useUrl != '') { - $is1 .= '-'; - }else{ - $d[2] = 0; - } - } - } - - if($pl['max_text'] > 0 && $pl['max_text']-$pl['use_text'] > 0) { - $is1 .= '
'; - } - if($pl['type']==31 || $pl['type']==46 || $pl['type']==62 || $pl['type']==68 || $pl['type']==37 || $pl['type']==47){ - if($d[2]==1){ - $is1 .= '
'; - } - if($pl['type'] != 37 || !isset($po['item_inbox']) || $po['item_inbox'] == 0) { - $is1 .= '-'; - } - } - - if($d[0]==1 && $pl['type']!=30 && $pl['type']!=31 && (($pl['type']!=38 && $pl['type']!=39 && $pl['type']!=37) || $pl['gift']!='')) {// - if(!isset($po['noodet']) && $pl['inslot'] > 0){ - if($d[2]==1){ - $is1 .= '
'; - } - $is1 .= ''; - } - } - if(isset($po['open']) && $d[0]==1){ - if($d[2]==1){ - $is1 .= '
'; - } - $is1 .= ''; - } - if(isset($po['close'])){ - if($d[2]==1){ - $is1 .= '
'; - } - $is1 .= ' '; - } - if($pl['group']>0){ - $is1 .= '
'; - if($this->itemsX($pl['id']) < $pl['group_max'] ) { - $is1 .= ''; - } - if($this->itemsX($pl['id'])>1 ){ - $is1 .= ' '.$script; - } - } - if(isset($po['toclan'])) { - $po['toclan1'] = explode('#',$po['toclan']); - $us_1 = $po['toclan1'][1]; - if($us_1 != $this->info['id']) { - $d[1] = 0; - } - } - - $is1 .= ' '; - - if($d[1]==1) { // - if(!isset($po['nodelete'])) { - $is1 .= ' '; - } - //$is1 .= ' '; - } - } - - // (: - $rt[2] .= '
'.$is1.'
'.$is2.'
'; - $rt[1] += $pl['massa']; - $i++; - } - $j++; - } - $rt[0] = $i; - $rt['collich']=$j; - return $rt; - } - - public function itemsX($id,$uid = NULL, $item_id=NULL){ - $item = mysql_fetch_array(mysql_query('SELECT `iu`.`id`,`iu`.`item_id`,`iu`.`uid`,`iu`.`inGroup`,`iu`.`inShop` FROM `items_users` AS `iu` WHERE `iu`.`delete` = "0" AND `iu`.`id` = "'.((int)$id).'" LIMIT 1 ')); - if($item['inGroup'] == 0){ - $grp = ' LIMIT 1'; - } else { - $grp = ' LIMIT 1000'; - } - //$grp = ' LIMIT 1'; - $r = mysql_num_rows(mysql_query('SELECT `iu`.`id` FROM `items_users` AS `iu` WHERE `iu`.`inShop` = "'.$item['inShop'].'" AND `iu`.`item_id` = "'.$item['item_id'].'" AND `iu`.`uid` = "'.($item['uid']).'" AND `iu`.`delete` = "0" AND `iu`.`inGroup` = "'.($item['inGroup']).'" '.$grp.' ')); - /* - $r = mysql_fetch_array(mysql_query('SELECT COUNT(`iu`.`id`) FROM `items_users` AS `iu` WHERE `iu`.`inShop` = "'.$item['inShop'].'" AND `iu`.`item_id` = "'.$item['item_id'].'" AND `iu`.`uid` = "'.($item['uid']).'" AND `iu`.`delete` = "0" AND `iu`.`inGroup` = "'.($item['inGroup']).'" '.$grp.' ')); - $r = $r[0]; - */ - unset($item); - return $r; - } - - private function stackGroupCheck($uid, $group, $item){ // ID . - $g = 0; - $i = 0; - do { - $i++; - $gr = mysql_fetch_array(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` - WHERE `iu`.`uid`="'.$uid.'" AND `iu`.`delete`="0"AND `iu`.`inGroup`="'.$i.'" AND `iu`.item_id="'.$item.'" - LIMIT 1')); - if( empty($gr['inGroup']) ) { - $g = 1; - } - } while ($g == 0); - return $i; - } - - public function stack($id) { - global $c,$code; - $where = ''; - $itm = mysql_fetch_array(mysql_query('SELECT -`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`, count(`iuu`.id) as inGroupCount - FROM `items_users` AS `iu` - LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) - LEFT JOIN `items_users` as `iuu` ON (`iuu`.inGroup = `iu`.inGroup AND `iuu`.item_id = `im`.id AND `iuu`.inShop = 0) - WHERE `iu`.`id` = "'.mysql_real_escape_string((int)$id).'" AND `iu`.`uid` = "'.$this->info['id'].'" AND `iuu`.`uid` = "'.$this->info['id'].'" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `iu`.`inShop` = "0" AND `im`.`group` = "1" LIMIT 1')); - - if(isset($itm['id']) && $itm['iznosNOW']==0 ) { // - // - if( $itm['inGroup'] == 0 ) { // , . - $items= mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0"AND `iu`.`inGroup`="0" AND `iu`.item_id="'.$itm['item_id'].'"')); - $items = ceil( $items / $itm['group_max'] ); - } else { // , inGroup == 0 - $curG = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0"AND `iu`.`inGroup`="'.$itm['inGroup'].'" AND `iu`.item_id="'.$itm['item_id'].'"')); // - $curNG = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0"AND `iu`.`inGroup`="0" AND `iu`.item_id="'.$itm['item_id'].'"')); // - $needG = $itm['group_max']-$curG; // , 0 - - if( $needG > 0 AND $curNG==0 ) { - $curItem = mysql_fetch_array(mysql_query('SELECT `iu`.id, `iu`.inGroup, count(`iu`.inGroup) as itemsInGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`inGroup`!="'.$itm['inGroup'].'" AND `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `iu`.item_id="'.$itm['item_id'].'" GROUP BY `iu`.inGroup HAVING itemsInGroup <= "'.$needG.'" ORDER BY itemsInGroup DESC LIMIT 1')); - if(isset($curItem['id']) ){ - $where = ' `iu`.`inGroup` = "'.$curItem['inGroup'].'" AND '; - } - $itm['group_max'] = $needG; - } else { - $itm['group_max'] = $needG; - } - $items = 1; - } - $s = 0; - do { - if( !isset($curG) AND $curNG==0 ) $itm['inGroup'] = $this->stackGroupCheck($this->info['id'], $itm['inGroup'], $itm['item_id']); - $sp = mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE '.$where.' `iu`.`kolvo` = "1" AND `iu`.`item_id` = "'.$itm['item_id'].'" AND `iu`.`uid` = "'.$this->info['id'].'" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `iu`.`inShop` = "0" AND `im`.`group` = "1" ORDER BY `iu`.`inGroup` ASC LIMIT '.$itm['group_max'].''); - $i = 0; $j = 0; - while($pl = mysql_fetch_array($sp)) { - $pl['data'] = $this->lookStats($pl['data']);unset($pl['data']['frompisher']);$pl['data'] = $this->impStats($pl['data']); - $itm['data'] = $this->lookStats($itm['data']);unset($itm['data']['frompisher']);$itm['data'] = $this->impStats($itm['data']); - if( $pl['data']==$itm['data'] && $pl['name']==$itm['name'] && $itm['iznosMAX']==$pl['iznosMAX'] && $pl['iznosNOW']==0 && ($pl['timeOver']==0 || $pl['timeOver']>time()) && $pl['gift']==$itm['gift'] ){ - $upd = mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `inGroup` = "'.$itm['inGroup'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - if($upd){ - $j++; - } - $i++; - } - } - mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - $s++; - } while ($s < $items); - } - } - - public function unstack($id,$x = NULL) { - $id = (int)$id; - $itm = mysql_fetch_array(mysql_query('SELECT `iu`.id, `iu`.inGroup, `im`.`id` as item_id,`im`.`name`, count(`iuu`.id) as inGroupCount -FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) LEFT JOIN `items_users` as `iuu` ON (`iuu`.inGroup = `iu`.inGroup AND `iuu`.item_id = `im`.id ) -WHERE `iuu`.`uid`="'.$this->info['id'].'" AND `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `im`.`group` = "1" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.id='.mysql_real_escape_string((int)$id).' -ORDER BY `iu`.lastUPD DESC -LIMIT 1')); - if(isset($itm['id']) && $itm['inGroup']>0 && $itm['inGroupCount']>0) { - if($x==0 OR $x==NULL) { - $x = $this->itemsX($itm['id']); //- - $inGroup = 0 ; - } elseif( $x != 0 ) { - $inGroup = $this->stackGroupCheck($this->info['id'], $itm['inGroup'], $itm['item_id']); - } else { - $inGroup = 0 ; - } - $sp = mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid` = "'.$this->info['id'].'" AND `iu`.`delete` = "0" AND `iu`.`inGroup` = "'.$itm['inGroup'].'" AND `iu`.`item_id` = "'.$itm['item_id'].'" AND `iu`.`inOdet` = "0" AND `iu`.`inShop` = "0" AND `im`.`group` = "1" LIMIT '.$x.''); - $i = 0; $j = 0; - while($pl = mysql_fetch_array($sp)){ - $upd = mysql_query('UPDATE `items_users` SET `inGroup` = "'.$inGroup.'", `lastUPD` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - if($upd){ - $j++; - } - $i++; - } - if( $this->itemsX($itm['id']) == 1){ - mysql_query('UPDATE `items_users` SET `inGroup` = "0", `lastUPD` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - } - if( $this->itemsX($pl['id']) == 1){ - mysql_query('UPDATE `items_users` SET `inGroup` = "0", `lastUPD` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1'); - } - - } - } - - public function lookStats($m) - { - $ist = array(); - $di = explode('|',$m); - $i = 0; $de = false; - while($iinfo['id']) - { - $u = mysql_fetch_array(mysql_query('SELECT `u`.`align`,`u`.`align2`,`u`.`battle`,`u`.`clan`,`u`.`animal`,`u`.`id`,`u`.`level`,`u`.`login`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`obraz`, - `st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity` - FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($uid).'" OR `u`.`login`="'.mysql_real_escape_string($uid).'" LIMIT 1')); - if($sn==0) - { - $sn = $this->getStats($uid,$i1); - } - }else{ - $u = $this->info; - if(isset($this->stats['hpAll'])) - { - $sn = $this->stats; - }elseif($sn!=0) - { - - }else{ - $sn = $this->getStats($uid,$i1); - } - } - if(isset($u['id'])) - { - $snIt = 0; - // - $cl = mysql_query('SELECT - `iu`.`id` AS `iduid`, - `iu`.`time_sleep`,`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, - `iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` - FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE (`iu`.`inOdet`!="0" OR `iu`.`data` LIKE "%srok%" OR `iu`.`data` LIKE "%vip_sale%" OR `iu`.`data` LIKE "%sudba=1%" OR ( `iu`.`data` LIKE "%zazuby=%" AND `iu`.`data` NOT LIKE "%srok=%" ) OR `iu`.`iznosNOW` > 0 OR `im`.`srok` > 0 OR (`iu`.`timeOver`<'.time().' AND `iu`.`timeOver`!="0")) AND `iu`.`uid`="'.$u['id'].'" AND (`iu`.`delete`="0" OR `iu`.`delete`="1000")'); - while($itm = mysql_fetch_array($cl)) { - $po = array(); - $po = $this->lookStats($itm['data']); - $po['lvl'] = $u['level']; - // - $t = $this->items['tr']; - $x = 0; - $notr = 0; - $j = 1; - while($j<=4){ - if(!isset($po['tr_s'.$j]) && $itm['type']!=26){ - $po['tr_s'.$j] = 0; - } - $j++; - } - while($x < count($t)) { - $n = $t[$x]; - if( isset($po['tr_'.$n]) && $n == 'sex' ) { - if( $po['tr_'.$n] != $this->info['sex'] ) { - $notr++; - } - }elseif(isset($po['tr_'.$n])) { - if($po['tr_'.$n] > $this->stats[$n] && $n != 'align' && $n != 'align_bs') { - $notr++; - } - } - $x++; - } - if($this->info['twink']>0) { - // 100 . - if( $itm['price2'] > 1 || $itm['2price'] > 1 ) { - $notr++; - } - // + - if( isset($po['rune']) && $po['rune'] > 0 ) { - $notr++; - } - if( isset($po['spell_id']) && $po['spell_id'] > 0 ) { - $notr++; - } - } - if(isset($po['sudba']) && $po['sudba'] == 1 ) { - $po['sudba'] = $u['login']; - $itm['data'] = $this->impStats($po); - mysql_query('UPDATE `items_users` SET `data` = "'.$itm['data'].'" WHERE `id` = "'.$itm['iduid'].'" AND `uid` = "'.$u['id'].'" LIMIT 1'); - } - if(isset($po['zazuby']) && !isset($po['srok']) && ( $itm['type'] == 29 || $itm['type'] == 30 || $itm['type'] == 36 || $itm['type'] == 49 || $itm['type'] == 46 || $itm['type'] == 34 ) ) { - // - $po['srok'] = 86400*7; - $itm['data'] = $this->impStats($po); - mysql_query('UPDATE `items_users` SET `data` = "'.$itm['data'].'" WHERE `id` = "'.$itm['iduid'].'" AND `uid` = "'.$u['id'].'" LIMIT 1'); - } - if(isset($po['srok']) && $po['srok'] > 0){ - $itm['srok'] = $po['srok']; - } - if(isset($po['vip_sale'])) { - if($sn['silver'] < 2 && ($itm['time_create']-time()) < 0) { - if( $itm['item_id'] == 4704 ) { - $po['musor2'] = 4708; - } - $this->isport($itm['id'],$itm['timeOver'],$itm['overType'],$u['id'],(int)$po['musor2'],$itm['type'],$itm['name'],$po['zazuby']); - $notr++; - } - } - if($itm['iznosNOW']>=ceil($itm['iznosMAX']) && $itm['iznosMAXi'] != 999999999){ - $notr++; - } - if($notr > 0 && $itm['inOdet'] != 0) { - // - $this->snatItem($itm['id'],$u['id']); - $snIt++; - } - // - if($itm['iznosNOW']>=ceil($itm['iznosMAX']) && $itm['iznosMAXi'] != 999999999){ - // - if(isset($po['musor'])){ - if($po['musor']>0){ - $this->recr($itm['id'],$itm['type'],$u['id'],(int)$po['musor']); - } - } - } - if($itm['time_create']+$itm['srok'] <= time() && $itm['srok']>0 && $itm['time_sleep'] == 0){ - if($itm['inOdet']!=0){ - $this->snatItem($itm['id'],$u['id']); - $snIt++; - } - // - if( $itm['item_id'] == 4704 ) { - $po['musor2'] = 4708; - } - $this->isport($itm['id'],$itm['timeOver'],$itm['overType'],$u['id'],(int)$po['musor2'],$itm['type'],$itm['name']); - }elseif($itm['time_create']+$itm['srok'] <= time() && $itm['srok']>0){ - echo 'test'; - } - } - - if($snIt>0){ - $this->testItems($uid,$sn,1); - }elseif($dt==0){ - return -2; - } - }else{ - return 0; - } - } - - public function recr($id,$tp,$uid,$id2){ - if($id!=0){ - if($uid!=0){ - $uid2 = 'AND `uid`="'.$uid.'"'; - }else{ - $uid2 = ''; - } - $upd = mysql_query('UPDATE `items_users` SET `delete`="'.time().'" WHERE `id` = "'.$id.'" '.$uid2.' LIMIT 1'); - if($upd){ - $this->addDelo(2,$uid,'"System.inventory": [itm:'.$it.'] .',time(),$this->info['city'],'System.inventory',0,0); - if($id2>1){ - // - $this->addItem($id2,$uid,'noodet=1|noremont=1'); - } - } - } - } - - public function isport($it,$t,$tp,$uid,$id2,$type,$name,$zub){ - if($id2 == 4708 ) { - $tp = 1; - } - if($it!=0){ - if($uid!=0){ - $uid2 = 'AND `uid`="'.$uid.'"'; - }else{ - $uid2 = ''; - } - $upd = mysql_query('UPDATE `items_users` SET `delete`="'.time().'",`timeOver`="1" WHERE `id` = "'.$it.'" '.$uid2.' LIMIT 1'); - if($upd){ - $upd = mysql_query('UPDATE `items_users` SET `inGroup`="0",`timeOver`="'.time().'" WHERE `inGroup` = "'.$it.'" '.$uid2.''); - $this->addDelo(2,$uid,'"System.inventory": '.$name.' [itm:'.$it.'] .',time(),$this->info['city'],'System.inventory',0,0); - if($tp!=0){ - // , - $zzba = ''; - if( $zub > 0 ) { - $zzba = '|zazuby=1'; - } - $po = $this->lookStats($this->stats['items'][$i]['data']); - if($id2>0){ - if($id2 == 4708 ) { - $this->addItem($id2,$uid,'|notransfer=1|nosale=1'.$zzba); - }else{ - $this->addItem($id2,$uid,'|noodet=1'.$zzba); - } - }else{ - if( $type == 30 ) { - // - $this->addItem(4036,$uid,'|renameadd='.$name.'|noodet=1'.$zzba); - } - } - } - } - } - } - - public function btlMagicList() { - global $c; - $i = 1; $sv = array(); - while($i<=10) { - $sv[$i] = ''; - $i++; - } - $i = 0; - while($i < count($this->stats['items'])) { - if($this->stats['items'][$i]['inslot'] == 40 || $this->stats['items'][$i]['inslot'] == 51) { - if($this->stats['items'][$i]['useInBattle']==0 || $this->stats['items'][$i]['btl_zd']>0 || $this->stats['items'][$i]['iznosNOW']>=$this->stats['items'][$i]['iznosMAX'] || $this->stats['items'][$i]['magic_inci']=='' || $this->stats['items'][$i]['magic_inci']=='0') { - $vl = ' class="nopriemuse"'; - }else{ - $po = $this->lookStats($this->stats['items'][$i]['data']); - if($po['useOnLogin']==1) { - $useUrl = 'top.useMagicBattle(\''.$this->stats['items'][$i]['name'].'\','.$this->stats['items'][$i]['id'].',\''.$this->stats['items'][$i]['img'].'\',1,1,\'\',\''.$this->stats['items'][$i]['useInBattle'].'\');'; - }else{ - $useUrl = 'top.useMagicBattle(\''.$this->stats['items'][$i]['name'].'\','.$this->stats['items'][$i]['id'].',\''.$this->stats['items'][$i]['img'].'\',1,2);'; - } - $vl = 'style="cursor:pointer" onclick="'.$useUrl.'"'; - } - $sv[$this->stats['items'][$i]['inOdet']-39] = ''; - } - $i++; - } - $r = ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - '
'.$sv[1].''.$sv[2].''.$sv[3].''.$sv[4].''.$sv[5].''.$sv[6].''.$sv[7].''.$sv[8].''.$sv[9].''.$sv[10].''.$sv[11].''.$sv[12].'
'; - return str_replace('"','\"',$r); - } - - public function nameItemMf($pl,$po) { - $r = $pl['name']; - if( isset($po['icos']) ) { - $r = ''.$pl['name'].'  '.$po['icos'].' '; - } - //if( $this->info['admin'] > 0 ) { - if(isset($po['rune']) && $po['rune']>0) { - $rnc = explode(' ',$po['rune_name']); - if($rnc[0] == '') { - $rnc = '#9b5d40'; - }elseif($rnc[0] == '') { - $rnc = '#3a2b64'; - }elseif($rnc[0] == '') { - $rnc = '#20a3b0'; - }elseif($rnc[0] == '') { - $rnc = '#4c7718'; - }else{ - $rnc = '#4c4c4c'; - } - $r .= '
: '.$po['rune_name'].''; - unset($rnc); - } - if( isset($po['spell']) ) { - $rnc = explode(' ',$po['spell_name']); - if($rnc[2] == '[0]') { - $rnc = '#282828'; - }elseif($rnc[2] == '[1]') { - $rnc = '#624542'; - }elseif($rnc[2] == '[2]') { - $rnc = '#77090b'; - }elseif($rnc[2] == '[3]') { - $rnc = '#d99800'; - }else{ - $rnc = '#282828'; - } - $r .= '
'.$po['spell_name'].''; - unset($rnc); - } - return $r; - } - - public function getInfoItemInfo($pl) { - $lvar = ''; - $td = $this->lookStats($pl['data']); - - /*if(isset($td['add_hpAll']) && $td['add_hpAll']!=0) - { - if($td['add_hpAll']>0) - { - $td['add_hpAll'] = '+'.$td['add_hpAll']; - } - $lvar .= '
: '.$td['add_hpAll'].''; - } - if(isset($td['add_mpAll']) && $td['add_mpAll']!=0) - { - if($td['add_mpAll']>0) - { - $td['add_mpAll'] = '+'.$td['add_mpAll']; - } - $lvar .= '
: '.$td['add_mpAll'].''; - }*/ - if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0) - { - $lvar .= '
: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; - } - if(isset($td['add_mab1']) && $td['add_mab1']>0) - { - if($td['add_mib1']==$td['add_mab1'] && $pl['geniration']==1) - { - $m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; } - $lvar .= '
: '.$m1l.''.(0+$td['add_mab1']).''; - }else{ - $lvar .= '
: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; - } - } - // - $t = $this->items['add']; - $x = 0; - while($xis[$n])){ - $z = '+'; - if($td['add_'.$n]<0){ - $z = ''; - } - $lvar .= '
'.$this->is[$n].': '.$z.''.$td['add_'.$n]; - } - $x++; - } - // - $x = 0; - while($xis[$n].': '.$z.''.$td['sv_'.$n]; - } - } - $x++; - } - if($pl['2h']==1){ - $lvar .= '
'; - } - if(isset($po['zonb'])){ - $lvar .= '
: '; - if($lvar['zonb']>0){ - $x = 1; - while($x<=$td['zonb']){ - $lvar .= '+'; - $x++; - } - }else{ - $lvar .= ''; - } - } - - // - if(isset($td['add_mab2']) && $td['add_mab2']>0) - { - if($td['add_mib2']==$td['add_mab2'] && $pl['geniration']==1) - { - $m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; } - $lvar .= '
: '.$m1l.''.(0+$td['add_mab2']).''; - }else{ - $lvar .= '
: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; - } - } - if(isset($td['add_mab3']) && $td['add_mab3']>0) - { - if($td['add_mib3']==$td['add_mab3'] && $pl['geniration']==1) - { - $m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; } - $lvar .= '
: '.$m1l.''.(0+$td['add_mab3']).''; - }else{ - $lvar .= '
: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; - } - } - if(isset($td['add_mab4']) && $td['add_mab4']>0) - { - if($td['add_mib4']==$td['add_mab4'] && $pl['geniration']==1) - { - $m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; } - $lvar .= '
: '.$m1l.''.(0+$td['add_mab4']).''; - }else{ - $lvar .= '
: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; - } - } - if($pl['iznosMAX']>0) - { - if($pl['iznosMAXi'] >= 909999999) { - //$lvar .= '
: '; - }else{ - $lvar .= '
: '.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']); - } - } - - if( $po['battleUseZd'] > 0 ) { - $lvar .= '
: '.$this->timeOut($po['battleUseZd']).''; - } - - if(isset($td['gravi'])) { - $lvar .= '
"'.$td['gravi'].'"'; - } - - return $lvar; - } - - - public function getInfoPers($uid,$i1,$sn = 0,$ivv = 0){ - global $c,$code; - - $st = false; $rt = false; $type_info = 1; - if($uid!=$this->info['id']){ - $u = mysql_fetch_array(mysql_query('SELECT `u`.`inTurnir`,`u`.`allLock`,`u`.`battle`,`u`.`zag`,`u`.`banned`,`u`.`align`,`u`.`align2`,`u`.`clan`,`u`.`animal`,`u`.`id`,`u`.`level`,`u`.`login`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`obraz`, - `st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity` - FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($uid).'" OR `u`.`login`="'.mysql_real_escape_string($uid).'" LIMIT 1')); - if($sn==0){ - $sn = $this->getStats($uid,$i1); - } - }else{ - $u = $this->info; - if(isset($this->stats['hpAll'])){ - $sn = $this->stats; - }elseif($sn!=0){ - }else{ - $sn = $this->getStats($uid,$i1); - } - } - - $tp_img = array( - 1 => 4, - 2 =>5, - 14 => 6, - 3 => 7, - 5 => 8, - 7 => 9, - 17 => 10, - 16 => 11, - 13 => 12, - 10 => 13, - 9 => 14, - 8 => 15, - 11 => 17, // 2 - 12 => 18 // 3 - ); - - if(isset($u['id'],$u['stats'])){ - //if( $u['inTurnir'] > 0 ) { - // $type_info = 2; - //} - $rt = array(0=>'',1=>array()); - $st = array(); - $st['id'] = $u['id']; - $st['login'] = $u['login']; - $st['lvl'] = $u['level']; - - // - $witm = array(); - $witm[1] = ''; - $witm[2] = ''; - $witm[3] = ''; - $witm[4] = ''; - $witm[7] = ''; - $witm[8] = ''; - $witm[9] = ''; - $witm[10] = ''; - $witm[11] = ''; - $witm[12] = ''; - $witm[13] = ''; - $witm[14] = ''; - $witm[16] = ''; - $witm[17] = ''; - //40-52 - $witm[53] = ''; - $witm[54] = ''; - $witm[55] = ''; - $witm[56] = ''; - $witm[57] = ''; - $witm[58] = ''; - $cl = mysql_query('SELECT - `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, - `iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` - FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`inOdet`!="0" AND `iu`.`uid`="'.$u['id'].'" AND `iu`.`delete`="0"'); - $wj = array(1=>false,2=>false,4=>false,5=>false,6=>false); - $b1 = '
'; - - while($pl = mysql_fetch_array($cl)) - { - $td = $this->lookStats($pl['data']); - - if(isset($td['modif'])) { - $pl['name'] = $pl['name'].' ()'; - } - - if(isset($td['upatack_lvl'])) - { - $pl['name'] = $pl['name'].' +'.$td['upatack_lvl']; - } - - if(isset($td['mod_lvl'])) - { - $pl['name'] = $pl['name'].' '.$mx.' ['.$td['mod_lvl'].']'; - } - - if($pl['inOdet']==1 || $pl['inOdet']==52 || ($pl['inOdet']>=4 && $pl['inOdet']<=6)) - { - $wj[$pl['inOdet']] = $pl; - } - - $pl['name'] = $this->nameItemMf($pl,$td); - - $lvar = ''; - /*if(isset($td['add_hpAll']) && $td['add_hpAll']!=0) - { - if($td['add_hpAll']!=0) - { - $td['add_hpAll'] = '+'.$td['add_hpAll']; - } - $lvar .= '
: '.$td['add_hpAll'].''; - } - if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0) - { - $lvar .= '
: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; - } - if(isset($td['add_mab1']) && $td['add_mab1']>0) - { - if($td['add_mib1']==$td['add_mab1'] && $pl['geniration']==1) - { - $m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; } - $lvar .= '
: '.$m1l.''.(0+$td['add_mab1']).''; - }else{ - $lvar .= '
: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; - } - } - if(isset($td['add_mab2']) && $td['add_mab2']>0) - { - if($td['add_mib2']==$td['add_mab2'] && $pl['geniration']==1) - { - $m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; } - $lvar .= '
: '.$m1l.''.(0+$td['add_mab2']).''; - }else{ - $lvar .= '
: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; - } - } - if(isset($td['add_mab3']) && $td['add_mab3']>0) - { - if($td['add_mib3']==$td['add_mab3'] && $pl['geniration']==1) - { - $m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; } - $lvar .= '
: '.$m1l.''.(0+$td['add_mab3']).''; - }else{ - $lvar .= '
: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; - } - } - if(isset($td['add_mab4']) && $td['add_mab4']>0) - { - if($td['add_mib4']==$td['add_mab4'] && $pl['geniration']==1) - { - $m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; } - $lvar .= '
: '.$m1l.''.(0+$td['add_mab4']).''; - }else{ - $lvar .= '
: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; - } - } - if($pl['iznosMAX']>0) - { - if($pl['iznosMAXi'] == 999999999) { - $lvar .= '
: '; - }else{ - $lvar .= '
: '.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']); - } - } - - if( $po['battleUseZd'] > 0 ) { - $is2 .= '
: '.$this->timeOut($po['battleUseZd']).''; - } - - if(isset($td['gravi'])) { - $td['gravitp'] = array( - 18 => '', - 19 => '', - 20 => '', - 21 => '', - 22 => '', - 23 => '', - 24 => '', - 26 => '', - 27 => '', - 28 => '' - ); - $lvar .= '
'.$td['gravitp'][$pl['type']].' : '.$td['gravi'].''; - unset($td['gravitp']); - }*/ - - /* - if( $pl['inOdet'] == 3 ) { - if( $pl['2h'] == 1 ) { - if(@isset($sn['items_img'][$tp_img[14]])) { - $uimg2 = 'rimg/r'.$sn['items_img'][$tp_img[14]]; - $witm[14] = ''; - }else{ - $uimg2 = 'i/items/'.$pl['img'].''; - $witm[14] = ''; - } - unset($uimg2); - } - } - */ - - $lvar = $this->getInfoItemInfo($pl); - - if(@isset($sn['items_img'][$tp_img[$pl['inOdet']]])) { - $uimg = 'rimg/r'.$sn['items_img'][$tp_img[$pl['inOdet']]]; - }else{ - $uimg = 'i/items/'.$pl['img'].''; - } - - $witm[$pl['inOdet']] = ''; - - if($i1==1){ - $witm[$pl['inOdet']] = ''.$witm[$pl['inOdet']].''; - }else{ - if($pl['inOdet']>=40 && $pl['inOdet']<=52 && !isset($_GET['inv'])){ - $useUrl = ''; - if($pl['magic_inc']==''){ - $pl['magic_inc'] = $pl['magic_inci']; - } - if($pl['magic_inc'] && $pl['type']==30){ - // - $pldate = '
"'.$pl['name'].'"
?
'; - $useUrl = 'top.useiteminv(\''.(0+$pl['id']).'\',\''.$pl['img'].'\',\''.$pl['img'].'\',1,\''.$pldate.'\',\''.(0+$_GET['otdel']).'\');'; - }elseif($pl['magic_inc'] && $pl['type']==29){ - // - // - if(isset($td['useOnLogin'])){ - $inv1 = ''; - if(isset($_GET['inv'])) { - $inv1 = 'inv=1&otdel='.((int)$_GET['otdel']).'&'; - } - $useUrl = 'top.useMagic(\''.$pl['name'].'\','.(0+$pl['id']).',\''.$pl['img'].'\',1,\'main.php?'.$inv1.'use_pid='.$pl['id'].'&rnd='.$code.'\');'; - }else{ - // ( , \) - $pldate = '
"'.$pl['name'].'"
?
'; - $useUrl = 'top.useiteminv(\''.(0+$pl['id']).'\',\''.$pl['img'].'\',\''.$pl['img'].'\',1,\''.$pldate.'\',\''.(0+$_GET['otdel']).'\');'; - } - } - $witm[$pl['inOdet']] = ''.$witm[$pl['inOdet']].''; - }elseif($pl['item_id']==998 && !isset($_GET['inv'])){ - // - $witm[$pl['inOdet']] = ''.$witm[$pl['inOdet']].''; - }else{ - $witm[$pl['inOdet']] = ''.$witm[$pl['inOdet']].''; - } - } - } - //, - $wj1i = ''; - $br = '
'; - if($wj[1]!=false) - { - if($wj[52] != false) { $wj1i .= $br; } - $td = array(); - $td = $this->lookStats($wj[1]['data']); - $wj[1]['name'] = $this->nameItemMf($wj[1],$td); - $wj1i .= ''.$wj[1]['name'].''; - $wj1i .= $this->getInfoItemInfo($wj[1]); - /* - if(isset($td['add_hpAll']) && $td['add_hpAll']!=0) - { - if($td['add_hpAll']>0) - { - $td['add_hpAll'] = '+'.$td['add_hpAll']; - } - $wj1i .= '
: '.$td['add_hpAll'].''; - } - if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0) - { - $wj1i .= '
: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; - } - if(isset($td['add_mab1']) && $td['add_mab1']>0) - { - if($td['add_mib1']==$td['add_mab1'] && $wj[1]['geniration']==1) - { - $m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; } - $wj1i .= '
: '.$m1l.''.(0+$td['add_mab1']).''; - }else{ - $wj1i .= '
: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; - } - } - if(isset($td['add_mab2']) && $td['add_mab2']>0) - { - if($td['add_mib2']==$td['add_mab2'] && $wj[1]['geniration']==1) - { - $m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; } - $wj1i .= '
: '.$m1l.''.(0+$td['add_mab2']).''; - }else{ - $wj1i .= '
: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; - } - } - if(isset($td['add_mab3']) && $td['add_mab3']>0) - { - if($td['add_mib3']==$td['add_mab3'] && $wj[1]['geniration']==1) - { - $m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; } - $wj1i .= '
: '.$m1l.''.(0+$td['add_mab3']).''; - }else{ - $wj1i .= '
: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; - } - } - if(isset($td['add_mab4']) && $td['add_mab4']>0) - { - if($td['add_mib4']==$td['add_mab4'] && $wj[1]['geniration']==1) - { - $m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; } - $wj1i .= '
: '.$m1l.''.(0+$td['add_mab4']).''; - }else{ - $wj1i .= '
: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; - } - } - - if($wj[1]['iznosMAX']>0) - { - if($wj[1]['iznosMAXi'] == 999999999) { - $wj1i .= '
: '; - }else{ - $wj1i .= '
: '.floor($wj[1]['iznosNOW']).'/'.ceil($wj[1]['iznosMAX']).''; - } - }*/ - } - if(isset($wj[52]) && $wj[52]!=false) - { - $td = $this->lookStats($wj[52]['data']); - $wj[52]['name'] = $this->nameItemMf($wj[52],$td); - /*$wj1i = $wj1i; - - if($wj[52]['iznosMAX']>0) - { - if($wj[52]['iznosMAXi'] == 999999999) { - $wj1i = '
:
'.$wj1i; - }else{ - $wj1i = '
: '.floor($wj[52]['iznosNOW']).'/'.ceil($wj[52]['iznosMAX']).''.$wj1i; - } - } - - if(isset($td['add_mab4']) && $td['add_mab4']>0) - { - if($td['add_mib4']==$td['add_mab4'] && $wj[1]['geniration']==1) - { - $m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; } - $wj1i = '
: '.$m1l.''.(0+$td['add_mab4']).''.$wj1i; - }else{ - $wj1i = '
: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''.$wj1i; - } - } - - if(isset($td['add_mab3']) && $td['add_mab3']>0) - { - if($td['add_mib3']==$td['add_mab3'] && $wj[1]['geniration']==1) - { - $m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; } - $wj1i = '
: '.$m1l.''.(0+$td['add_mab3']).''.$wj1i; - }else{ - $wj1i = '
: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''.$wj1i; - } - } - - if(isset($td['add_mab2']) && $td['add_mab2']>0) - { - if($td['add_mib2']==$td['add_mab2'] && $wj[1]['geniration']==1) - { - $m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; } - $wj1i = '
: '.$m1l.''.(0+$td['add_mab2']).''.$wj1i; - }else{ - $wj1i = '
: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''.$wj1i; - } - } - - if(isset($td['add_mab1']) && $td['add_mab1']>0) - { - if($td['add_mib1']==$td['add_mab1'] && $wj[1]['geniration']==1) - { - $m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; } - $wj1i = '
: '.$m1l.''.(0+$td['add_mab1']).''.$wj1i; - }else{ - $wj1i = '
: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''.$wj1i; - } - } - - if(isset($td['add_hpAll']) && $td['add_hpAll']!=0) - { - if($td['add_hpAll']>0) - { - $td['add_hpAll'] = '+'.$td['add_hpAll']; - } - $wj1i = '
: '.$td['add_hpAll'].''.$wj1i; - } - - if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0) - { - $wj1i = '
: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''.$wj1i; - }*/ - - - $wj1i = ''.$wj[52]['name'].''.$wj1i; - $wj1i .= $this->getInfoItemInfo($wj[52]); - $wj[1]['img'] = $wj[52]['img']; - $wj[1]['id'] = $wj[52]['id']; - $wj[1]['inRazdel'] = $wj[52]['inRazdel']; - } - //,, - $wj4idd = $wj[5]['item_id']; - $wj4i = ''; - if($wj[6]!=false) - { - $td = array(); - $td = $this->lookStats($wj[6]['data']); - $wj[6]['name'] = $this->nameItemMf($wj[6],$td); - $wj4i .= ''.$wj[6]['name'].''; - /*if($td['add_hpAll']!=0) - { - if($td['add_hpAll']>0) - { - $td['add_hpAll'] = '+'.$td['add_hpAll']; - } - $wj4i .= '
: '.$td['add_hpAll'].''; - } - if($td['sv_yron_max']>0) - { - $wj4i .= '
: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; - } - if($td['add_mab1']>0) - { - if($td['add_mib1']==$td['add_mab1'] && $wj[6]['geniration']==1) - { - $m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab1']).''; - }else{ - $wj4i .= '
: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; - } - } - if($td['add_mab2']>0) - { - if($td['add_mib2']==$td['add_mab2'] && $wj[6]['geniration']==1) - { - $m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab2']).''; - }else{ - $wj4i .= '
: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; - } - } - if($td['add_mab3']>0) - { - if($td['add_mib3']==$td['add_mab3'] && $wj[6]['geniration']==1) - { - $m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab3']).''; - }else{ - $wj4i .= '
: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; - } - } - if($td['add_mab4']>0) - { - if($td['add_mib4']==$td['add_mab4'] && $wj[6]['geniration']==1) - { - $m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab4']).''; - }else{ - $wj4i .= '
: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; - } - } - - if($wj[6]['iznosMAX']>0) - { - if($wj[6]['iznosMAXi'] == 999999999) { - $wj4i .= '
: '; - }else{ - $wj4i .= '
: '.floor($wj[6]['iznosNOW']).'/'.ceil($wj[6]['iznosMAX']).''; - } - }*/ - $wj4i .= $this->getInfoItemInfo($wj[6]); - if($wj[5]!=false || $wj[4]!=false) - { - $wj4i .= $br; - } - } - if($wj[5]!=false) - { - $td = array(); - $td = $this->lookStats($wj[5]['data']); - $wj[5]['name'] = $this->nameItemMf($wj[5],$td); - $wj4i .= ''.$wj[5]['name'].''; - /*if($td['add_hpAll']!=0) - { - if($td['add_hpAll']>0) - { - $td['add_hpAll'] = '+'.$td['add_hpAll']; - } - $wj4i .= '
: '.$td['add_hpAll'].''; - } - if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0) - { - $wj4i .= '
: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; - } - if(isset($td['add_mab1']) && $td['add_mab1']>0) - { - if($td['add_mib1']==$td['add_mab1'] && $wj[5]['geniration']==1) - { - $m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab1']).''; - }else{ - $wj4i .= '
: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; - } - } - if(isset($td['add_mab2']) && $td['add_mab2']>0) - { - if($td['add_mib2']==$td['add_mab2'] && $wj[5]['geniration']==1) - { - $m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab2']).''; - }else{ - $wj4i .= '
: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; - } - } - if(isset($td['add_mab3']) && $td['add_mab3']>0) - { - if($td['add_mib3']==$td['add_mab3'] && $wj[5]['geniration']==1) - { - $m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab3']).''; - }else{ - $wj4i .= '
: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; - } - } - if(isset($td['add_mab4']) && $td['add_mab4']>0) - { - if($td['add_mib4']==$td['add_mab4'] && $wj[5]['geniration']==1) - { - $m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab4']).''; - }else{ - $wj4i .= '
: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; - } - } - - if($wj[5]['iznosMAX']>0) - { - if($wj[5]['iznosMAXi'] == 999999999) { - $wj4i .= '
: '; - }else{ - $wj4i .= '
: '.floor($wj[5]['iznosNOW']).'/'.ceil($wj[5]['iznosMAX']).''; - } - } - */ - $wj4i .= $this->getInfoItemInfo($wj[5]); - if($wj[4]!=false) - { - $wj4i .= $br; - } - } - if($wj[4]!=false) - { - $td = array(); - $td = $this->lookStats($wj[4]['data']); - $wj[4]['name'] = $this->nameItemMf($wj[4],$td); - $wj4i .= ''.$wj[4]['name'].''; - /*if(isset($td['add_hpAll']) && $td['add_hpAll']!=0) - { - if($td['add_hpAll']>0) - { - $td['add_hpAll'] = '+'.$td['add_hpAll']; - } - $wj4i .= '
: '.$td['add_hpAll'].''; - } - if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0) - { - $wj4i .= '
: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''; - } - if(isset($td['add_mab1']) && $td['add_mab1']>0) - { - if($td['add_mib1']==$td['add_mab1'] && $wj[4]['geniration']==1) - { - $m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab1']).''; - }else{ - $wj4i .= '
: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''; - } - } - if(isset($td['add_mab2']) && $td['add_mab2']>0) - { - if($td['add_mib2']==$td['add_mab2'] && $wj[4]['geniration']==1) - { - $m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab2']).''; - }else{ - $wj4i .= '
: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''; - } - } - if(isset($td['add_mab3']) && $td['add_mab3']>0) - { - if($td['add_mib3']==$td['add_mab3'] && $wj[4]['geniration']==1) - { - $m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab3']).''; - }else{ - $wj4i .= '
: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''; - } - } - if(isset($td['add_mab4']) && $td['add_mab4']>0) - { - if($td['add_mib4']==$td['add_mab4'] && $wj[4]['geniration']==1) - { - $m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; } - $wj4i .= '
: '.$m1l.''.(0+$td['add_mab4']).''; - }else{ - $wj4i .= '
: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''; - } - } - - if($wj[4]['iznosMAX']>0) - { - if($wj[4]['iznosMAXi'] == 999999999) { - $wj4i .= '
: '; - }else{ - $wj4i .= '
: '.floor($wj[4]['iznosNOW']).'/'.ceil($wj[4]['iznosMAX']).''; - } - }*/ - $wj4i .= $this->getInfoItemInfo($wj[4]); - } - /*if($wj[6]!=false) - { - $wj[4]['img'] = $wj[6]['img']; - $wj[4]['id'] = $wj[6]['id']; - $wj[4]['inRazdel'] = $wj[6]['inRazdel']; - }elseif($wj[5]!=false) - { - $wj[4]['img'] = $wj[5]['img']; - $wj[4]['id'] = $wj[5]['id']; - $wj[4]['inRazdel'] = $wj[5]['inRazdel']; - }elseif($wj[4]!=false) - { - - }*/ - if( /*$i1 == 1 &&*/ (($this->info['noplaw'] == 1 && !isset($_GET['hide_plaw'])) || ($this->info['noplaw'] == 0 && isset($_GET['hide_plaw']))) ) { - if($wj[5]!=false) - { - $wj[4]['img'] = $wj[5]['img']; - $wj[4]['id'] = $wj[5]['id']; - $wj[4]['inRazdel'] = $wj[5]['inRazdel']; - }elseif($wj[4]!=false) - { - - } - }else{ - if($wj[6]!=false) - { - $wj[4]['img'] = $wj[6]['img']; - $wj[4]['id'] = $wj[6]['id']; - $wj[4]['inRazdel'] = $wj[6]['inRazdel']; - }elseif($wj[5]!=false) - { - $wj[4]['img'] = $wj[5]['img']; - $wj[4]['id'] = $wj[5]['id']; - $wj[4]['inRazdel'] = $wj[5]['inRazdel']; - }elseif($wj[4]!=false) - { - - } - } - if($wj[1]!=false || $wj[2]!=false) - { - if(isset($sn['items_img'][$tp_img[1]])) { - $uimg = 'rimg/r'.$sn['items_img'][$tp_img[1]]; - }else{ - $uimg = 'i/items/'.$wj[1]['img'].''; - } - $witm[1] = ''; - if($i1==1) - { - $witm[1] = ''.$witm[1].''; - }else{ - $witm[1] = ''.$witm[1].''; - } - } - if($wj[4]!=false || $wj[5]!=false || $wj[6]!=false) - { - if(isset($sn['items_img'][$tp_img[5]])) { - $uimg = 'rimg/r'.$sn['items_img'][$tp_img[5]]; - }else{ - $uimg = 'i/items/'.$wj[4]['img'].''; - } - $witm[4] = ''; - if($i1==1) - { - if( $wj4idd > 0 ) { - $wj[4]['item_id'] = $wj4idd; - } - $witm[4] = ''.$witm[4].''; - }else{ - $witm[4] = ''.$witm[4].''; - } - } - /*------------ . ---------------*/ - $nmmsgl1 = 0; - if($u['align'] >= 1 && $u['align'] < 2) { - $nmmsgl1 = 1; - }elseif($u['align'] >= 3 && $u['align'] < 4) { - $nmmsgl1 = 3; - }elseif($u['align'] >= 7 && $u['align'] < 8) { - $nmmsgl1 = 7; - }elseif($u['align'] >= 50 && $u['align'] < 50) { - $nmmsgl1 = 60; - } - if($u['admin'] > 0) { - $nmmsgl1 = 60; - } - $anan = array( - 1 => 'cat', - 2 => 'owl', - 3 => 'wisp', - 4 => 'demon', - 5 => 'dog', - 6 => 'pig' - ); - $anan2 = array( - 1 => '', - 2 => '', - 3 => '', - 4 => '', - 5 => 'ϸ', - 6 => '' - ); - $anml = ''; - if($u['animal']>0) - { - $an = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `id` = "'.$u['animal'].'" AND `pet_in_cage` = 0 AND `delete` = "0" LIMIT 1')); - if(isset($an['id'])) - { - if($i1 != 1){ - //$anml = '
'; - }else{ - if( $an['eda'] > 0 ) { - //$anml = '
'; - } - } - $petimg = mysql_fetch_array(mysql_query('SELECT `id`,`img` FROM `obraz_pet` WHERE `uid` = "'.$u['id'].'" AND `use` = 1 LIMIT 1')); - if(isset($petimg['id'])) { - $anml = ''; - }else{ - $anml = ''; - } - } - } - unset($anan); - - if(@isset($sn['items_img'][2])) { - $msl = ''; - }else{ - if( $anml == '' ) { - $msl = ''; - }else{ - $msl = $anml; - } - } - unset($nmmsgl1); - $jf = ''; - $oi = ''; - if($i1!=1) - { - $jf = 'main'; - $oi = 'onMouseOver="top.hi(this,\''.$u['login'].' ( "")\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"'; - $msl = ' - - - - - - - - - - -
'.$witm[53].''.$witm[55].''.$witm[54].'
'.$witm[56].''.$witm[57].''.$witm[58].'
'; - } - $hpmp = ''; - $eff = ''; - //-------- - $efs = mysql_query('SELECT - `eu`.`id`,`eu`.`id_eff`,`eu`.`uid`,`eu`.`tr_life_user`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace`, - `em`.`id2`,`em`.`mname`,`em`.`type1`,`em`.`img`,`em`.`mdata`,`em`.`actionTime`,`em`.`type2`,`em`.`type3`,`em`.`onlyOne`,`em`.`oneType`,`em`.`noAce`,`em`.`see`,`em`.`info`,`em`.`overch`,`em`.`bp`,`em`.`noch` - FROM `eff_users` AS `eu` LEFT JOIN `eff_main` AS `em` ON (`eu`.`id_eff` = `em`.`id2`) WHERE `eu`.`uid`="'.mysql_real_escape_string($u['id']).'" AND `delete`="0" AND `deactiveTime` < "'.time().'" ORDER BY `deactiveTime` DESC,`timeUse` ASC'); - while($e = mysql_fetch_array($efs)) - { - $esee = 1; - if($e['see']==0 && $i1==1) - { - $esee = 0; - } - if($e['see']==2 && ($u['battle']!=$this->info['battle'] || $this->info['battle']==0)) - { - $esee = 0; - } - if($e['see']==3 && $i1==0) - { - $esee = 0; - } - if($e['img'] == '') { - $esee = 0; - } - - if(($e['timeUse']+$e['timeAce']+$e['actionTime']>=time() || $e['timeUse']==77) && $esee == 1) - { - $ei = ''.$e['name'].''; - if($e['type1']>0 && $e['type1']<7) - { - $ei .= ' ()'; - }elseif(($e['type1']>6 && $e['type1']<11) || $e['type1']==16) - { - $ei .= ' ()'; - }elseif($e['type1']==14) - { - $ei .= ' ()'; - }elseif($e['type1']==15) - { - $ei .= ' ()'; - }elseif($e['type1']==17) - { - $ei .= ' ()'; - }elseif($e['type1']==18 || $e['type1']==19) - { - $ei .= ' ()'; - }elseif($e['type1']==20) - { - $ei .= ' ()'; - }elseif($e['type1']==22) - { - $ei .= ' ()'; - }else{ - $ei .= ' ()'; - } - $ei .= '
'; - - if($e['type1']!=13 && $e['timeUse']!=77) - { - $out = ''; - $time_still = ($e['timeUse']+$e['timeAce']+$e['actionTime'])-time(); - $tmp = floor($time_still/2592000); - $id=0; - if ($tmp > 0) { - $id++; - if ($id<3) {$out .= $tmp." . ";} - $time_still = $time_still-$tmp*2592000; - } - $tmp = floor($time_still/604800); - if ($tmp > 0) { - $id++; - if ($id<3) {$out .= $tmp." . ";} - $time_still = $time_still-$tmp*604800; - } - $tmp = floor($time_still/86400); - if ($tmp > 0) { - $id++; - if ($id<3) {$out .= $tmp." . ";} - $time_still = $time_still-$tmp*86400; - } - $tmp = floor($time_still/3600); - if ($tmp > 0) { - $id++; - if ($id<3) {$out .= $tmp." . ";} - $time_still = $time_still-$tmp*3600; - } - $tmp = floor($time_still/60); - if ($tmp > 0) { - $id++; - if ($id<3) {$out .= $tmp." . ";} - } - if($out=='') - { - $out = $time_still.' .'; - } - $ei .= ': '.$out.''; - } - - // - $tr = ''; $t = $this->items['add']; - $x = 0; $ed = $this->lookStats($e['data']); - while($xis[$n])) - { - $z = ''; - if($ed['add_'.$n]>0) - { - $z = '+'; - } - $tr .= '
'.$this->is[$n].': '.$z.''.$ed['add_'.$n]; - } - $x++; - } - if($tr!='') - { - $ei .= $tr; - } - if($e['info']!='') - { - $ei .= '
:
'.$e['info']; - } - if($e['img2']!='' && $e['img']=='icon_none.gif') - { - $e['img'] = $e['img2']; - } - if($e['type1']==18 || $e['type1']==19) - { - $e['img'] = $e['img2']; - } - $eff .= ''; - }elseif($e['timeUse']+$e['timeAce']+$e['actionTime']lookStats($e['data']); - if(!isset($ed['finish_file']) || $this->info['id'] == $e['uid']) { - $this->endEffect($e['id'],$u); - } - } - } - - if($sn['itmslvl'] == 0) { - //$ei = ' ()
: '; - //$eff .= ''; - } - - // - if( $type_info == 1 ) { - $hptop = 0; - $lh = array(0=>'hp_none',1=>1); - $lh[1] = floor((0+$sn['hpNow'])/(0+$sn['hpAll'])*120); - if($lh[1]>0){ $lh[0] = 'hp_1'; } - if($lh[1]>32){ $lh[0] = 'hp_2'; } - if($lh[1]>65){ $lh[0] = 'hp_3'; } - if($sn['mpAll']>0) - { - // - $lm = array(0=>'hp_none',1=>1); - $lm[1] = floor($sn['mpNow']/$sn['mpAll']*120); - if($lm[1]>0){ $lm[0] = 'hp_mp'; } - $hpmp .='
'.floor($sn['mpNow']).'/'.(0+$sn['mpAll']).'
-
-
-
'; - }else{ - $hptop = 5; - } - $hpmp = '
'.floor($sn['hpNow']).'/'.(0+$sn['hpAll']).'
-
-
-
'.$hpmp; - // - $hpmp = '
'.$hpmp.'
'; - }elseif( $type_info == 2 ) { - $hptop = 0; - $lh = array(0=>'hp_none',1=>1); - $lh[1] = floor((0+$sn['hpNow'])/(0+$sn['hpAll'])*200); - if($lh[1]>0){ $lh[0] = 'hp_1'; } - if($lh[1]>32){ $lh[0] = 'hp_2'; } - if($lh[1]>65){ $lh[0] = 'hp_3'; } - if($sn['mpAll']>0) - { - - // - $lm = array(0=>'hp_none',1=>1); - $lm[1] = floor($sn['mpNow']/$sn['mpAll']*200); - if($lm[1]>0){ $lm[0] = 'hp_mp'; } - $hpmp .='
'.floor($sn['mpNow']).'/'.(0+$sn['mpAll']).'
-
-
-
'; - }else{ - $hptop = 5; - } - $hpmp = '
'.floor($sn['hpNow']).'/'.(0+$sn['hpAll']).'
-
-
-
'.$hpmp; - // - $hpmp = '
'.$hpmp.'
'; - } - - $lgn = ''.$u['login'].' ['.$u['level'].']'; - if($u['clan']!=0) - { - $pc = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`name_mini`,`align`,`type_m`,`money1`,`exp` FROM `clan` WHERE `id`="'.$u['clan'].'" LIMIT 1')); - $pc['img'] = $pc['name_mini'].'.gif'; - $lgn = ''.$lgn; - } - if($u['align2']>0) - { - $lgn = ''.$lgn; - } - if($u['align']>0) - { - $lgn = ''.$lgn; - } - $pb = ''; - if($u['banned']>0) - { - $pb .= '
'; - } - if($u['allLock'] > time()) { - $pb .= '
!
'; - } - - $swm = 0; // - $l = 40; - while($l<=52) - { - if(isset($witm[$l])) - { - $swm++; - }else{ - $witm[$l] = ''; - } - $l++; - } - - $ssm = 0; // - $l = 59; - while($l<=62) - { - if(isset($witm[$l])) - { - $ssm++; - }else{ - $witm[$l] = ''; - } - $l++; - } - - $witmg = ''; - - if($ssm>0 && $i1==0) - { - $witmg .= ' - - - - - - -
'.$witm[59].''.$witm[60].''.$witm[61].''.$witm[62].'
'; - } - - if($swm>0 && $i1==0) - { - $witmg .= ' - - - - - - - - - - - - - - - - - -
'.$witm[40].''.$witm[41].''.$witm[42].''.$witm[43].''.$witm[44].''.$witm[50].'
'.$witm[45].''.$witm[46].''.$witm[47].''.$witm[48].''.$witm[49].''.$witm[51].'
'; - } - $zag = ''; - if($u['zag']!='' && $i1 == 1) { - $rt[0] .= ''; - - $zag = ''; -/* - $witmn[1] = ''; - $witmn[2] = ''; - $witmn[3] = ''; - $witmn[4] = ''; - $witmn[7] = ''; - $witmn[8] = ''; - $witmn[9] = ''; - $witmn[10] = ''; - $witmn[11] = ''; - $witmn[12] = ''; - $witmn[13] = ''; - $witmn[14] = ''; - $witmn[16] = ''; - $witmn[17] = ''; -*/ - $j2 = 0; - while($j2 <= 17) { - $witm[$j2] = '
'.$witm[$j2].'
'; - $j2++; - } - - $eff = $eff; - - } - //
- if( $type_info == 1 ) { - if( $pb != '' ) { - $pb = '
'.$pb.'
'; - } - $rt[0] .= '
'.$lgn.'
'.$pb.' -
- - - - - - -
- - - - - - - - - - - - - - - - -
'.$zag.''.$witm[1].'
'.$witm[2].'
'.$witm[3].'
'.$witm[4].'
'.$witm[7].'
-
- - - - - - - - - - -
- - '.$hpmp.' - -
'; - if($zag == ''){ - if($i1 == 0) { - if(!isset($_GET['inv'])) { - $invg = array(0=>'main.php?inv=1',1=>''); - }else{ - $invg = array(0=>'main.php?skills=1',1=>''); - } - }else{ - $o = mysql_fetch_array(mysql_query('SELECT `id` FROM `obraz` WHERE `img` = "'.mysql_real_escape_string($this->info['obraz']).'" AND `sex` = "'.$this->info['sex'].'" LIMIT 1')); - $invg = array(0=>'https://new-combats.com/shadow/'.$o['id'].'" target="_blank',1=>' '); - } - $uobr = 'i/obraz/'.$u['sex'].'/'.$u['obraz'].''; - if(isset($sn['items_img'][1])) { - $uobr = 'rimg/r'.$sn['items_img'][1]; - } - $rt[0] .= '
- -
-
'.$eff.'
'.$anml.' -
'; - }else{ - if($i1 == 0) { - if(!isset($_GET['inv'])) { - $invg = array(0=>'main.php?inv=1',1=>''); - }else{ - $invg = array(0=>'main.php?skills=1',1=>''); - } - }else{ - $invg = array(0=>'https://lib.new-combats.com/obraz.php?namez='.$u['zag'].'" target="_blank',1=>' '); - } - $rt[0] .= '
- -
-
'.$eff.'
'.$anml.' -
'; - } - - unset($invg); - - $rt[0] .= '
'.$msl.'
-
- - - - - - - - - - - - - - - - - - - - - - -
'.$witm[8].'
'.$witm[9].'
- - - - - -
'.$witm[10].''.$witm[11].''.$witm[12].'
'.$witm[13].'
'.$witm[14].'
'.$witm[16].'
'.$witm[17].'
-
'.$witmg.'
'; - }elseif($type_info == 2) { - $rt[0] .= '
'.$lgn.'
-
-
'.$pb.'
-
- - '.$hpmp.' - -
- - - - - - -
- - - - - - - - - - - - - - - - -
'.$zag.''.$witm[8].'
'.$witm[9].'
'.$witm[3].'
'.$witm[4].'
- - - - - -
'.$witm[10].''.$witm[11].''.$witm[12].'
-
- - - - -
'; - if($zag == ''){ - if($i1 == 0) { - if(!isset($_GET['inv'])) { - $invg = array(0=>'main.php?inv=1',1=>''); - }else{ - $invg = array(0=>'main.php?skills=1',1=>''); - } - }else{ - $invg = array(0=>'https://lib.new-combats.com/obraz.php?name='.$u['obraz'].'" target="_blank',1=>' '); - } - $u['obraz'] = '0.gif'; - $uobr = 'i/obraz/'.$u['sex'].'/old/'.$u['obraz'].''; - if(isset($sn['items_img'][1])) { - $uobr = 'rimg/r'.$sn['items_img'][1]; - } - $rt[0] .= '
- -
-
'.$eff.'
'.$anml.' -
';} - - unset($invg); - - $rt[0] .= '
-
- - - - - - - - - - - - - -
'.$witm[1].'
'.$witm[13].'
'.$witm[14].'
'.$witm[17].'
-
'.$witmg.'
'; - } - - if($i1==0 && $u['battle']==0) - { - $rt[0] .= ''; - } - if($ivv==0 && $i1==0) - { - $rt[0] .= $this->info_remont(); - } - } - return $rt; - } - - public function endEffect($id,$u,$test) - { - if($test == false) { - $test = 0; - } - - $e = mysql_fetch_array(mysql_query('SELECT - `eu`.`id`,`eu`.`tr_life_user`,`eu`.`id_eff`,`eu`.`uid`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace`, - `em`.`id2`,`em`.`mname`,`em`.`type1`,`em`.`img`,`em`.`mdata`,`em`.`actionTime`,`em`.`type2`,`em`.`type3`,`em`.`onlyOne`,`em`.`oneType`,`em`.`noAce`,`em`.`see`,`em`.`info`,`em`.`overch`,`em`.`bp`,`em`.`noch` - FROM `eff_users` AS `eu` LEFT JOIN `eff_main` AS `em` ON (`eu`.`id_eff` = `em`.`id2`) WHERE `eu`.`id`="'.mysql_real_escape_string($id).'" AND `delete`="0" AND `deactiveTime` < "'.time().'"')); - - if(isset($e['id'])) - { - $sleep = $this->testAction('`vars` = "sleep" AND `uid` = "'.$e['uid'].'" LIMIT 1', 1); - if( $e['id_eff'] == 2 ) { - // - $ev = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_main` WHERE `name` = "'.mysql_real_escape_string(str_replace(': ','',$e['name'])).'" LIMIT 1')); - $et = mysql_fetch_array(mysql_query('SELECT `id` FROM `actions` WHERE `uid` = "'.$e['uid'].'" AND `vars` LIKE "%read%" AND `vals` = "'.$ev['id'].'" LIMIT 1')); - if(isset($et['id'])) { - if( $et['time'] < time() ) { - $et = false; - }else{ - $et = true; - } - }else{ - $et = false; - } - }else{ - $et = false; - } - if($et == false && $e['sleeptime'] == 0 && $sleep['vars'] != 'sleep') { - $upd = mysql_query('UPDATE `eff_users` SET `delete`="'.time().'" WHERE `id` = "'.$e['id'].'" LIMIT 1'); - if($upd) - { - $po = $this->lookStats($e['data']); - if(isset($po['finish_file'])) - { - if(file_exists('_incl_data/class/magic/'.$po['finish_file'].'.php')) - { - require('_incl_data/class/magic/'.$po['finish_file'].'.php'); - - }else{ - $this->error2 = '!File not exists "cgi-bin/magic.pl?use_'.$po['finish_file'].'".'; - } - } - if(isset($u['id']) && ($e['type1']<11 || ($e['type1']>16 && $e['type1']<23)) && $e['noch']==0) - { - $text = ' "'.$e['name'].'"'; - mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`new`) VALUES ('".$u['city']."','".$u['room']."','','".$u['login']."','".$text."','-1','6','0',1)"); - if($u['battle']>0) { - $lastHOD = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type` FROM `battle_logs` WHERE `battle` = "'.$u['battle'].'" ORDER BY `id_hod` DESC LIMIT 1')); - if(isset($lastHOD['id'])) - { - $id_hod = $lastHOD['id_hod']; - if($lastHOD['type']!=6) - { - $id_hod++; - } - mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$u['battle'].'","'.($id_hod).'","{tm1} '.$text.' {u1}.","login1='.$u['login'].'||t1='.$u['team'].'||time1='.time().'","","","","","6")'); - } - } - } - return 1; - }else{ - return 0; - } - }else{ - return 0; - } - }else{ - return 0; - } - } - - public function snatItem($id,$uid) - { - if($uid!=0) - { - $au = 'AND `iu`.`uid`="'.mysql_real_escape_string($uid).'"'; - }else{ - $au = ''; - } - $itm = mysql_fetch_array($cl = mysql_query('SELECT - `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, - `iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` - FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id`="'.mysql_real_escape_string($id).'" AND `iu`.`inOdet`!="0" '.$au.' AND `iu`.`delete`="0" LIMIT 1 FOR UPDATE')); - if(isset($itm['id'])) - { - - $upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`inOdet`="0" WHERE `id`="'.$itm['id'].'" LIMIT 1'); - if($upd) - { - if(isset($_GET['remitem']) || isset($_GET['sid'])) { - $this->info['autospell'] = 1; - mysql_query('UPDATE `users` SET `autospell` = "1" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - return 1; - }else{ - return 0; - } - }else{ - return 0; - } - } - - public function snatItemAll($uid) - { - $upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`inOdet`="0" WHERE `uid`="'.$uid.'" AND `inOdet`!="0" AND `delete`="0" LIMIT 100'); - if($upd) - { - return 1; - }else{ - return 0; - } - } - - public function impStats($m) - { - $i = 0; - $k = array_keys($m); - $d = ''; - while($i<=count($k)) - { - if($k[$i]!='') - { - $d .= $k[$i].'='.$m[$k[$i]].'|'; - } - $i++; - } - $d = rtrim($d,'|'); - return $d; - } - - public function odetItem($id, $uid) { - if($uid != 0) { - $au = 'AND `iu`.`uid` = "'.mysql_real_escape_string($uid).'"'; - } else { - $au = ''; - } - - $itm = mysql_fetch_array(mysql_query('SELECT - `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, - `iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` - FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id`="'.mysql_real_escape_string($id).'" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" '.$au.' AND `iu`.`delete`="0" LIMIT 1')); - if(isset($itm['id'])) { - if($itm['group'] == 1) { - if($this->itemsX($itm['id']) > 1) { - $this->unstack($itm['id'],1); - /*$itm = mysql_fetch_array(mysql_query('SELECT - `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, - `iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` - FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`inOdet`="0" AND `iu`.`inShop`="0" '.$au.' AND `iu`.`delete`="1000" AND `iu`.`inGroup` = "'.$itm['id'].'" LIMIT 1')); - if(!isset($itm['id'])) { - $this->error = ' ...'; - $notr++; - } else { - $itm['delete'] = 0; - }*/ - } - } - - - $tr = $this->lookStats($itm['data']); - $notr = $this->trItem($tr); - $msb = ''; - if(isset($tr['maks_itm_one']) && $tr['maks_itm_one']>0) { - $test = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "'.$this->info['id'].'" AND `inOdet` > 0 AND `delete` = 0 AND `data` LIKE "%maks_itm_one='.$tr['maks_itm_one'].'%" LIMIT 1')); - if(isset($test['id'])) { - $this->error = ' !'; - $notr++; - } - } - if($this->info['twink']>0) { - // 100 . - if( $itm['price2'] > 100 || $itm['2price'] > 100 ) { - $notr++; - } - // + - if( isset($tr['rune']) && $tr['rune'] > 0 ) { - $notr++; - } - if( isset($tr['spell_id']) && $tr['spell_id'] > 0 ) { - $notr++; - } - } - if(isset($tr['vip_sale'])) { - if($this->stats['silver'] < 2) { - $notr++; - } - } - if(isset($tr['sudba'])) { - if($tr['sudba'] != '0' && $tr['sudba'] != $this->info['login']) { - $notr++; - } elseif($tr['sudba'] == '0'){ - $tr['sudba'] = $this->info['login']; - $itm['data'] = $this->impStats($tr); - $msb = ',`data`="'.$itm['data'].'"'; - } - } - if(isset($tr['tr_align_bs']) && $this->info['inTurnir'] > 0) { - if($tr['tr_align_bs'] == '1') { - if($this->info['align_real'] <= 1 || $this->info['align_real'] >= 2) { $notr++; } else { $notr = 0; } - } else { - if($this->info['align_real'] <= 3 || $this->info['align_real'] >= 4) { $notr++; } else { $notr = 0; } - } - } - if($notr > 0) { - // - if(isset($tr['open']) && isset($_GET['open'])) { - $this->error = ' '; - } else { - $this->error = ' '; - } - return 0; - }elseif(isset($tr['open']) && isset($_GET['open']) && isset($tr['items_in_file'])) - { - $io = ''; - if($itm['inGroup'] > 0) { - mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'",`inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - } - if(file_exists('_incl_data/class/magic/'.$tr['items_in_file'].'.php')){ - require('_incl_data/class/magic/'.$tr['items_in_file'].'.php'); - if(!isset($no_open_itm)) { - $this->deleteItem($itm['id'],$this->info['id']); - $this->error = ' "'.$itm['name'].'":
'.$io.'...'; - }else{ - unset($no_open_itm); - } - }else{ - $this->error = ' "'.$itm['name'].'" ...'; - } - }elseif(isset($tr['open']) && isset($_GET['open'])) - { - // - $io = ''; - $i = 0; - $itms = explode(',',$tr['items_in']); - - - if($itm['type']==37) { - // - $io = ''; - $itmin = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `id` = "'.$tr['item_inbox'].'" LIMIT 1')); - $itmmn = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$itmin['item_id'].'" LIMIT 1')); - // - if($itm['gift'] == '' || $itm['gift'] == '0') { - $this->error = ' , !'; - }elseif(!isset($itmin['id'])) { - $this->error = ' , - ...'; - }else{ - $io .= $itmmn['name']; - if($itmin['item_id'] == 4867) { - // - $this->deleteItem($itm['id'],$this->info['id']); - $this->deleteItem($itmin['id'],$this->info['id']); - $this->error = ' . .'; - }elseif($itmin['item_id'] == 4868) { - // - mysql_query('UPDATE `stats` SET `hpNow` = 1,`mpNow` = 1 WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - $this->deleteItem($itm['id'],$this->info['id']); - $this->deleteItem($itmin['id'],$this->info['id']); - $this->error = ' HP...'; - }elseif($itmin['item_id'] == 4870) { - // - if( $this->info['molch1'] > time() ) { - $this->info['molch1'] += 3600; - }else{ - $this->info['molch1'] = time()+3600; - } - mysql_query('UPDATE `users` SET `molch1` = "'.$this->info['molch1'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - $this->deleteItem($itm['id'],$this->info['id']); - $this->deleteItem($itmin['id'],$this->info['id']); - $this->error = ' ...'; - }elseif($itmin['item_id'] == 4873) { - // - $a = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$this->info['animal'].'" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1')); - $this->deleteItem($itm['id'],$this->info['id']); - $this->deleteItem($itmin['id'],$this->info['id']); - if(isset($a['id'])) { - $this->error = ' "'.$a['name'].'" ...'; - mysql_query('UPDATE `users_animal` SET `eda` = 0, `yad` = "'.(time()+86400*7).'" WHERE `id` = "'.$a['id'].'" LIMIT 1'); - }else{ - $this->error = '- , :)'; - } - }elseif($itmin['item_id'] == 4869) { - // ( 1 ) - $this->deleteItem($itm['id'],$this->info['id']); - $this->deleteItem($itmin['id'],$this->info['id']); - mysql_query('INSERT INTO `eff_users` - (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES ( - "0","'.(time()+3600).'","-1", - " ","add_s'.rand(1,3).'=-'.rand(5,15).'","'.$this->info['id'].'", - "4", "bad_present_travma1.gif","0", "1" - )'); - $this->error = ' . ...'; - }elseif($itmin['item_id'] == 4872) { - // ( 1 ) - $this->deleteItem($itm['id'],$this->info['id']); - $this->deleteItem($itmin['id'],$this->info['id']); - mysql_query('INSERT INTO `eff_users` - (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES ( - "0","'.(time()+3600).'","-1", - " ","add_s'.rand(1,3).'=-'.rand(16,25).'","'.$this->info['id'].'", - "4", "bad_present_travma2.gif","0", "2" - )'); - $this->error = ' . ...'; - }elseif($itmin['item_id'] == 4876) { - // ( 1 ) - $this->deleteItem($itm['id'],$this->info['id']); - $this->deleteItem($itmin['id'],$this->info['id']); - mysql_query('INSERT INTO `eff_users` - (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES ( - "0","'.(time()+3600).'","-1", - " ","add_s'.rand(1,3).'=-'.rand(26,35).'","'.$this->info['id'].'", - "4", "bad_present_travma3.gif","0", "3" - )'); - $this->error = ' . ...'; - }elseif($itmin['item_id'] == 4878) { - // (add_puti=7200) - $this->deleteItem($itm['id'],$this->info['id']); - $this->deleteItem($itmin['id'],$this->info['id']); - mysql_query('INSERT INTO `eff_users` - (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES ( - "0","'.(time()+7200).'","-1", - "","add_puti=1","'.$this->info['id'].'", - "4", "bad_present_chains.gif","0", "3" - )'); - $this->error = ' ...'; - }elseif($itmin['item_id'] == 4874) { - // - $this->deleteItem($itm['id'],$this->info['id']); - $this->deleteItem($itmin['id'],$this->info['id']); - mysql_query('INSERT INTO `eff_users` - (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES ( - "0","'.(time()+3600).'","-1", - " ","add_s5=-50","'.$this->info['id'].'", - "4", "bad_present_dmage.gif","0", "3" - )'); - $this->error = ' ...'; - }elseif($itmin['item_id'] == 4871) { - // - $this->deleteItem($itm['id'],$this->info['id']); - $this->deleteItem($itmin['id'],$this->info['id']); - mysql_query('INSERT INTO `eff_users` - (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES ( - "0","'.(time()+3600).'","-1", - " ","add_s1=-50","'.$this->info['id'].'", - "4", "bad_present_dfighter.gif","0", "3" - )'); - $this->error = ' ...'; - }elseif(mysql_query('UPDATE `items_users` SET `uid` = "'.$this->info['id'].'",`lastUPD` = "'.time().'",`gift` = "'.$itm['gift'].'",`gtxt1` = "'.$itm['gtxt1'].'",`gtxt2` = " . : '.date('d.m.Y H:i:s',$itmin['time_create']).'" WHERE `id` = "'.$itmin['id'].'" LIMIT 1')) { - // - $this->deleteItem($itm['id'],$this->info['id']); - $this->error = ' "'.$itm['name'].'", :
'.$io.'...'; - }else{ - $this->error = ' , ?'; - } - // - } - // - }else{ - - while($iaddItem($s['id'],$this->info['id']); - if($pid>0) - { - mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'",`gift` = "'.$itm['gift'].'" WHERE `id` = "'.$pid.'" AND `uid` = "'.$this->info['id'].'" LIMIT 1'); - } - $j++; - } - $io .= ''.$s['name'].' (x'.$x.'), '; - } - } - $i++; - } - if($itm['inGroup'] > 0) { - mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'",`inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - } - $this->deleteItem($itm['id'],$this->info['id']); - $this->error = ' "'.$itm['name'].'", :
'.$io.'...'; - } - }else{ - $inSlot = $itm['inslot']; - $s = mysql_query('SELECT `iu`.`id`,`iu`.`inOdet` FROM `items_users` AS `iu` WHERE `iu`.`inOdet`!="0" AND `iu`.`uid`="'.$uid.'" AND `iu`.`delete`="0"'); - $d = array(); - while($p = mysql_fetch_array($s)) - { - $d[$p['inOdet']] = $p['id']; - } - - // - if($itm['2too']==1 && $inSlot==3 && isset($d[3])) - { - $inSlot = 14; - } - - if($inSlot==3 || $inSlot==14) - { - // - - if($this->stats['items'][$this->stats['wp3id']]['2h']==1 || $this->stats['items'][$this->stats['wp14id']]['2h']==1 || $itm['2h']==1) - { - $this->snatItem($this->stats['items'][$this->stats['wp3id']]['id'],$uid); - $this->snatItem($this->stats['items'][$this->stats['wp14id']]['id'],$uid); - } - } - - if(isset($d[$inSlot])) - { - if($inSlot==10) - { - if(!isset($d[12])) - { - $inSlot = 12; - }elseif(!isset($d[11])) - { - $inSlot = 11; - } - }elseif($inSlot==40) - { - $i = 40; - while($i<=51) - { - if(!isset($d[$i])) - { - $inSlot = $i; - $i = 52; - }elseif($i==50) - { - $inSlot = 50; - } - $i++; - } - }elseif($inSlot==53) - { - if(!isset($d[53])) - { - $inSlot = 53; - }elseif(!isset($d[54])) - { - $inSlot = 54; - } - }elseif($inSlot==56) - { - if(!isset($d[56])) - { - $inSlot = 56; - }elseif(!isset($d[57])) - { - $inSlot = 57; - }elseif(!isset($d[58])) - { - $inSlot = 58; - }else{ - $inSlot = 58; - } - }elseif($inSlot==59) - { - if(!isset($d[59])) - { - $inSlot = 59; - }elseif(!isset($d[60])) - { - $inSlot = 60; - }elseif(!isset($d[61])) - { - $inSlot = 61; - }elseif(!isset($d[62])) - { - $inSlot = 62; - } - } - } - if(isset($d[$inSlot])) - { - $this->snatItem($d[$inSlot],$uid); - } - - - - - - $upd = mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `inOdet` = "'.$inSlot.'"'.$msb.' WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - if($itm['inGroup'] > 0) { - mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `inGroup` = 0, `delete` = 0 WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - } - if($upd) { - // - //if($itm['']) - //{ - // - //} - $this->info['autospell'] = 1; - mysql_query('UPDATE `users` SET `autospell` = "1" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - return 1; - } else { - $this->error = '(!) '; - return 0; - } - } - }else{ - $this->error = ' '; - return 0; - } - } - - public function deleteItem($id,$uid,$coldel = 0) - { - if($uid!=0) - { - $au = 'AND `iu`.`uid`="'.mysql_real_escape_string($uid).'"'; - }else{ - $au = ''; - } - $itm = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* - FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id`="'.mysql_real_escape_string($id).'" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" '.$au.' AND (`iu`.`delete`="0" OR `iu`.`delete`="1000") LIMIT 1')); - if(isset($itm['id'])) - { - - if( $coldel == 0 ) { - // - $upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `id`="'.$itm['id'].'" LIMIT 1'); - $col = $this->itemsX($itm['id']); - if($col > 0) { - mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'",`inGroup` = "0" WHERE `inGroup`="'.$itm['id'].'" LIMIT '.$col); - } - }else{ - // - - $col = $this->itemsX($itm['id']); - if( $col > 1 ) { - if( $col <= $coldel ) { - $upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `id`="'.$itm['id'].'" LIMIT 1'); - } - $upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'",`inGroup` = "0" WHERE `inGroup`="'.$itm['id'].'" AND `delete` = "1000" LIMIT '.$coldel); - }else{ - // - $upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `id`="'.$itm['id'].'" LIMIT 1'); - $upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'",`inGroup` = "0" WHERE `inGroup`="'.$itm['id'].'" AND `delete` = "1000" LIMIT '.$col); - } - } - if($upd) - { - if(isset($_GET['deleteall7'])) { - $st = $this->lookStats($itm['data']); - $whr = ''; - if(isset($st['frompisher'])) { - $whr .= 'AND `data` LIKE "%frompisher='.$st['frompisher'].'%"'; - } - $col = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `item_id`="'.$itm['item_id'].'" AND `inOdet` = 0 AND `delete` < 100000 AND `uid` = "'.$itm['uid'].'" AND `data` NOT LIKE "%nodelete%"'.$whr)); - $col = $col[0]; - mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `item_id`="'.$itm['item_id'].'" AND `inOdet` = 0 AND `delete` < 100000 AND `uid` = "'.$itm['uid'].'" AND `data` NOT LIKE "%nodelete%"'.$whr); - $this->error = ' "'.$itm['name'].' (x'.($col+1).')" '; - $this->addDelo(1,$uid,'"System.inventory": "'.$itm['name'].' (x'.$col.')" [itm:'.$itm['id'].'='.time().'] .',time(),$this->info['city'],'System.inventory',0,0); - }else{ - $this->error = ' "'.$itm['name'].'" '; - $this->addDelo(1,$uid,'"System.inventory": "'.$itm['name'].'" [itm:'.$itm['id'].'] .',time(),$this->info['city'],'System.inventory',0,0); - } - return 1; - }else{ - return 0; - } - }else{ - $this->error = ' '; - } - } - - public function return_btn() - { - return false; - } - - public function get_battle_cache($uid,$battle) { - $r = false; - if( $uid > 0 && $battle > 0 ) { - $r = mysql_fetch_array(mysql_query('SELECT * FROM `battle_cache` WHERE `battle` = "'.mysql_real_escape_string($battle).'" AND `uid` = "'.mysql_real_escape_string($uid).'" ORDER BY `id` DESC LIMIT 1')); - if( !isset($r['id']) ) { - $r = false; - }else{ - $r = json_decode($r['data'],true); - } - } - return $r; - } - - public function clear_battle_cache($uid) { - mysql_query('DELETE FROM `battle_cache` WHERE `uid` = "'.mysql_real_escape_string($uid).'"'); - } - - public function getStats($uid,$i1,$res = 0,$reimg = false,$btl_cache = false,$minimal = false) - { - global $c; - if(count($uid)>1) - { - $u = $uid; - }elseif($uid!=$this->info['id'] || $res==1) - { - if( $minimal == true ) { - $u = mysql_fetch_array(mysql_query('SELECT `u`.`twink`,`u`.`swin`,`u`.`slose`,`u`.`stopexp`,`u`.`battle`,`u`.`id`,`u`.`no_ip`,`u`.`level`,`u`.`login`,`u`.`clan`, - `st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity` - FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($uid).'" OR `u`.`login`="'.mysql_real_escape_string($uid).'" LIMIT 1')); - }else{ - $u = mysql_fetch_array(mysql_query('SELECT `u`.`twink`,`u`.`swin`,`u`.`slose`,`u`.`stopexp`,`u`.`battle`,`u`.`id`,`u`.`no_ip`,`u`.`level`,`u`.`login`,`u`.`clan`, - `st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity` - FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($uid).'" OR `u`.`login`="'.mysql_real_escape_string($uid).'" LIMIT 1')); - } - }else{ - $u = $this->info; - } - - /*if( $btl_cache == true ) { - $cache = $this->get_battle_cache( $u['id'],$u['battle'] ); - if( $cache == false ) { - unset($cache); - }else{ - $cache['st'] = $u + $cache['st']; - } - }*/ - - /*if( $u['battle'] > 0 ) { - $cache_items = $this->get_battle_cache( $u['id'],$u['battle'] ); - if( $cache_items == false ) { - unset($cache_items); - }else{ - $cache_items['st']['hpNow'] = $u['hpNow']; - $cache_items['st']['mpNow'] = $u['mpNow']; - } - }*/ - - if(isset($u['id'],$u['stats']) && !isset($cache)) - { - $st = array(); - $s_vi = array(); - $s_v = array(); - $u['clanpos'] = 0; - if( $u['clan'] > 0 ) { - $r1 = mysql_fetch_array(mysql_query('SELECT `pos` FROM `aaa_clan_reting_list` WHERE `clan` = "'.$u['clan'].'" AND `date` = "'.date('dmY').'" LIMIT 1')); - if(isset($r1['pos'])) { - $st['clanpos'] = $r1['pos']; - } - unset($r1); - } - - if(!isset($cache_items)) { - // - //$st = new SplFixedArray(1024000); - // - $lvl = mysql_fetch_array(mysql_query('SELECT `bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel` = "'.$u['upLevel'].'" LIMIT 1')); - if(isset($lvl['upLevel'])) - { - $st['levels'] = $lvl; - }else{ - $st['levels'] = 'undefined'; - } - $st2 = array(); - $st['id'] = $u['id']; - $st['login'] = $u['login']; - $st['lvl'] = $u['level']; - $st['hpNow'] = $u['hpNow']; - $st['hpAll'] = 0; - $st['mpNow'] = $u['mpNow']; - $st['mpAll'] = 0; - $st['zona'] = 1; - $st['zonb'] = 2; - $st['items'] = array(); - $st['effects'] = array(); - $st['reting'] = 0; - $st['irka'] = 0; - $sts = explode('|',$u['stats']); - $i = 0; $ste = ''; - // - while($i 0) { - mysql_query('UPDATE `stats` SET - `tactic1` = 25, - `tactic2` = 25, - `tactic3` = 25, - `tactic4` = 25, - `tactic5` = 25, - `tactic6` = 25, - `tactic7` = 25, - `priems_z` = "0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|" - WHERE `id` = "'.$u['id'].'" LIMIT 1 - '); - } - - // - if($this->info['id'] == $u['id'] || $reimg != false) { - $sp_img = mysql_query('SELECT * FROM `items_img` WHERE `uid` = "'.$u['id'].'" AND `img_id` != "0" LIMIT 16'); - while($pl_img = mysql_fetch_array($sp_img)) { - $pl_img_r = mysql_fetch_array(mysql_query('SELECT * FROM `reimage` WHERE ((`uid` = "'.$u['id'].'" AND `clan` = "0") OR (`clan` = "'.$u['clan'].'" AND '.$u['clan'].' > 0)) AND `good` > 0 AND `bad` = "0" AND `id` = "'.$pl_img['img_id'].'" LIMIT 1')); - if(isset($pl_img_r['id'])) { - $st['items_img'][$pl_img['type']] = $pl_img_r['id'].'.'.$pl_img_r['format']; - }else{ - mysql_query('UPDATE `items_img` SET `img_id` = "0" WHERE `id` = "'.$pl_img['id'].'" LIMIT 1'); - } - } - } - - // - $cl = mysql_query('SELECT - `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`, - `iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` - FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`inOdet`!="0" AND `iu`.`uid`="'.$u['id'].'" AND `iu`.`delete`="0" LIMIT 250'); - $ia = $this->items['add']; - $h = 0; - $hnd1 = 0; - $hnd2 = 0; - $sht1 = 0; - $reitm = array(); - $coms = array(); // - $dom = array(); - $btl_cof = 0; - $oza = array( - 1=>array(0,0), - 2=>array(0,0), - 3=>array(0,0), - 4=>array(0,0) - ); // - $ozm = array( - 1=>array(0,0), - 2=>array(0,0), - 3=>array(0,0), - 4=>array(0,0) - ); // - - $itmslvl = 0; - $itmsCfc = 0; - $st['reting'] = 0; - while($pl = mysql_fetch_array($cl)) - { - if($pl['inOdet'] <= 18 && $pl['inOdet'] > 0 ) { - if( $pl['1price'] > 0 ) { - $st['irka'] += $pl['1price']; - }else{ - $st['irka'] += $pl['price1']; - } - } - /* */ - //$dom[count($dom)] = array($pl['inOdet'],$pl['class'],$pl['class_point'],$pl['anti_class'],$pl['anti_class_point'],$pl['level'],$u['level'],$pl['price2']); - - - if($pl['inOdet'] <= 18 && $pl['inOdet'] > 0 ) { - /*if( $pl['2price'] > 0 ) { - $st['reting'] += $pl['2price']*12.5; - }elseif( $pl['price2'] > 0 ) { - $st['reting'] += $pl['price2']*12.5; - }elseif( $pl['1price'] > 0 ) { - $st['reting'] += $pl['1price']; - }elseif( $pl['price1'] > 0 ) { - $st['reting'] += $pl['price1']; - }*/ - } - - - $st['wp'.$pl['inOdet'].'id'] = $h; - - $st['items'][$h] = $pl; $h++; - if($pl['inOdet']==3 && (($pl['type']>=18 && $pl['type']<=24) || $pl['type']==26 || $pl['type']==27 || $pl['type']==28)) - { - $hnd1 = 1; - } - if($pl['inOdet']==14 && (($pl['type']>=18 && $pl['type']<=24) || $pl['type']==26 || $pl['type']==27 || $pl['type']==28)) - { - $hnd2 = 1; - }elseif($pl['inOdet']==14 && $pl['type']==13) - { - $sht1 = 1; - } - $sts = explode('|',$pl['data']); - $i = 0; $ste = ''; $sti = array(); - while($i 0 ) { - - if( $pl['2price'] == 0 && $pl['price2'] == 0 ) { - if( $pl['1price'] > 0 ) { - $st['prckr'] += $pl['1price']; - }else{ - $st['prckr'] += $pl['price1']; - } - } else { - if( $pl['2price'] > 0 ) { - $st['prckr'] += $pl['2price']*200; - $st['preckr'] += $pl['2price']; - }else{ - $st['prckr'] += $pl['price2']*200; - $st['preckr'] += $pl['price2']; - } - } - } - }else{ - if( $pl['inOdet'] < 18 && $pl['inOdet'] > 0 ) { - if( $pl['2price'] == 0 && $pl['price2'] == 0 ) { - if( $pl['1price'] > 0 ) { - //$st['prckr'] += round($pl['1price']/3); - }else{ - //$st['prckr'] += round($pl['price1']/3); - } - } - } - } - - if($pl['inOdet'] <= 18 && $pl['inOdet'] > 0 ) { - - $st['reting'] += 1; - } - - if(isset($sti['add_oza'])) { - - } - - $ko = 1; - while($ko <= 4) { - if(isset($sti['add_oza'.$ko])) { - if(isset($sti['add_oza'])) { - if($sti['add_oza'] == 1) { - // - $oza[$ko][0] += 1; - $oza[$ko][1] += 9; - }elseif($sti['add_oza'] == 2) { - // - $oza[$ko][0] += 20; - $oza[$ko][1] += 39; - }elseif($sti['add_oza'] == 3) { - // - $oza[$ko][0] += 40; - $oza[$ko][1] += 69; - }elseif($sti['add_oza'] == 4) { - // - $oza[$ko][0] += 10; - $oza[$ko][1] += 19; - }elseif($sti['add_oza'] == 5) { - // - $oza[$ko][0] += 70; - $oza[$ko][1] += 89; - } - } - if(isset($sti['add_ozm'])) { - if($sti['add_ozm'] == 1) { - // - $ozm[$ko][0] += 1; - $ozm[$ko][1] += 9; - }elseif($sti['add_ozm'] == 2) { - // - $ozm[$ko][0] += 20; - $ozm[$ko][1] += 39; - }elseif($sti['add_ozm'] == 3) { - // - $ozm[$ko][0] += 40; - $ozm[$ko][1] += 69; - }elseif($sti['add_ozm'] == 4) { - // - $ozm[$ko][0] += 10; - $ozm[$ko][1] += 19; - }elseif($sti['add_ozm'] == 5) { - // - $ozm[$ko][0] += 70; - $ozm[$ko][1] += 89; - } - } - if($sti['add_oza'.$ko] == 1) { - // - $oza[$ko][0] += 1; - $oza[$ko][1] += 9; - }elseif($sti['add_oza'.$ko] == 2) { - // - $oza[$ko][0] += 20; - $oza[$ko][1] += 39; - }elseif($sti['add_oza'.$ko] == 3) { - // - $oza[$ko][0] += 40; - $oza[$ko][1] += 69; - }elseif($sti['add_oza'.$ko] == 4) { - // - $oza[$ko][0] += 10; - $oza[$ko][1] += 19; - }elseif($sti['add_oza'.$ko] == 5) { - // - $oza[$ko][0] += 70; - $oza[$ko][1] += 89; - } - if($sti['add_ozm'.$ko] == 1) { - // - $ozm[$ko][0] += 1; - $ozm[$ko][1] += 9; - }elseif($sti['add_ozm'.$ko] == 2) { - // - $ozm[$ko][0] += 20; - $ozm[$ko][1] += 39; - }elseif($sti['add_ozm'.$ko] == 3) { - // - $ozm[$ko][0] += 40; - $ozm[$ko][1] += 69; - }elseif($sti['add_ozm'.$ko] == 4) { - // - $ozm[$ko][0] += 10; - $ozm[$ko][1] += 19; - }elseif($sti['add_ozm'.$ko] == 5) { - // - $ozm[$ko][0] += 70; - $ozm[$ko][1] += 89; - } - } - $ko++; - } - - //if( $sti['tr_lvl'] == $u['level'] ) { - if( $pl['inOdet'] <= 18 ) { - $itmslvl++; - } - if( $pl['inOdet'] <= 14 ) { - if( $pl['tr_lvl'] == $u['level'] ) { - $itmsCfc += 1; - }else{ - $itmsCfc += ($sti['tr_lvl']/$u['level'])/4; - } - } - //} - - if(isset($sti['art'])) { - if(!isset($st['art'])) { - $st['art'] = 0; - } - $st['art'] += $sti['art']; - } - if(isset($sti['maks_itm'])) { - if(!isset($st['maks_itm'])) { - $st['maks_itm'] = 0; - } - $st['maks_itm'] += $sti['maks_itm']; - } - if(isset($sti['complect'])) - { - $coms[count($coms)]['id'] = $sti['complect']; - if(!isset($coms['com'][$sti['complect']])) - { - $coms['com'][$sti['complect']] = 0; - if(!isset($coms['new'])) { - $coms['new'] = array(); - } - $coms['new'][count($coms['new'])] = $sti['complect']; - } - $coms['com'][$sti['complect']]++; - if($pl['2h'] > 0) { - $coms['com'][$sti['complect']]++; - } - } - if(isset($sti['complect2'])) - { - $coms[count($coms)]['id'] = $sti['complect2']; - if(!isset($coms['com'][$sti['complect2']])) - { - $coms['com'][$sti['complect2']] = 0; - if(!isset($coms['new'])) { - $coms['new'] = array(); - } - $coms['new'][count($coms['new'])] = $sti['complect2']; - } - $coms['com'][$sti['complect2']]++; - if($pl['2h'] > 0) { - $coms['com'][$sti['complect2']]++; - } - } - - if(isset($sti['zonb']) && $sti['zonb']!=0) - { - if(!isset($st['zonb'])) { - $st['zonb'] = 0; - } - $st['zonb'] += $sti['zonb']; - } - - if(isset($sti['zona']) && $sti['zona']!=0) - { - if(!isset($st['zona'])) { - $st['zona'] = 0; - } - $st['zona'] += $sti['zona']; - } - - // - if(!isset($sti['restart_stats'])) - { - $i = 0; - while($i0) - { - $i39 = array(0=>0,1=>0,2=>0); - $i = 0; - while($i "'.time().'" OR `endTime` = 0)'); - while($e = mysql_fetch_array($efs)) - { - $sts = $this->lookStats($e['bonus']); - $i = 0; - while($i 0 ) { - // - $cache_items = array( - 'st' => $st, - 'sti' => $sti, - 's_v' => $s_v, - 's_vi' => $s_vi - ); - $cache_items = json_encode($cache_items); - mysql_query('INSERT INTO `battle_cache` (`uid`,`battle`,`data`,`time`) VALUES ("'.$u['id'].'","'.$u['battle'].'","'.mysql_real_escape_string($cache_items).'","'.time().'")'); - unset($cache_items); - }*/ - }else{ - /*$st = $cache_items['st']; - unset($cache_items['st']); - $sti = $cache_items['sti']; - unset($cache_items['sti']); - $s_v = $cache_items['s_v']; - unset($cache_items['s_v']); - $s_vi = $cache_items['s_vi']; - unset($cache_items);*/ - } - - // - //if( $this->info['id'] != $u['id'] ) { - if( $u['battle'] > 0 ) { - $test_btl_info = mysql_fetch_array(mysql_query('SELECT `id`,`noeff` FROM `battle` WHERE `id` = "'.$u['battle'].'" LIMIT 1')); - $test_noef = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_actions` WHERE `uid` = "'.$u['id'].'" AND `vars` = "noeffectbattle1" AND `btl` = "'.$u['battle'].'" LIMIT 1')); - } - //} - // - $h = 0; - $nbs = array(); - $prsu = array(); - if(!isset($test_noef['id'])) { - $efs = mysql_query('SELECT - `eu`.`id`,`eu`.`id_eff`,`eu`.`tr_life_user`,`eu`.`uid`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace`, - `em`.`id2`,`em`.`mname`,`em`.`type1`,`em`.`img`,`em`.`mdata`,`em`.`actionTime`,`em`.`type2`,`em`.`type3`,`em`.`onlyOne`,`em`.`oneType`,`em`.`noAce`,`em`.`see`,`em`.`info`,`em`.`overch`,`em`.`bp`,`em`.`noch` FROM `eff_users` AS `eu` LEFT JOIN `eff_main` AS `em` ON (`eu`.`id_eff` = `em`.`id2`) WHERE `eu`.`uid`="'.mysql_real_escape_string($u['id']).'" AND `eu`.`delete`="0" AND `eu`.`deactiveTime` < "'.time().'" AND `eu`.`v1`!="priem" ORDER BY `eu`.`id` DESC LIMIT 50'); - while($e = mysql_fetch_array($efs)) - { - if( $u['dnow'] == 0 ) { - if( $u['battle'] == 0 ) { - mysql_query('DELETE FROM `eff_users` WHERE `id_eff` = "'.$e['id_eff'].'" AND `uid` = "'.$u['id'].'" AND `id` != "'.$e['id'].'" ORDER BY `id` ASC'); - // - if($e['v1'] != 'priem') { - if($e['hod'] != -1) { - mysql_query('UPDATE `eff_users` SET `hod` = "-1",`timeUse` = "'.(time()+($e['hod']*$c['effz'])-$e['actionTime']).'" WHERE `id` = "'.$e['id'].'" LIMIT 1'); - } - } - }else{ - if($e['v1'] != 'priem' && $c['effz'] > 0) { - if($e['hod'] == -1) { - $efzz = round(($e['timeUse']+$e['actionTime']+$e['timeAce'])-time()); - if( $efzz > 0 ) { - mysql_query('UPDATE `eff_users` SET `hod` = "'.($efzz/$c['effz']).'" WHERE `id` = "'.$e['id'].'" LIMIT 1'); - } - } - } - } - } - //echo '['.date( 'd.m.Y H:i:s' , time() + round((($e['timeUse']+$e['timeAce']+$e['actionTime'])-time())/$c['effz'])*$c['effz']).']'; - if(true == false && $test_btl_info['noeff']==1 && isset($this->ekrcast[$e['id_eff']])) { - // - }elseif( $e['sleeptime'] != 0 && substr_count($e['v1'],'pgb') > 0 ) { - // - }elseif( ( $e['timeUse']+$e['timeAce']+$e['actionTime']>time() || $e['timeUse']==77 ) ) - { - if($e['v1'] == 'priem') { - $prsu[$e['v2']] = 0+$prsu['x']; - } - $st['effects'][$h] = $e; $h++; - $sts = $this->lookStats($e['data']); - if(isset($sts['itempl']) && $sts['itempl'] > 0) { - $nbs[$sts['itempl']] += 1; - } - if( isset($sts['puti']) ) { - $st['puti'] = $sts['puti']; - } - if( isset($sts['add_silver']) ) { - $st['slvtm'] = $e['timeUse']+$e['actionTime']; - } - $i = 0; - while($iinfo['id'] ) { - if( $e['sleeptime'] == 0 ) { - $this->endEffect($e['id'],$u); - } - $st['act'] = 1; - } - } - } - }else{ - $st['noeffectbattle1'] = 1; - } - - // - //$st['items_img'][$pl_img['type']] = $pl_img_r['id'].'.'.$pl_img_r['format']; - if( $nbs[4899] > 0 ) { - // - $st['items_img'][8] = 'robe_illusion4.gif'; - $st['items_img'][11] = 'leg_illusion4.gif'; - }elseif( $nbs[4900] > 0 ) { - // - $st['items_img'][8] = 'robe_illusion5.gif'; - $st['items_img'][11] = 'leg_illusion5.gif'; - }elseif( $nbs[4901] > 0 ) { - // - $st['items_img'][8] = 'robe_illusion3.gif'; - $st['items_img'][11] = 'leg_illusion3.gif'; - }elseif( $nbs[4902] > 0 ) { - // - $st['items_img'][8] = 'robe_illusion6.gif'; - $st['items_img'][11] = 'leg_illusion6.gif'; - }elseif( $nbs[4903] > 0 ) { - // - $st['items_img'][8] = 'robe_illusion8.gif'; - $st['items_img'][11] = 'leg_illusion8.gif'; - }elseif( $nbs[4904] > 0 ) { - // - $st['items_img'][8] = 'robe_illusion7.gif'; - $st['items_img'][11] = 'leg_illusion7.gif'; - }elseif( $nbs[4905] > 0 ) { - // - $st['items_img'][8] = 'robe_illusion9.gif'; - $st['items_img'][11] = 'leg_illusion9.gif'; - }elseif( $nbs[4908] > 0 ) { - // - $st['items_img'][8] = 'robe_illusion2.gif'; - $st['items_img'][11] = 'leg_illusion2.gif'; - $st['items_img'][10] = 'boots_illusion2.gif'; - $st['items_img'][9] = 'belt_illusion2.gif'; - $st['items_img'][5] = 'naruchi_illusion2.gif'; - $st['items_img'][4] = 'helmet_illusion2.gif'; - $st['items_img'][12] = 'perchi_illusion2.gif'; - }elseif( $nbs[4906] > 0 ) { - // - $st['items_img'][8] = 'robe_illusion1.gif'; - $st['items_img'][11] = 'leg_illusion1.gif'; - $st['items_img'][10] = 'boots_illusion1.gif'; - $st['items_img'][9] = 'belt_illusion1.gif'; - $st['items_img'][5] = 'naruchi_illusion1.gif'; - $st['items_img'][4] = 'helmet_illusion1.gif'; - $st['items_img'][12] = 'perchi_illusion1.gif'; - } - if( $nbs[4909] > 0 ) { - // - $st['items_img'][13] = 'ring_illusion2.gif'; - $st['items_img'][17] = 'ring_illusion2.gif'; - $st['items_img'][18] = 'ring_illusion2.gif'; - $st['items_img'][14] = 'amulet_illusion2.gif'; - $st['items_img'][15] = 'earrings_illusion2.gif'; - }elseif( $nbs[4907] > 0 ) { - // - $st['items_img'][13] = 'ring_illusion1.gif'; - $st['items_img'][17] = 'ring_illusion1.gif'; - $st['items_img'][18] = 'ring_illusion1.gif'; - $st['items_img'][14] = 'amulet_illusion1.gif'; - $st['items_img'][15] = 'earrings_illusion1.gif'; - } - - if( $itmslvl < 5 ) { - // - $st['itmslvl'] = 0; - }else{ - $st['itmslvl'] = 1; - } - // - $st['itmsCfc'] = $itmsCfc; - - unset($test_btl_info); - - if( $u['battle'] > 0 ) { - // - $efs = mysql_query('SELECT `eu`.`id`,`eu`.`id_eff`,`eu`.`uid`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`tr_life_user`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace` FROM `eff_users` AS `eu` WHERE `eu`.`uid`="'.mysql_real_escape_string($u['id']).'" AND `eu`.`delete`="0" AND `eu`.`deactiveTime` < "'.time().'" AND `eu`.`v1` = "priem" ORDER BY `eu`.`id` ASC'); - $st['set_pog'] = array(); - $st['set_pog2'] = array(); - while($e = mysql_fetch_array($efs)) - { - $e['type1'] = 14; - $e['img'] = $e['img2']; - if($e['tr_life_user'] > 0 ) { - $trlu = mysql_fetch_array(mysql_query('SELECT `hpNow` FROM `stats` WHERE `id` = "'.$e['tr_life_user'].'" LIMIT 1')); - if( floor($trlu['hpNow']) < 1 ) { - $this->endEffect($e['id'],$u); - $st['act'] = 1; - } - } - if($e['timeUse']+$e['timeAce']+$e['actionTime']>time() || $e['timeUse']==77) - { - if($e['v1'] == 'priem') { - $prsu[$e['v2']] = 0+$prsu['x']; - } - $st['effects'][$h] = $e; $h++; - $sts = $this->lookStats($e['data']); - if($e['v2'] == 217) { - $st['raztac'] = 1; - } - if(isset($sts['add_pog'])) - { - $ctt = count($st['set_pog']); - $st['set_pog'][$ctt]['id'] = $h; - $st['set_pog'][$ctt]['y'] = $sts['add_pog']; - unset($ctt); - } - if(isset($sts['natoe'])) { - $st['set_natoe']['id'] = $h; - $st['set_natoe']['a'] = 0 + $sts['natoe_end']; - $st['set_natoe']['b'] = 0 + $sts['natoe']; - $st['set_natoe']['eff_id'] = $e['id']; - $st['set_natoe']['t'] = 0 + $sts['natoe_type']; - $st['set_natoe']['user_id'] = $e['tr_life_user']; - } - if(isset($sts['add_pog2'])) - { - $ctt = count($st['set_pog2']); - $st['set_pog2'][$ctt]['id'] = $h; - $st['set_pog2'][$ctt]['y'] = $sts['add_pog2']; - $st['set_pog2'][$ctt]['p'] = $sts['add_pog2p']; - $st['set_pog2'][$ctt]['m'] = $sts['add_pog2mp']; - unset($ctt); - } - $i = 0; - while($iendEffect($e['id'],$u); - $st['act'] = 1; - } - } - } - - // - /*$bl = mysql_fetch_array(mysql_query('SELECT `id`,`level` FROM `users_paybonus` WHERE `id` = "'.$u['id'].'" LIMIT 1')); - $st['pbe'] = 0+$bl['level']; - if( $st['pbe'] > 1000 ) { - $st['pbe'] = 1000; - } - unset($bl);*/ - - // - if( $st['clanpos'] > 0 ) { - if( $st['clanpos'] == 1 ) { - $st['s1'] += 5; - $st['s2'] += 5; - $st['s3'] += 5; - $st['s4'] += 5; - $st['s5'] += 5; - $st['s6'] += 5; - $st['m10'] += 10; - $st['m11'] += 10; - }elseif( $st['clanpos'] == 2 ) { - $st['s1'] += 3; - $st['s2'] += 3; - $st['s3'] += 3; - $st['s4'] += 3; - $st['s5'] += 3; - $st['s6'] += 3; - $st['m10'] += 5; - $st['m11'] += 5; - }elseif( $st['clanpos'] == 3 ) { - $st['s1'] += 1; - $st['s2'] += 1; - $st['s3'] += 1; - $st['s4'] += 1; - $st['s5'] += 1; - $st['s6'] += 1; - $st['m10'] += 3; - $st['m11'] += 3; - } - } - - // - - if(!isset($st['hpAll'])) { - $st['hpAll'] = 0; - } - $st['hpAll'] += $st['s4']*6; - - //$st['enAll'] += 10; - //$st['enAll'] += floor($st['s11']*10); - //$st['enAll'] += round($st['s4']*0.09); - - if(!isset($st['mpAll'])) { - $st['mpAll'] = 0; - } - @$st['mpAll'] += @$st['s6']*10; - - // - if(!isset($st['m1'])) { - $st['m1'] = 0; - } $st['m1'] += $st['s3']*5; - - - // .- = 2.5 - if(!isset($st['m2'])) { - $st['m2'] = 0; - } $st['m2'] += $st['s3']*5; - - // . = 2.5 - if(!isset($st['m4'])) { - $st['m4'] = 0; - } - $st['m4'] += $st['s2']*5; - - // .- = 2.5 - if(!isset($st['m5'])) { - $st['m5'] = 0; - } - $st['m5'] += $st['s2']*5; - - - - if(!isset($st['za'])) { - $st['za'] = 0; - } - $st['za'] += $st['s4']*1.5; - - if(!isset($st['zm'])) { - $st['zm'] = 0; - } - $st['zm'] += $st['s4']*1.5; - - // - // " . ". - if(!isset($st['antm3'])) { - $st['antm3'] = 0; - } - //$st['antm3'] += $st['s4']*1.0; - - - - if(!isset($st['m10'])) { - $st['m10'] = 0; - } - $st['m10'] += 0; - - if(!isset($st['m11'])) { - $st['m11'] = 0; - } - $st['m11'] += 0; - - if(!isset($st['m11a'])) { - $st['m11a'] = 0; - } - $st['m11a'] += 0; - - if(!isset($st['m7'])) { - $st['m7'] = 0; - } - $st['m7'] += 0; - - if(!isset($st['m8'])) { - $st['m8'] = 0; - } - $st['m8'] += 0; - - // - $i = 0; - while($i<=count(@$coms['new'])) - { - if(@isset($coms['new'][$i])) - { - //$coms[$i]['id'] - id , $j - - - $j = @$coms['com'][$coms['new'][$i]]; - $com = mysql_fetch_array(mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.((int)$coms['new'][$i]).'" AND `x` <= '.((int)$j).' ORDER BY `x` DESC LIMIT 1')); - if(isset($com['id'])) - { - // - $ij = 0; - $sti = $this->lookStats($com['data']); - while($ij= 40 AND `inOdet` <= 50 AND `uid` = "'.$u['id'].'" AND `delete` = 0 ORDER BY `item_id` DESC LIMIT 20'); - while($pli = mysql_fetch_array($spi)) { - $splink .= $pli['item_id'].'-'.$pli['inOdet'].','; - } - $splink = rtrim($splink,','); - - // - if( $u['autospell'] == 1 ) { - $u['autospell'] = $splink; - mysql_query('UPDATE `users` SET `autospell` = "'.$splink.'" WHERE `id` = "'.$u['id'].'" LIMIT 1'); - } - - // , - if( $u['autospell'] != $splink ) { - $spe1 = explode(',',$splink); - $spe2 = explode(',',$u['autospell']); - $i = 0; - while( $i <= 20 ) { - // - $spe1a = explode('-',$spe1[$i]); - $spe2a = explode('-',$spe2[$i]); - // - if(isset($spe1a[0])) { - $spe1g[$spe1a[1]] = $spe1a[0]; - } - if(isset($spe2a[0])) { - $spe2g[$spe2a[1]] = $spe2a[0]; - } - // - $i++; - } - $i = 40; - while( $i <= 50 ) { - if( $spe1g[$i] != $spe2g[$i] && $spe1g[$i] == 0 ) { - //echo '['.$spe2g[$i].'->'.$i.']'; - $splu = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "'.$spe2g[$i].'" AND `inOdet` = 0 AND `delete` = 0 AND `inTransfer` = 0 AND `inShop` = 0 AND `uid` = "'.$u['id'].'" AND `inGroup` = 0 LIMIT 1')); - if(isset($splu['id'])) { - mysql_query('UPDATE `items_users` SET `inOdet` = "'.$i.'" WHERE `id` = "'.$splu['id'].'" LIMIT 1'); - } - } - $i++; - } - } - } - - - // - // - // - /*if($st['s1']>24 && $st['s1']<50){ $st['m10'] += 5; } - if($st['s1']>49 && $st['s1']<75){ $st['m10'] += 10; } - if($st['s1']>74 && $st['s1']<100){ $st['m10'] += 17; } - if($st['s1']>99 && $st['s1']<125){ $st['m10'] += 25; } - if($st['s1']>124 && $st['s1']<150){ $st['m10'] += 25; $st['minAtack'] += 10; $st['maxAtack'] += 10; } - if($st['s1']>149 && $st['s1']<175){ $st['m10'] += 30; $st['minAtack'] += 10; $st['maxAtack'] += 10; } - if($st['s1']>174){ $st['m10'] += 30; $st['minAtack'] += 15; $st['maxAtack'] += 15; }*/ - - if($st['s1']>24 && $st['s1']<50){ $st[1]['m2'] += 15; } - if($st['s1']>49 && $st['s1']<75){ $st[1]['pa2'] += 2; $st[1]['m2'] += 35; } - if($st['s1']>74 && $st['s1']<100){ $st[1]['pa2'] += 5; $st[1]['m2'] += 50; } - if($st['s1']>99 && $st['s1']<125){ $st[1]['pa2'] += 8; $st[1]['m2'] += 80;} - if($st['s1']>124 && $st['s1']<150){ $st[1]['pa2'] += 12; $st[1]['m2'] += 105; } - if($st['s1']>149 && $st['s1']<175){ $st[1]['pa2'] += 17; $st[1]['m7'] += 2; } - if($st['s1']>174){ $st[1]['pa2'] += 30; $st[1]['m7'] += 7; } - - // - if($st['s2']>24 && $st['s2']<50){ $st['m7'] += 5; } - if($st['s2']>49 && $st['s2']<75){ $st['m7'] += 5; $st['m4'] += 35; $st['m2'] += 15; } - if($st['s2']>74 && $st['s2']<100){ $st['m7'] += 15; $st['m4'] += 35; $st['m2'] += 15; } - if($st['s2']>99 && $st['s2']<125){ $st['m7'] += 15; $st['m4'] += 105; $st['m2'] += 40; } - if($st['s2']>124 && $st['s2']<150) { $st['m7'] += 15; $st['m4'] += 105; $st['m2'] += 40; $st['m15'] += 5; } - if($st['s2']>149 && $st['s2']<175){ $st['m7'] += 20; $st['m4'] += 115; $st['m2'] += 40; $st['m15'] += 5; } - if($st['s2']>174){ $st['m7'] += 20; $st['m4'] += 120; $st['m2'] += 50; $st['m15'] += 7; } - // - if($st['s3']>24 && $st['s3']<50){ $st['m3'] += 10; } - if($st['s3']>49 && $st['s3']<75){ $st['m3'] += 10; $st['m1'] += 35; $st['m5'] += 15; } - if($st['s3']>74 && $st['s3']<100){ $st['m3'] += 25; $st['m1'] += 35; $st['m5'] += 15; } - if($st['s3']>99 && $st['s3']<125){ $st['m3'] += 25; $st['m1'] += 105; $st['m5'] += 45; } - if($st['s3']>124 && $st['s3']<150){ $st['m3'] += 25; $st['m1'] += 105; $st['m5'] += 45; $st['m14'] += 5; } - if($st['s3']>149 && $st['s3']<175){ $st['m3'] += 30; $st['m1'] += 105; $st['m5'] += 45; $st['m14'] += 5; } - if($st['s3']>174){ $st['m3'] += 30; $st['m1'] += 120; $st['m5'] += 45; $st['m14'] += 7; } - // - if($st['s4']>0){ $st['hpAll'] += 30; } - if($st['s4']>24 && $st['s4']<50){ $st['hpAll'] += 50; } - if($st['s4']>49 && $st['s4']<75){ $st['hpAll'] += 100; } - if($st['s4']>74 && $st['s4']<100){ $st['hpAll'] += 175; } - if($st['s4']>99 && $st['s4']<125){ $st['hpAll'] += 250; } - if($st['s4']>124 && $st['s4']<150){ $st['hpAll'] += 250; $st['za'] += 25; } - if($st['s4']>149 && $st['s4']<175){ $st['hpAll'] += 350; $st['za'] += 50; } - if($st['s4']>174){ $st['hpAll'] += 400; $st['za'] += 100; } - // - if($st['s5']>24 && $st['s5']<50){ $st['m11'] += 5; } - if($st['s5']>49 && $st['s5']<75){ $st['m11'] += 10; } - if($st['s5']>74 && $st['s5']<100){ $st['m11'] += 17; } - if($st['s5']>99 && $st['s5']<125){ $st['m11'] += 25; } - if($st['s5']>124 && $st['s5']<150){ $st['m11'] += 35; } - if($st['s5']>149 && $st['s5']<175){ $st['m11'] += 45; } - if($st['s5']>174){ $st['m11'] += 60; } - // - if($st['s6']>24 && $st['s6']<50){ $st['mpAll'] += 50; $st['speedmp'] +=100; } - if($st['s6']>49 && $st['s6']<75){ $st['mpAll'] += 100; $st['speedmp'] +=200; } - if($st['s6']>74 && $st['s6']<100){ $st['mpAll'] += 175; $st['speedmp'] += 350; } - if($st['s6']>99 && $st['s6']<125){ $st['mpAll'] += 250; $st['speedmp'] += 500; } - if($st['s6']>124 && $st['s6']<150) { $st['mpAll'] += 250; $st['speedmp'] += 500; $st['pzm'] += 3; } - if($st['s6']>149 && $st['s6']<175){ $st['mpAll'] += 300; $st['speedmp'] += 600; $st['pzm'] += 3; } - if($st['s6']>174){ $st['mpAll'] += 450; $st['speedmp'] += 700; $st['pzm'] += 5; } - - // - if($hnd2==1 && $hnd1==1) - { - $st['zona']++; - } - - if($sht1==1) - { - $st['zonb']++; - } - - //$st['speedhp'] += $st['pbe']; - //$st['speedmp'] += $st['pbe']; - - /* */ - $i = 1; - while($i<=7) - { - if(!isset($st['pm'.$i])) { - $st['pm'.$i] = 0; - } - if(!isset($st['a'.$i])) { - $st['a'.$i] = 0; - } - if(!isset($st['mg'.$i])) { - $st['mg'.$i] = 0; - } - if(!isset($st['zm'.$i])) { - $st['zm'.$i] = 0; - } - if(isset($st['s5'])) { $st['pm'.$i] += $st['s5']*0.5; } - if(isset($st['m11a'])) { $st['pm'.$i] += $st['m11a']; } - if(isset($st['aall'])) { $st['a'.$i] += $st['aall']; } - if(isset($st['m2all'])) { $st['mg'.$i] += $st['m2all']; } - if(isset($st['zm'])) { $st['zm'.$i] += $st['zm']; } - if(isset($st['zma'])) { $st['zm'.$i] += $st['zma']; } - if($i<=4) - { - if(!isset($st['mib'.$i])) { - $st['mib'.$i] = 0; - } - if(!isset($st['mab'.$i])) { - $st['mab'.$i] = 0; - } - if(!isset($st['mg'.$i])) { - $st['mg'.$i] = 0; - } - if(!isset($st['pm'.$i])) { - $st['pm'.$i] = 0; - } - if(!isset($st['pa'.$i])) { - $st['pa'.$i] = 0; - } - if(!isset($st['za'.$i])) { - $st['za'.$i] = 0; - } - $st['mib'.$i] += 0; - $st['mab'.$i] += 0; - if(isset($st['mall'])) { $st['mg'.$i] += $st['mall']; } - if(isset($st['m11'])) { $st['pm'.$i] += $st['m11']; } - if(isset($st['m10'])) { $st['pa'.$i] += $st['m10']; } - if(isset($st['za'])) { $st['za'.$i] += $st['za']; } - } - $i++; - } - - // - - $i = 1; - while( $i <= 7 ) { - @$st['yzm'.$i] += @$st['yzma']; - if( $i <= 4 ) { - @$st['yzm'.$i] += @$st['yzm'];// - @$st['yza'.$i] += @$st['yza']; // - } - // - if( isset($st['yza'.$i]) && $i <= 4 ) { - $st['za'.$i] = ($st['za'.$i]/100*(100+($st['yza'.$i]))); - if( $st['za'.$i] < 0 ) { - $st['za'.$i] = 0; - } - } - // - if( isset($st['yzm'.$i]) ) { - $st['zm'.$i] = ($st['zm'.$i]/100*(100+($st['yzm'.$i]))); - if( $st['zm'.$i] < 0 ) { - $st['zm'.$i] = 0; - } - } - $i++; - } - - - - if(isset($st['hpVinos']) && $st['hpVinos'] != 0) { - $st['hpAll'] += round($st['hpVinos']*$st['s4']); - } - - if(isset($st['mpVinos']) && $st['mpVinos'] != 0) { - $st['mpAll'] += round($st['mpVinos']*$st['s6']); - } - - if(isset($st['hpProc']) && $st['hpProc'] != 0) { - $st['hpAll'] += round($st['hpAll']/100*$st['hpProc']); - } - - if(isset($st['mpProc']) && $st['mpProc'] != 0) { - $st['mpAll'] += round($st['mpAll']/100*$st['mpProc']); - } - - //. - 250 . - /*if( $u['level'] > 7 ) { - $st['speedhp'] -= 240; - $st['speedmp'] -= 240; - }*/ - - // - if($st['hpNow']<0) - { - $st['hpNow'] = 0; - }elseif($st['hpNow']>$st['hpAll']) - { - $st['hpNow'] = $st['hpAll']; - } - if($st['mpNow']<0) - { - $st['mpNow'] = 0; - }elseif($st['mpNow']>$st['mpAll']) - { - $st['mpNow'] = $st['mpAll']; - } - - // - if($st['zona']<1){ $st['zona'] = 1; } - if($st['zona']>5){ $st['zona'] = 5; } - if($st['zonb']<1){ $st['zonb'] = 1; } - if($st['zonb']>3){ $st['zonb'] = 3; } - - $st['ozash'] = $oza; - $st['ozmsh'] = $ozm; - $st['weapon1'] = $hnd1; - $st['weapon2'] = $hnd2; - $st['sheld1'] = $sht1; - $st['sv_'] = $s_v; - $st['sv_i'] = $s_vi; - $st['dom'] = $dom; - $st['prsu'] = $prsu; - - $st['x'] = $u['x']; - $st['y'] = $u['y']; - $st['s'] = $u['s']; - - // - /*$st['reting'] = 0; - // - $st['reting'] += $st['hpAll']; - $st['reting'] += $st['mpAll']; - // - $st['reting'] += $st['m1']; - $st['reting'] += $st['m2']; - $st['reting'] += $st['m4']; - $st['reting'] += $st['m5']; - // - $st['reting'] += $st['m6']*10; - $st['reting'] += $st['m7']*10; - $st['reting'] += $st['m8']*10; - $st['reting'] += $st['m9']*10; - // - $st['reting'] += $st['a1']*7; - $st['reting'] += $st['a2']*7; - $st['reting'] += $st['a3']*7; - $st['reting'] += $st['a4']*7; - $st['reting'] += $st['a5']*7; - $st['reting'] += $st['a6']*7; - $st['reting'] += $st['a7']*7; - // - $st['reting'] += $st['mg1']*7; - $st['reting'] += $st['mg2']*7; - $st['reting'] += $st['mg3']*7; - $st['reting'] += $st['mg4']*7; - $st['reting'] += $st['mg5']*7; - $st['reting'] += $st['mg6']*7; - $st['reting'] += $st['mg7']*7; - // - $st['reting'] += $st['m3']*5; - $i8 = 1; - $st['reting'] += $st['za']*5; - $st['reting'] += $st['zm']*5; - // - $st['reting'] += $st['s5']*5; - $st['reting'] += $st['s6']*5; - // - while( $i8 < 8 ) { - $st['reting'] += $st['pa'.$i]*5; - $st['reting'] += $st['pm'.$i]*5; - // - $st['reting'] += $st['za'.$i]*10; - $st['reting'] += $st['zm'.$i]*10; - $i8++; - } - // - $i8 = 1; - while( $i8 < 5 ) { - $st['reting'] += $st['mib'.$i]; - $st['reting'] += $st['mab'.$i]; - $i8++; - }*/ - - $st['reting'] = 1+ceil($st['reting']); - $st['reting'] = 1+$st['irka']; - - if($u['vip'] > 0) { - $st['exp'] += 25; - $st['speedhp'] += 100; - $st['speedmp'] += 100; - $st['repair_discount'] +=1; - $st['repair_r'] +=1; - $st['repair_z'] +=1; - } - - // - $rep1 = mysql_fetch_array(mysql_query('SELECT - `add_slot`,`nu_sandcity`,`n_sandcity`, - `dl1`,`id`,`rep1`,`rep2`,`repcapitalcity`,`repdemonscity`,`repangelscity`,`repabandonedplain`, - `repdevilscity`,`repmooncity`,`repsuncity`,`repsandcity`,`repemeraldscity`,`repdreamscity`,`repizlom`, - `n_capitalcity`,`n_demonscity`,`n_suncity`,`nu_demonscity`,`nu_angelscity`,`nu_abandonedplain`, - `nu_capitalcity`,`nu_suncity`,`nu_devilscity`,`nu_dreamscity`,`add_stats`,`add_money`,`add_skills`,`add_skills2`, - `rep3`,`rep3_buy`,`repdragonscity`,`n_dragonscity`,`nu_dragonscity`, - (`repcapitalcity`+`repdemonscity`+`repangelscity`+`repsuncity`+`repdreamscity`+`repabandonedplain`+`repsandcity`) as allrep, - (`nu_capitalcity`+`nu_demonscity`+`nu_angelscity`+`nu_suncity`+`nu_dreamscity`+`nu_abandonedplain`+`nu_sandcity`) as allnurep FROM `rep` WHERE `id` = "'.$u['id'].'" LIMIT 1')); - // - if($rep1['repdreamscity'] > 999 && $rep1['repdreamscity'] < 5000 ) { - $st['m1'] += 25; - $st['m4'] += 25; - }elseif($rep1['repdreamscity'] > 4999 && $rep1['repdreamscity'] < 10000) { - $st['m1'] += 50; - $st['m2'] += 25; - $st['m4'] += 50; - $st['m5'] += 25; - }elseif($rep1['repdreamscity'] > 9999) { - $st['m1'] += 75; - $st['m2'] += 50; - $st['m4'] += 75; - $st['m5'] += 50; - } - // - if($rep1['repizlom'] > 999 && $rep1['repizlom'] < 5000) { - $st['speedhp'] += 50; - $st['speedmp'] += 50; - $st['speed_dungeon'] +=10; - }elseif($rep1['repizlom'] > 4999 && $rep1['repizlom'] < 10000) { - $st['speedhp'] += 75; - $st['speedmp'] += 75; - $st['speed_dungeon'] +=20; - }elseif($rep1['repizlom'] > 9999) { - $st['speedhp'] += 100; - $st['speedmp'] += 100; - $st['speed_dungeon'] += 30; - } - // - if($rep1['repangelscity'] > 9999 && $rep1['repangelscity'] < 25000) { - $st['exp'] += 5; - /*$st['hpAll'] += 100; - $st['mpAll'] += 100;*/ - }elseif($rep1['repangelscity'] > 24999) { - $st['exp'] += 10; - /*$st['hpAll'] += 200; - $st['mpAll'] += 200;*/ - } - // - if($rep1['repdemonscity'] > 9999 && $rep1['repdemonscity'] < 25000) { - $st['m10'] += 5; - $st['zma'] += 50; - }elseif($rep1['repdemonscity'] > 24999) { - $st['m10'] += 10; - $st['zma'] += 100; - } - // - if($rep1['repsuncity'] > 9999 && $rep1['repsuncity'] < 25000) { - $st['m11'] += 5; - $st['za'] += 50; - }elseif($rep1['repdemonscity'] > 24999) { - $st['m11'] += 10; - $st['za'] += 100; - } - // - if($rep1['repcapitalcity'] > 9999 && $rep1['repcapitalcity'] < 25000) { - $st['pza'] += 2; - $st['pzm'] += 2; - $st['mib1'] +=10; - $st['mab1'] +=10; - }elseif($rep1['repdemonscity'] > 24999) { - $st['pza'] += 4; - $st['pzm'] += 4; - $st['mib1'] += 20; - $st['mab1'] +=20; - } - // - if($rep1['repabandonedplain'] > 9999 && $rep1['repabandonedplain'] < 25000) { - $st['mib1'] += 5; - $st['mab3'] += 5; - $st['mab4'] +=5; - }elseif($rep1['repdemonscity'] > 24999) { - $st['mab1'] += 10; - $st['mab3'] += 10; - $st['mab4'] += 10; - } - - - // - $st['maxves'] += 500; - - if( $st['silver'] >= 5 ) { - $st['exp'] += 50; - } - - if( $u['admin'] > 0 ) { - $st['speed_dungeon'] += 1000; - $st['speedhp'] += 1000000000000000; - } - /*if( date('H') >= 22 && date('H') <= 24 ) { - if($u['room']==9 && $u['room']==323 && $u['room']==1) { - $st['exp'] +=150; - } - }else*/if( date('H') >=22 && date('H') <= 10 ) { - $st['exp'] +=25; - } - - // - $st['reting'] = floor($st['reting']); - //if(@$st['btl_cof'] != @$st['reting']) { - //$st['btl_cof'] = $st['reting']; - //mysql_query('UPDATE `stats` SET `btl_cof` = "'.$st['reting'].'" WHERE `id` = "'.$st['id'].'" LIMIT 1'); - //} - if(@$st['btl_cof'] != @$st['prckr']) { - $st['btl_cof'] = $st['prckr']; - mysql_query('UPDATE `stats` SET `btl_cof` = "'.$st['prckr'].'" WHERE `id` = "'.$st['id'].'" LIMIT 1'); - } - - if($st['hpAll'] < 1) { - $st['hpAll'] = 1; - } - - if($st['mpAll'] < 0) { - $st['mpAll'] = 0; - } - - if($u['room'] == 411) { - //, -25% - $shb = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "'.$u['id'].'" AND `item_id` = 4910 AND `delete` = 0 LIMIT 1')); - if(isset($shb['id'])) { - $st['hpAll'] = round($st['hpAll']/100*75); - } - } - - if( stristr($u['login'], '( ') == true || (stristr($u['login'], ' ') && $u['ip'] == '0') ) { - $st['this_animal'] = 1; - }else{ - $st['this_animal'] = 0; - } - - $rt = array(); - if($i1==1) - { - $rt[0] = $st; - $rt[1] = $st2; // - }else{ - $rt = $st; - } - - if( $u['hpAll'] != $st['hpAll'] || $u['mpAll'] != $st['mpAll'] ) { - mysql_query('UPDATE `stats` SET `hpAll` = "'.$st['hpAll'].'",`mpAll` = "'.$st['mpAll'].'" WHERE `id` = "'.$u['id'].'" LIMIT 1'); - } - - if( $btl_cache == true && $cache == false ) { - $dataca = array( - 'st' => $st, - 'st2' => $st2 - ); - $dataca = json_encode($dataca); - mysql_query('INSERT INTO `battle_cache` (`uid`,`battle`,`data`,`time`) VALUES ("'.$u['id'].'","'.$u['battle'].'","'.mysql_real_escape_string($dataca).'","'.time().'")'); - } - } - - if( isset($cache) ) { - if( $i1 == 1 ) { - $rt = array( $cache['st'] , $cache['st2'] ); - }else{ - $rt = $cache['st']; - } - } - - return $rt; - } - - public function send($color,$room,$city,$from,$to,$text,$time,$type,$toChat,$spam,$sound,$new = 1,$typeTime = 0,$global = 0) - { - mysql_query("INSERT INTO `chat` (`global`,`typeTime`,`new`,`sound`,`color`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`spam`) VALUES - ('".$global."','".$typeTime."','".$new."','".$sound."','".$color."','".$city."','".$room."','".$from."','".$to."','".$text."','".$time."','".$type."','".$toChat."','".$spam."')"); - $msg_id = mysql_insert_id(); - return $msg_id; - } - - // - public function testLevel() - { - global $c; - $rt = 0; - if( $this->info['exp'] > $c['expstop'] ) { - $this->info['exp'] = $c['expstop']; - mysql_query('UPDATE `stats` SET `exp` = "'.$c['expstop'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - if(isset($this->stats['levels']['upLevel'])) - { - $telvl = array(); - $sp = mysql_query('SELECT `upLevel`,`exp` FROM `levels`'); - while( $pl = mysql_fetch_array($sp) ) { - $telvl[$pl['upLevel']] = $pl['exp']; - } - if( $this->info['exp'] >= $telvl[$this->info['upLevel']] ) { - $lvl = mysql_fetch_array(mysql_query('SELECT `duh`,`vinos`,`bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel`="'.$this->info['upLevel'].'" LIMIT 1')); - $lvln = mysql_fetch_array(mysql_query('SELECT `duh`,`vinos`,`bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel`="'.($lvl['upLevel']+1).'" LIMIT 1')); - // - if($this->info['exp']>12499 && $this->info['level']<=5 && $c['infinity5level'] == true) - { - $itm = mysql_fetch_array(mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "1204" AND `delete` = "0" AND `uid` = "'.$this->info['id'].'" AND `inShop` = "0" AND `inTransfer` = "0" LIMIT 1')); - if(!isset($itm['id']) && $this->info['host_reg'] != 'noinfinity5' && $this->info['twink'] == 0) - { - $this->info['exp'] = 12499; - mysql_query('UPDATE `stats` SET `exp` = "12499" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - echo ''; - }else{ - - mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1'); - $text = ' " [6]" .'; - echo ''; - //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1',".$this->info['city']."','".$this->info['room']."','','".$this->info['login']."','".$text."','".time()."','6','0')"); - } - - } - //**************** - $i = 0; $ult = 0; - //mysql_query('LOCK TABLES users,stats,mults,bank,referal_bous,levels,chat WRITE'); - while($i!=1) - { - if($c['nolevel'] == true && $this->info['exp']>=$lvl['exp'] && isset($lvln['upLevel'])) - { - $tlus = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `real` = 1 AND `level` = "'.$this->info['level'].'" LIMIT 1')); - // , $lvln - if($tlus[0] < $this->info['level']*5) { - // / 100 - $this->info['exp'] = $lvl['exp']-1; - mysql_query('UPDATE `stats` SET `exp` = "'.$this->info['exp'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - } - } - if($this->info['exp']>=$lvl['exp'] && isset($lvln['upLevel'])) - { - if($lvl['nextLevel']>$this->info['level']) - { - // - /* - if($lvl['nextLevel']==8){ - $text = ' 8 " --".'; - echo ''; - $this->addItem(1190,$this->info['id'],'|sudba='.$this->info['login']); - } - */ - - // - $a4 = 1; - if($lvl['nextLevel']==9) - { - $a4 = 2; - }elseif($lvl['nextLevel']==10) - { - $a4 = 3; - }elseif($lvl['nextLevel']==11) - { - $a4 = 5; - }elseif($lvl['nextLevel']==12) - { - $a4 = 30; - } - - $this->stats['s4'] += $a4; - $sex1 = ''; - if($this->info['sex']==1) - { - $sex1 = ''; - } - - $ult = 1; - - // - if($this->info['twink'] == 0 && (round($this->info['host_reg']) > 0 && ( $this->info['dieline'] == 0 || $this->info['dieline'] < $lvl['exp'] ))) { - $mtest = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`uid2`,`ip` FROM `mults` WHERE (`uid` = "'.$this->info['id'].'" AND `uid2` = "'.((int)$this->info['host_reg']).'") OR (`uid2` = "'.$this->info['id'].'" AND `uid` = "'.((int)$this->info['host_reg']).'") LIMIT 1')); - $rlog = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`catch`,`host_reg` FROM `users` WHERE `id` = "'.((int)$this->info['host_reg']).'" LIMIT 1')); - $rlogs = mysql_fetch_array(mysql_query('SELECT `id`,`ref_data` FROM `stats` WHERE `id` = "'.((int)$this->info['host_reg']).'" LIMIT 1')); - - if(!isset($mtest['id']) && isset($rlog['id'])) { - $rtg = true; - }else{ - $rtg = mysql_fetch_array(mysql_query('SELECT * FROM `ref_mult` WHERE `uid1` = "'.$rlog['id'].'" LIMIT 1')); - if(isset($rtg['id'])) { - if( $this->info['id'] == $rtg['uid2'] ) { - $rtg = true; - }else{ - $rtg = false; - } - }else{ - mysql_query('INSERT INTO `ref_mult` (`uid1`,`uid2`,`time`) VALUES ( - "'.$rlog['id'].'" , "'.$this->info['id'].'","'.time().'" - )'); - $rtg = true; - } - } - - if(($rtg == true || !isset($mtest['id'])) && isset($rlog['id']) && $this->info['activ'] == 0) { - $rfs['data'] = explode('|',$rlogs['ref_data']); - $ekr = '0.00'; - $bn = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`level`,`add_bank`,`add_money`,`finish_battle`,`online`,`onlyOne`,`add_crystals` FROM `referal_bous` WHERE `type` = 1 AND `level` = "'.$lvl['nextLevel'].'" LIMIT 1')); - if(isset($bn['id']) && ($bn['add_bank'] > 0 || $bn['add_money'] > 0) ) { - $ekr = $bn['add_bank']; - $kr = $bn['add_money']; - $up = mysql_query('UPDATE `users` SET `money` = `money` + '.$kr.',`money2` = `money2` + '.$ekr.' WHERE `id` = "'.mysql_real_escape_string($rlog['id']).'" LIMIT 1'); - if($up) { - - // 1- - $krtxt = ''; - if( $kr > 0 ) { - $krtxt .= ''.$kr.' '; - if( $ekr > 0 ) { - $krtxt .= ', '; - } - } - if( $ekr > 0 ) { - $krtxt .= ''.$ekr.' '; - } - $this->send('',$this->info['room'],$this->info['city'],'',$rlog['login'],' '.$this->info['login'].' '.$sex1.' '.$lvl['nextLevel'].'! '.$krtxt,-1,6,0,0,0,1); - $rlog['catch'] += $bn['add_bank']; - mysql_query('UPDATE `users` SET `catch` = "'.$rlog['catch'].'" WHERE `id` = "'.$rlog['id'].'" LIMIT 1'); - // - if( (int)$rlog['host_reg'] > 0 ) { - // 2- - $llogin = $rlog['login']; - $ekr = round($bn['add_bank']*0.4,2); - $kr = round($bn['add_money']*0.4,2); - $rlog = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`catch`,`host_reg` FROM `users` WHERE `id` = "'.((int)$rlog['host_reg']).'" LIMIT 1')); - if( isset($rlog['id']) ) { - $krtxt = ''; - if( $kr > 0 ) { - $krtxt .= ''.$kr.' '; - if( $ekr > 0 ) { - $krtxt .= ', '; - } - } - if( $ekr > 0 ) { - $krtxt .= ''.$ekr.' '; - } - $this->send('',$this->info['room'],$this->info['city'],'',$rlog['login'],' '.$this->info['login'].' (2- "'.$llogin.'" ) '.$sex1.' '.$lvl['nextLevel'].'! '.$krtxt,-1,6,0,0,0,1); - $rlog['catch'] += $bn['add_bank']; - mysql_query('UPDATE `users` SET `money` = `money` + '.$kr.',`money2` = `money2` + '.$ekr.' WHERE `id` = "'.$rlog['id'].'" LIMIT 1'); - // - if( (int)$rlog['host_reg'] > 0 ) { - // 3- - $llogin2 = $rlog['login']; - $ekr = round($bn['add_bank']*0.2,2); - $kr = round($bn['add_money']*0.2,2); - $rlog = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`catch`,`host_reg` FROM `users` WHERE `id` = "'.((int)$rlog['host_reg']).'" LIMIT 1')); - if( isset($rlog['id']) ) { - $krtxt = ''; - if( $kr > 0 ) { - $krtxt .= ''.$kr.' '; - if( $ekr > 0 ) { - $krtxt .= ', '; - } - } - if( $ekr > 0 ) { - $krtxt .= ''.$ekr.' '; - } - $this->send('',$this->info['room'],$this->info['city'],'',$rlog['login'],' '.$this->info['login'].' (3- "'.$llogin2.'" ( '.$llogin.') ) '.$sex1.' '.$lvl['nextLevel'].'! '.$krtxt,-1,6,0,0,0,1); - $rlog['catch'] += $bn['add_bank']; - mysql_query('UPDATE `users` SET `money` = `money` + '.$kr.',`money2` = `money2` + '.$ekr.' WHERE `id` = "'.$rlog['id'].'" LIMIT 1'); - // - } - } - // - } - } - - }else{ - $this->send('',$this->info['room'],$this->info['city'],'',$rlog['login'],' '.$this->info['login'].' '.$sex1.' '.$lvl['nextLevel'].'! ( , ) '.$bnk.' '.$ekr.' .',-1,6,0,0,0,1); - } - } - // - mysql_query("UPDATE `users` SET `referals` = `referals` + 10 WHERE `id` = '".mysql_real_escape_string($rlog['id'])."' LIMIT 1"); - // - }elseif(isset($rlog['id'])){ - $this->send('',$this->info['room'],$this->info['city'],'',$rlog['login'],' '.$this->info['login'].' '.$sex1.' '.$lvl['nextLevel'].'! ( , IP! 1 !)',-1,6,0,0,0,1); - } - } - - - - /* - $tst = $this->lookStats($this->info['stats']); - $tst['s4'] += $a4; - $tst['s7'] += $lvl['duh']; - $this->info['stats'] = $this->impStats($tst); - */ - } - - /*if( $this->info['twink'] == 0 ) { - if( $this->info['exp'] >= 300000 ) { - $this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],' /, : '.$lvl['money'].' .',-1,6,0,0,0,1); - } - }*/ - - $tst = $this->lookStats($this->info['stats']); - $tst['s4'] += $lvl['vinos']; - $tst['s7'] += $lvl['duh']; - $this->info['stats'] = $this->impStats($tst); - - $this->info['level'] = $lvl['nextLevel']; - $this->stats['levels'] = $lvln; - $this->info['ability'] += $lvl['ability']; - $this->info['skills'] += $lvl['skills']; - $this->info['sskills'] += $lvl['sskills']; - $this->info['nskills'] += $lvl['nskills']; - if( $this->info['twink'] == 0 ) { - //if( $this->info['level'] < 8 ) { - // 0-7 - //$this->info['money4'] = $lvl['money']+$this->info['money4']; - //}else{ - $this->info['money'] = $lvl['money']+$this->info['money']; - //} - } - $lvl = $lvln; - $lvln = mysql_fetch_array(mysql_query('SELECT `bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel`="'.($lvl['upLevel']+1).'" LIMIT 1')); - $this->info['upLevel'] += 1; - $rt++; - }else{ - $i = 1; - } - } - if($ult == 1) { - if( $this->info['level'] == 4 || $this->info['level'] == 8 ) { - // - mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$this->info['id'].'" AND `vars` LIKE "psh%"'); - $this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],' !!!!!!!!!!!!!!!.',-1,6,0,0,0,1); - } - /*if( $this->info['level'] > 0 && $this->info['level'] <= 5 ) { - $this->info['money4'] += 100; - mysql_query('UPDATE `users` SET `money4` = "'.$this->info['money4'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - $this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],' '.$this->zuby(100,1).'',-1,6,0,0,0,1); - }*/ - //if( isset($itm['id']) || $lvl['nextLevel'] != 6 ) { - // - /*$txti = ''; - if( $this->info['sex'] == 1 ) { - $txti .= ''; - } - $txti .= ' '.$this->info['level'].' !
'.date('d.m.Y H:i').''; - // - mysql_query('INSERT INTO `users_ico` ( - `uid`,`time`,`text`,`img`,`type`,`x`,`see` - ) VALUES ( - "'.$this->info['id'].'","'.time().'","'.$txti.'","pod_lvl'.$this->info['level'].'.gif","2","1","1" - )');*/ - // - $this->send('',$this->info['room'],$this->info['city'],'','',''.$this->info['login'].' '.$sex1.' '.$this->info['level'].'!',time(),6,0,0,0,1,2); // - //} - } - //mysql_query('UNLOCK TABLES'); - if($rt > 0) { - if( $this->info['level'] >= 10 ) { - //$this->info['stopexp'] = 1; // - $this->info['stopexp'] = 0; - }else{ - $this->info['stopexp'] = 0; - } - $upd = mysql_query('UPDATE `users` SET `stopexp` = "'.$this->info['stopexp'].'" , `level` = "'.$this->info['level'].'",`money` = "'.$this->info['money'].'",`money4` = "'.$this->info['money4'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - $upd = mysql_query('UPDATE `users_twink` SET `stopexp` = "'.$this->info['stopexp'].'" WHERE `uid` = "'.$this->info['id'].'" LIMIT 1'); - if($upd) - { - mysql_query('UPDATE `stats` SET `ability` = "'.$this->info['ability'].'",`skills` = "'.$this->info['skills'].'",`nskills` = "'.$this->info['nskills'].'",`sskills` = "'.$this->info['sskills'].'",`stats` = "'.$this->info['stats'].'",`upLevel` = "'.$this->info['upLevel'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'); - $this->info['money'] = $this->r2($this->info['money']); - } - return 1; - } - //**************** - } - } - /*------------*/ - if($this->info['animal']>0) - { - // - $a = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$this->info['animal'].'" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1')); - if(isset($a['id']) && $a['level'] < 12) - { - $ea = array( - 0=>0, - 1=>110, - 2=>410, - 3=>1300, - 4=>2500, - 5=>5000, - 6=>12500, - 7=>30000, - 8=>100000, - 9=>3000000, - 10=>10000000, - 11=>50000000, - 12=>150000000 - ); - $mx = array( - 0=>140, - 1=>400, - 2=>500, - 3=>650, - 4=>700, - 5=>1400, - 6=>3000, - 7=>6000, - 8=>10000, - 9=>16000, - 10=>24000, - 11=>40000, - 12=>60000 - ); - $iz = 0; - while($iz!=-1) - { - if($ea[$a['level']+1]<=$a['exp']) - { - // - $a['level']++; - $a['max_exp'] = $mx[$a['level']]; - }else{ - if($iz>0) - { - $a['stats'] = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`exp`,`level`,`stats`,`bonus` FROM `levels_animal` WHERE `type` = "'.$a['type'].'" AND `level` = "'.$a['level'].'" LIMIT 1')); - $a['stats'] = $a['stats']['stats']; - $this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],''.$a['name'].' '.$a['level'].' !',time(),6,0,0,0,1); - mysql_query('UPDATE `users_animal` SET `stats` = "'.$a['stats'].'",`level`="'.$a['level'].'",`max_exp`="'.$a['max_exp'].'" WHERE `id` = "'.$a['id'].'" LIMIT 1'); - } - $iz = -2; - } - if( $iz > 1000 ) { - $iz = -2; - } - $iz++; - } - } - } - /*------------*/ - } - - public function r2($v) - { - $v = number_format($v, 2, '.', ' '); - return $v; - } - - public function regen($uid,$st,$i1) - { - if($uid!=$this->info['id']) - { - $u = mysql_fetch_array(mysql_query('SELECT `u`.`align`,`u`.`align2`,`u`.`clan`,`u`.`battle`,`u`.`animal`,`u`.`id`,`u`.`level`,`u`.`login`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`obraz`,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($uid).'" OR `u`.`login`="'.mysql_real_escape_string($uid).'" LIMIT 1')); - if(!isset($st['hpAll'])) - { - $st = $this->getStats($uid,$i1); - } - }else{ - $u = $this->info; - if(isset($this->stats['hpAll'])) - { - $st = $this->stats; - }elseif($st!=0) - { - - }else{ - $st = $this->getStats($uid,$i1); - } - } - $btl = 0; - if($u['battle']>0) - { - //$btl = mysql_fetch_array(mysql_query('SELECT `id`,`time_start` FROM `battle` WHERE `id` = "'.$u['battle'].'" AND `team_win` = "-1" LIMIT 1')); - } - if($u['battle']==0 || (isset($btl['id']) && $btl['time_start']>$this->info['timereg'])) - { - $sth = $u['minHP']; // HP - $stm = $u['minMP']; // MP - $sh = 0; // 1 . - $sm = 0; // M 1 . - /*---()---*/ - if(@$st['os9']>0){ - if(@$st['os9']==5) { - @$st['os9']=6; - } - $sth = floor($u['minHP']-($u['minHP']/100)*($st['os9']*5)); - } - /*---()---*/ - /*---()---*/ - if(@$st['os10']>0){ - $stm = floor($u['minMP']-($u['minMP']/100)*($st['os10']*5)); - } - /*---()---*/ - if($u['battle']>0) - { - $this->info['timereg'] = $btl['time_start']; - } - - // - // - $st['speedhp'] += 150; - $st['speedmp'] += 150; - - //hp - $sh = ($st['hpAll']/(60*$sth)); - if(!isset($st['speedhp'])) { $st['speedhp'] = 0; } - if( (0.0001+$st['speedhp']+$st['levels']['hpRegen']) < 0.00001 ) { - $sh += ($sh/100)*0.00001; - }else{ - $sh += ($sh/100)*(0.0001+$st['speedhp']+$st['levels']['hpRegen']); - } - $st['hpNow'] += $sh*(time()-$u['regHP']); - if($st['hpNow']<0) - { - $st['hpNow'] = 0; - }elseif($st['hpNow']>$st['hpAll']) - { - $st['hpNow'] = $st['hpAll']; - } - //mp - $sm = ($st['mpAll']/(60*$stm)); - if(!isset($st['speedmp'])) { $st['speedmp'] = 0; } - $sm += ($sm/100)*(1+$st['speedmp']+$st['levels']['mpRegen']); - $st['mpNow'] += $sm*(time()-$u['regMP']); - if($st['mpNow']<0) - { - $st['mpNow'] = 0; - }elseif($st['mpNow']>$st['mpAll']) - { - $st['mpNow'] = $st['mpAll']; - } - // - $upd = mysql_query('UPDATE `stats` SET `regHP`="'.time().'",`regMP`="'.time().'",`hpNow`="'.$st['hpNow'].'",`mpNow`="'.$st['mpNow'].'" WHERE `id` = "'.$u['id'].'" LIMIT 1'); - if(!$upd) - { - return array(0=>0,1=>0); - }else{ - if($this->info['id']==$u['id']) - { - $this->stats['regHP'] = time(); - $this->stats['regMP'] = time(); - $this->stats['hpNow'] = $st['hpNow']; - $this->stats['mpNow'] = $st['mpNow']; - } - return array(0=>$sh,1=>$sm,'hpNow'=>$st['hpNow'],'mpNow'=>$st['mpNow']); - } - } - } - - public function send_mime_mail($name_from, // - $email_from, // email - $name_to, // - $email_to, // email - $data_charset, // - $send_charset, // - $subject, // - $body // - ) - { - $to = $this->mime_header_encode($name_to, $data_charset, $send_charset) - . ' <' . $email_to . '>'; - $subject = $this->mime_header_encode($subject, $data_charset, $send_charset); - $from = $this->mime_header_encode($name_from, $data_charset, $send_charset) - .' <' . $email_from . '>'; - if($data_charset != $send_charset) { - $body = iconv($data_charset, $send_charset, $body); - } - $headers = "From: $from\r\n"; - $headers .= "Content-type: text/html; charset=$send_charset\r\n"; - - return mail($to, $subject, $body, $headers); - } - - public function mime_header_encode($str, $data_charset, $send_charset) { - if($data_charset != $send_charset) { - $str = iconv($data_charset, $send_charset, $str); - } - return '=?' . $send_charset . '?B?' . base64_encode($str) . '?='; - } - -public function set_cl_item($id, $user, $cl) { - $item_ = mysql_fetch_array(mysql_query('SELECT `iu`.*, `im`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "'.$user['id'].'" AND `iu`.`delete` = 0 AND `iu`.`inOdet` = 0 AND `iu`.`inShop` = 0 AND `im`.`inslot` > 0 AND `iu`.`gift` = "" AND `iu`.`data` NOT LIKE "%frompisher=%" AND `iu`.`id` = "'.$id.'" LIMIT 1')); - $res = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$cl.'" LIMIT 1')); - if(isset($item_['id'])) { - $po = $this->lookStats($item_['data']); - if(isset($po['toclan'])) { - $po['toclan1'] = explode('#', $po['toclan']); - $po['toclan1'] = $po['toclan1'][0]; - } - if(isset($po['sudba']) && $po['sudba'] != '0') { - $r = '
'; - } elseif(isset($po['toclan']) && $po['toclan1'] != $user['clan']) { - $r = ' ...
'; - } elseif($user['inTurnir'] > 0 || $user['inTurnirnew'] > 0) { - $r = ' .
'; - } else { - if((isset($po['sudba']) && $po['sudba'] != '0') || isset($po['icos']) || isset($po['frompisher']) || isset($po['fromlaba']) || ($item_['gift'] != '' && $item_['gift'] != 0) ) { - $r = ' '; - } elseif(!isset($po['toclan'])) { - $po['toclan'] = $user['clan'].'#'.$user['id']; - $item_['data'] = $this->impStats($po); - if(mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "-21'.$user['clan'].'", `data` = "'.$item_['data'].'" WHERE `id` = "'.$id.'" LIMIT 1')) { - $r = ' "'.$item_['name'].'"
'; - $col = $this->itemsX(((int)$id)); - $this->addDelo(2, $user['id'],'"System.transfer.MONEY": "'.$item_['name'].'" (#id : "'.$id.'") (x'.$col.') "'.$res['name'].'" ('.$res['id'].').', time(), $user['city'], 'System.transfer.clan', 0, 0); - mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "4", "'.$user['login'].'", "'.$item_['name'].' (x'.$col.') : ['.$id.']", "'.$user['id'].'")'); - } else { - $r = ' ...
'; - } - } else { - if(mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "-21'.$user['clan'].'" WHERE `id` = "'.$id.'" LIMIT 1')) { - $col = $this->itemsX(((int)$id)); - mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "3", "'.$user['login'].'", "'.$item_['name'].'" (x'.$col.') : ['.$id.'], "'.$user['id'].'")'); - $r = ' "'.$item_['name'].'"
'; - } else { - $r = ' ...
'; - } - } - } - } else { - $r = ' .
'; - } - return $r; -} - - -public function ungive_itm_cl($id, $user, $cl) { - $itm_ = mysql_fetch_array(mysql_query('SELECT `iu`.*, `im`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` >= 0 AND `iu`.`delete` = 0 AND `iu`.`id` = "'.$id.'" LIMIT 1')); - $res = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$cl.'" LIMIT 1')); - $user_itm = mysql_fetch_array(mysql_query('SELECT `id`,`bot`,`clone` FROM `stats` WHERE `id` = "'.$itm_['uid'].'" LIMIT 1')); - if( $user_itm['bot'] > 0 || $user_itm['clone'] > 0 || !isset($user_itm['id']) ) { - $r = ' ,
'; - }elseif(isset($itm_['id'])) { - if($user['inTurnir'] == 0 && $user['inTurnirnew'] == 0) { - if($itm_['inOdet'] != 0) { $o = ', `inOdet` = 0'; } else { $o = ''; } - $r = ' "'.$itm_['name'].'"
'; - $col = $this->itemsX(((int)$id)); - mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "6", "'.$user['login'].'", "'.$itm_['name'].' (x'.$col.') : ['.$id.'] | : ['.$itm_['uid'].']", "'.$user['id'].'")'); - mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "-21'.$res['id'].'" '.$o.' WHERE `id` = "'.$id.'" LIMIT 1'); - } else { - $r = ' .
'; - } - } else { - $r = ' .
'; - } - return $r; -} - -public function take_itm_cl($id, $user, $cl) { - $itm_ = mysql_fetch_array(mysql_query('SELECT `iu`.*, `im`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "-21'.$user['clan'].'" AND `iu`.`delete` = 0 AND `iu`.`id` = "'.$id.'" LIMIT 1')); - $res = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$cl.'" LIMIT 1')); - if(isset($itm_['id'])) { - $po = $this->lookStats($itm_['data']); - if(isset($po['toclan'])) { - $cls = explode('#', $po['toclan']); - $cls = $cls[1]; - } - if($user['inTurnir'] == 0 && $user['inTurnirnew'] == 0) { - $col = $this->itemsX(((int)$id)); - mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "5", "'.$user['login'].'", "'.$itm_['name'].' (x'.$col.') : ['.$id.'] : ['.$cls.']", "'.$user['id'].'")'); - mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "'.$user['id'].'" WHERE `id` = "'.$id.'" LIMIT 1'); - $r = ' "'.$itm_['name'].'"
'; - } else { - $r = ' .
'; - } - } else { - $r = ' .
'.$id; - } - return $r; -} - -public function rem_itm_cl($user, $cl, $type) { - $itms = mysql_query('SELECT * FROM `items_users` WHERE (`uid` = "-21'.$user['clan'].'" OR `data` LIKE "%toclan='.$user['clan'].'#%")'); - while($pl = mysql_fetch_array($itms)) { - $po = $this->lookStats($pl['data']); - if(isset($po['toclan'])) { - $cls = explode('#', $po['toclan']); - $cls = $cls[1]; - } - if($cls == $user['id']) { - if($pl['uid'] != $user['id']) { - if($pl['inOdet'] != 0) { mysql_query('UPDATE `items_users` SET `inOdet` = 0 WHERE `id` = "'.$pl['id'].'"'); } - } - unset($po['toclan']); - $pl['data'] = $this->impStats($po); - $col = $this->itemsX(((int)$pl['id'])); - $it_n = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "'.$pl['item_id'].'"')); - mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "'.$user['id'].'", `data` = "'.$pl['data'].'" WHERE `id` = "'.$pl['id'].'"'); - mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "'.$type.'", "'.$user['login'].'", "'.$it_n['name'].' (x'.$col.') : ['.$pl['id'].']", "'.$user['id'].'")'); - } elseif($cls != $user['id'] && $pl['uid'] == $user['id']) { - $col = $this->itemsX(((int)$pl['id'])); - $it_n = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "'.$pl['item_id'].'"')); - mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "-21'.$user['clan'].'" WHERE `id` = "'.$pl['id'].'"'); - mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "9", "'.$user['login'].'", "'.$it_n['name'].' (x'.$col.') : ['.$pl['id'].']", "'.$user['id'].'")'); - } - } -} - - public function send_mail($to,$to_name,$from = 'support@new-combats.com',$name = ' 2',$title,$text) { - $this->send_mime_mail($name, - $from, - $to_name, - $to, - 'CP1251', // , - 'KOI8-R', // , - $title, - $text); // \r\n - } - - public function roomInfo($id, $short=false) { - if($short==true){ - $select = ' `id`, `name`, `code`, `city`, `timeGO`, `level`,`roomGo` '; - } else { - $select = ' * '; - } - $roomInfo = mysql_fetch_array(mysql_query('SELECT '.$select.' FROM `room` WHERE `id` = "'.$id.'" LIMIT 1')); - if($roomInfo['roomGo']) $roomInfo['roomGo'] = explode(',', $roomInfo['roomGo']); - if($roomInfo['level']) $roomInfo['level'] = explode('-', $roomInfo['level']); - return $roomInfo; - } - -public function showAbils() { - $r = ''; - $sp = mysql_fetch_array(mysql_query('SELECT * FROM `abils_user` WHERE `uid` = "'.$this->info['id'].'" LIMIT 1')); - if(isset($sp['id'])) { - $r .= ''; - } else { - mysql_query('INSERT INTO `abils_user` (`uid`) VALUES ("'.$this->info['id'].'")'); - } - return $r; -} - -} - - -$u = user::start(); -?> \ No newline at end of file diff --git a/modules_data/titul.php b/modules_data/titul.php index 0d418e82..7f1a28b1 100644 --- a/modules_data/titul.php +++ b/modules_data/titul.php @@ -1,8 +1,3 @@ - - [ - 'quest' => 'Выполнить задания бабки.', - 'check' => ['Заданий', 5, 25, 50, 100, 250], - 'prize' => ['Жетон
успеха
', 5, 20, 40, 60, 100], - 'startlink' => 11 - ], - 'vx' => [ - 'quest' => 'Победить в хаотических боях.', - 'check' => ['Побед', 50, 300, 400, 500, 1000], - 'prize' => ['екр.', 25, 50, 75, 100, 200], - 'startlink' => 21 - ], - 'snt' => [ - 'quest' => 'Открыть сундук трупожора.', - 'check' => ['Открытий', 5, 25, 50, 100, 250], - 'prize' => ['екр.', 10, 25, 50, 75, 200], - 'startlink' => 31 - ], - 'rp' => [ - 'quest' => 'Получить руну при плавке плохих заготовок. [S]', - 'check' => ['Рун', 5, 10, 25, 50, 100], - 'prize' => ['Плохие
заготовки
', 5, 7, 10, 12, 15], - 'startlink' => 41 - ], - 'rn' => [ - 'quest' => 'Получить руну при плавке нормальных заготовок. [M]', - 'check' => ['Рун', 5, 10, 15, 25, 50], - 'prize' => ['Нормальные
заготовки
', 5, 7, 9, 12, 15], - 'startlink' => 51 - ], - 'rb' => [ - 'quest' => 'Получить руну при плавке идеальных заготовок. [L]', - 'check' => ['Рун', 2, 5, 8, 11, 15], - 'prize' => ['Идеальные
заготовки
', 2, 4, 6, 10, 15], - 'startlink' => 61 - ], - 'pg' => [ - 'quest' => 'Поучаствовать в героическом сражении.', - 'check' => ['Участий', 100, 200, 400, 600, 1000], - 'prize' => ['Жетон
успеха
', 10, 20, 40, 60, 80], - 'startlink' => 71 - ], - 'bv' => [ - 'quest' => 'Продать бабушке найденные вещи в пещере.', - 'check' => ['Продаж', 5, 25, 50, 100, 250], - 'prize' => ['кр.', 500, 1000, 2000, 4000, 5000], - 'startlink' => 81 - ], - 'kw' => [ - 'quest' => 'Победить в клановой войне.', - 'check' => ['Побед', 5, 10, 15, 20, 25], - 'prize' => ['Свиток
кланового
опыта ', 1, 2, 5, 10, 15], - 'startlink' => 91 - ], - 'pa' => [ # not implemented! - 'quest' => 'Получить покровительство Ангела.', - 'check' => ['Получено', 5, 25, 50, 100, 250], - 'prize' => null, - 'startlink' => null - ], - 'bs' => [ - 'quest' => 'Победы в башне смерти.', - 'check' => ['Побед', 1, 5, 10, 50, 500], - 'prize' => ['екр.', 1, 5, 10, 50, 200], - 'startlink' => 101 - ], - 'trn' => [ # not implemented! - 'quest' => 'Победы в турнирах.', - 'check' => ['Побед', 25, 50, 100, 200, 500], - 'prize' => ['екр.', 25, 25, 25, 25, 50], - 'startlink' => 111 - ], -]; - -function table($rows, $class = '', $fill = false) -{ - $c = ''; - $max_rows = sizeof(max($rows)); - - foreach ($rows as $row) { - if ($fill && sizeof($row) < $max_rows) { - $row = array_merge($row, array_fill(0, $max_rows - sizeof($row), '')); - } - - $c .= '' . implode('', $row) . ''; - } - - return (!empty($class) ? "" : '
') . $c . '
' . PHP_EOL; +if (empty($u)) { + $u = user::start(); } -$ai = $u->achivInf($u->info['id'], 1); +$a = new Achievements($u); +$ai = $a->getCheckedInfo(); + if (isset($_GET['nagr'])) { $nagrtxt = 'За выполненное достижение Вы получили '; - if ( - in_array($_GET['nagr'], [14, 15, 24, 25, 34, 35, 44, 45, 54, 55, 64, 65, 74, 75, 84, 85, 94, 95, 104, 105]) && - $u->info['level'] < 9 - ) { + + if ($a->hasNoTier4Access($_GET['nagr'])) { $nagrtxt = 'Вы не можете получить эту награду на этом уровне!'; } elseif ( //бабка задание zb in_array($_GET['nagr'], [11, 12, 13, 14, 15]) && @@ -119,179 +24,106 @@ if (isset($_GET['nagr'])) { $ai['klaszb'] > $ai['zb_n'] ) { $ai['zb_n'] += 1; - $u->rangup($u->info['id'], $ai['zb_n'], 'zb'); - $i = 0; - while ($i < $achievement_data['zb']['prize'][$ai['zb_n']]) { - $u->addItem(10020, $u->info['id'], ''); - $i++; - } - $nagrtxt .= 'Жетон успеха X' . $achievement_data['zb']['prize'][$ai['zb_n']]; + $a->updateTier('zb_n'); + $a->givePrizeItems(10020, 'zb'); + $nagrtxt .= 'Жетон успеха X' . $a->getData()['zb']['prize'][$ai['zb_n']]; } elseif ( //Хаот задание vx in_array($_GET['nagr'], [21, 22, 23, 24, 25]) && in_array($ai['vx_n'], [0, 1, 2, 3, 4]) && $ai['klasvx'] > $ai['vx_n'] ) { $ai['vx_n'] += 1; - $u->rangup($u->info['id'], $ai['vx_n'], 'vx'); - Db::sql('update users set money2 = money2 + ? where id = ?', - [$achievement_data['vx']['prize'][$ai['vx_n']], $u->info['id']]); - $nagrtxt .= $achievement_data['vx']['prize'][$ai['vx_n']] . $achievement_data['vx']['prize'][0]; + $a->updateTier('vx_n'); + $u->addEkr($a->getData()['vx']['prize'][$ai['vx_n']]); + $nagrtxt .= $a->getData()['vx']['prize'][$ai['vx_n']] . $a->getData()['vx']['prize'][0]; } elseif ( //Сундуки трупожора snt in_array($_GET['nagr'], [31, 32, 33, 34, 35]) && in_array($ai['snt_n'], [0, 1, 2, 3, 4]) && $ai['klassnt'] > $ai['snt_n'] ) { $ai['snt_n'] += 1; - $u->rangup($u->info['id'], $ai['snt_n'], 'snt'); - Db::sql('update users set money2 = money2 + ? where id = ?', - [$achievement_data['snt']['prize'][$ai['snt_n']], $u->info['id']]); - $nagrtxt .= $achievement_data['snt']['prize'][$ai['snt_n']] . $achievement_data['snt']['prize'][0]; + $a->updateTier('snt_n'); + $u->addEkr($a->getData()['snt']['prize'][$ai['snt_n']]); + $nagrtxt .= $a->getData()['snt']['prize'][$ai['snt_n']] . $a->getData()['snt']['prize'][0]; } elseif ( //Руны 8 лвл. rp in_array($_GET['nagr'], [41, 42, 43, 44, 45]) && in_array($ai['rp_n'], [0, 1, 2, 3, 4]) && $ai['klasrp'] > $ai['rp_n'] ) { $ai['rp_n'] += 1; - $u->rangup($u->info['id'], $ai['rp_n'], 'rp'); - $i = 0; - while ($i < $achievement_data['rp']['prize'][$ai['rp_n']]) { - $u->addItem(10038, $u->info['id'], ''); - $i++; - } - $nagrtxt .= 'Плохие Заготовки X' . $achievement_data['rp']['prize'][$ai['rp_n']]; + $a->updateTier('rp_n'); + $a->givePrizeItems(10038, 'rp'); + $nagrtxt .= 'Плохие Заготовки X' . $a->getData()['rp']['prize'][$ai['rp_n']]; } elseif ( //Руны 9 лвл. rn in_array($_GET['nagr'], [51, 52, 53, 54, 55]) && in_array($ai['rn_n'], [0, 1, 2, 3, 4]) && $ai['klasrn'] > $ai['rn_n'] ) { $ai['rn_n'] += 1; - $u->rangup($u->info['id'], $ai['rn_n'], 'rn'); - $i = 0; - while ($i < $achievement_data['rn']['prize'][$ai['rn_n']]) { - $u->addItem(10039, $u->info['id'], ''); - $i++; - } - $nagrtxt .= 'Нормальные Заготовки X' . $achievement_data['rn']['prize'][$ai['rn_n']]; + $a->updateTier('rn_n'); + $a->givePrizeItems(10039, 'rn'); + $nagrtxt .= 'Нормальные Заготовки X' . $a->getData()['rn']['prize'][$ai['rn_n']]; } elseif ( //Руны 10 лвл. rb in_array($_GET['nagr'], [61, 62, 63, 64, 65]) && in_array($ai['rb_n'], [0, 1, 2, 3, 4]) && $ai['klasrb'] > $ai['rb_n'] ) { $ai['rb_n'] += 1; - $u->rangup($u->info['id'], $ai['rb_n'], 'rb'); - $i = 0; - while ($i < $achievement_data['rb']['prize'][$ai['rb_n']]) { - $u->addItem(10040, $u->info['id'], ''); - $i++; - } - $nagrtxt .= 'Идеальные Заготовки X' . $achievement_data['rb']['prize'][$ai['rb_n']]; + $a->updateTier('rb_n'); + $a->givePrizeItems(10040, 'rb'); + $nagrtxt .= 'Идеальные Заготовки X' . $a->getData()['rb']['prize'][$ai['rb_n']]; } elseif ( //Героик pg in_array($_GET['nagr'], [71, 72, 73, 74, 75]) && in_array($ai['pg_n'], [0, 1, 2, 3, 4]) && $ai['klaspg'] > $ai['pg_n'] ) { $ai['pg_n'] += 1; - $u->rangup($u->info['id'], $ai['pg_n'], 'pg'); - $i = 0; - while ($i < $achievement_data['pg']['prize'][$ai['pg_n']]) { - $u->addItem(10020, $u->info['id'], ''); - $i++; - } - $nagrtxt .= 'Жетон Успеха X' . $achievement_data['pg']['prize'][$ai['pg_n']]; + $a->updateTier('pg_n'); + $a->givePrizeItems(10020, 'pg'); + $nagrtxt .= 'Жетон Успеха X' . $a->getData()['pg']['prize'][$ai['pg_n']]; } elseif ( //Продать бабушке найденные вещи в пещере bv in_array($_GET['nagr'], [81, 82, 83, 84, 85]) && in_array($ai['bv_n'], [0, 1, 2, 3, 4]) && $ai['klasbv'] > $ai['bv_n'] ) { $ai['bv_n'] += 1; - $u->rangup($u->info['id'], $ai['bv_n'], 'bv'); - Db::sql('update users set money = money + ? where id = ?', - [$achievement_data['bv']['prize'][$ai['bv_n']], $u->info['id']]); - $nagrtxt .= $achievement_data['bv']['prize'][$ai['bv_n']] . $achievement_data['bv']['prize'][0]; + $a->updateTier('bv_n'); + $u->addKr($a->getData()['bv']['prize'][$ai['bv_n']]); + $nagrtxt .= $a->getData()['bv']['prize'][$ai['bv_n']] . $a->getData()['bv']['prize'][0]; } elseif ( //Клан вар kw in_array($_GET['nagr'], [91, 92, 93, 94, 95]) && in_array($ai['kw_n'], [0, 1, 2, 3, 4]) && $ai['klaskw'] > $ai['kw_n'] ) { $ai['kw_n'] += 1; - $u->rangup($u->info['id'], $ai['kw_n'], 'kw'); - $i = 0; - while ($i < $achievement_data['kw']['prize'][$ai['kw_n']]) { - $u->addItem(4917, $u->info['id'], ''); - $i++; - } - $nagrtxt .= 'Клановый опыт +50000 X' . $achievement_data['kw']['prize'][$ai['kw_n']]; + $a->updateTier('kw_n'); + $a->givePrizeItems(4917, 'kw'); + $nagrtxt .= 'Клановый опыт +50000 X' . $a->getData()['kw']['prize'][$ai['kw_n']]; } elseif ( //Башня смерти задание bs in_array($_GET['nagr'], [101, 102, 103, 104, 105]) && in_array($ai['bs_n'], [0, 1, 2, 3, 4]) && $ai['klasbs'] > $ai['bs_n'] ) { $ai['bs_n'] += 1; - $u->rangup($u->info['id'], $ai['bs_n'], 'bs'); - Db::sql('update users set money2 = money2 + ? where id = ?', - [$achievement_data['bs']['prize'][$ai['bs_n']], $u->info['id']]); - $nagrtxt .= $achievement_data['bs']['prize'][$ai['bs_n']] . $achievement_data['bs']['prize'][0]; + $a->updateTier('bs_n'); + $u->addEkr($a->getData()['bs']['prize'][$ai['bs_n']]); + $nagrtxt .= $a->getData()['bs']['prize'][$ai['bs_n']] . $a->getData()['bs']['prize'][0]; } elseif ( //Турниры победы trn in_array($_GET['nagr'], [111, 112, 113, 114, 115]) && in_array($ai['trn_n'], [0, 1, 2, 3, 4]) && $ai['klastrn'] > $ai['trn_n'] ) { $ai['trn_n'] += 1; - $u->rangup($u->info['id'], $ai['trn_n'], 'trn'); - Db::sql('update users set money2 = money2 + ? where id = ?', - [$achievement_data['trn']['prize'][$ai['trn_n']], $u->info['id']]); - $nagrtxt .= $achievement_data['trn']['prize'][$ai['trn_n']] . $achievement_data['trn']['prize'][0]; + $a->updateTier('trn_n'); + $u->addEkr($a->getData()['trn']['prize'][$ai['trn_n']]); + $nagrtxt .= $a->getData()['trn']['prize'][$ai['trn_n']] . $a->getData()['trn']['prize'][0]; } + //Тоже бы вынести в класс чата. + Db::sql('insert into chat (new, city, room, `to`, `text`, `time`, type) values (?,?,?,?,?,?,?)', + [1, $u->info['city'], $u->info['room'], $u->info['login'], $nagrtxt, -1, 6]); - Db::sql('insert into chat (new, city, room, login, `to`, `text`, `time`, type, toChat) values (?,?,?,?,?,?,?,?,?)', - [1, $u->info['city'], $u->info['room'], $u->info['login'], $nagrtxt, -1, 6, 0]); - //------------- -} -function drawSunduk($nagr, $whatInside, $tier) -{ - return vsprintf('Сундук', - [ - "location.href='\main.php?titul&nagr=$nagr'", - "top.hi(this, 'Сундук $tier ранга
Содержит:
$whatInside
', event, 2, 0, 1, 1, 'max-width:307px')", - "top.hic();", - "top.hic();", - "https://img.new-combats.com/i/titul/nagr$tier.gif" - ]); } -$data = null; -foreach ($achievement_data as $key => $value) { - $data .= '

' . $ai['name' . $key] . '

'; - $data .= '' . $value[$key]['quest'] . ''; - $data .= 'Сейчас у Вас Ранг: ' . $ai['klas' . $key] . ''; - $data .= 'Количество выполнений: ' . $ai[$key] . ' =' . $ai['klasP' . $key] . '%'; - $data .= table([ - [TIERS, 1, 2, 3, 4, 5], - $value[$key]['check'], - array_merge([PRIZE], $value[$key]['prize']) - ], 'prizelist', true); - # If has new tier, AND only first 5 tiers AND prize is set. - if ( - $ai['klas' . $key] > $ai[$key . '_n'] && - in_array($ai[$key . '_n'], [0, 1, 2, 3, 4]) && - !empty($value[$key]['prize']) && - !empty($value[$key]['startlink']) - ) { - $data .= '
' . PRIZE . ':
'; - if (in_array($value[$key]['prize'][0], ['екр.', 'кр.'])) { - $sundukName = $value[$key]['prize'][$ai[$key . '_n'] + 1] . $value[$key]['prize'][0]; - } else { - $sundukName = $value[$key]['prize'][0] . $value[$key]['prize'][$ai[$key . '_n'] + 1]; - } - - $data .= drawSunduk( - $ai[$key . '_n'] + $value[$key]['startlink'], - $sundukName, - $ai[$key . '_n'] + $value[$key]['startlink'] - ); - } - $data .= '
'; -} ?>