battles/config.php

221 lines
9.3 KiB
PHP
Raw Normal View History

2018-01-28 16:40:49 +00:00
<?php
/**
* Copyright (c) 2018.
* Author: Igor Barkov <lopar.4ever@gmail.com>
* Project name: Battles-Game
*/
if (empty($_SESSION['uid']) && $_SERVER['REQUEST_URI'] != "/enter.php") {
header("Location: index.php");
exit;
}
2018-01-28 16:40:49 +00:00
ini_set('display_errors', 'On');
error_reporting(E_ALL);
define("GAMEDOMAIN", "battles.lan");
2019-01-14 20:58:18 +00:00
/*
2020-06-23 11:31:57 +00:00
* Запрещаем кэшировать
2019-01-14 20:58:18 +00:00
*/
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
/**
* Классы для работы с базой данных.
*/
require_once 'classes/Database/Mysql.php';
require_once 'classes/Database/Exception.php';
require_once 'classes/Database/Statement.php';
require_once 'classes/Database/db.php';
require_once 'classes/Battles/Database/DBPDO.php';
/**
* Автозагрузка классов с учётом неймспейсов.
*/
spl_autoload_register(function ($className) {
$fileName = __DIR__ . '/classes/' . str_replace('\\', '/', $className . '.php');
if (file_exists($fileName)) {
require_once $fileName;
}
});
trait Config
{
// Для нападалок. Сперва комнаты в которых нельзя напасть, потом персонажи на которых нельзя напасть.
public static $unkilable = [
'rooms' => [620, 621, 1051, 1052],
'users' => [10962, 10964, 10965],
];
// Неизвестная херня.
public static $canalenters = [620];
public static $caverooms = [621];
public static $userslots = ['sergi', 'kulon', 'perchi', 'weap', 'bron', 'r1', 'r2', 'r3', 'helm', 'shit', 'boots', 'rybax', 'plaw', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'm9', 'm10'];
// Что-то связанное с магией.
public static $elem_align = [
"a" => ["a" => "1", "e" => "0", "f" => "0.5", "w" => "0.5"],
"e" => ["a" => "0", "e" => "1", "f" => "0.5", "w" => "0.5"],
"f" => ["a" => "0.5", "e" => "0.5", "f" => "1", "w" => "0"],
"w" => ["a" => "0.5", "e" => "0.5", "f" => "0", "w" => "1"],
];
public static $elem_bonus = [
"a" => ["a" => "1", "e" => "0.75", "f" => "1.25", "w" => "1"],
"e" => ["a" => "1.25", "e" => "1", "f" => "1", "w" => "0.75"],
"f" => ["a" => "0.75", "e" => "1", "f" => "1", "w" => "1.25"],
"w" => ["a" => "1", "e" => "1.25", "f" => "0.75", "w" => "1"],
];
//Для кланов
public static $clan_register_cost = 10000; //стоимость
public static $clan_register_lock = 1; //запрет на регистрацию
//Банк
public static $bank_commission = 0.05; //5%
// Старая таблица опыта
public static $exptable = [
0 => [0, 0, 0, 0, 0, 20],
20 => [1, 0, 0, 0, 0, 45],
45 => [1, 0, 0, 2, 0, 75],
75 => [1, 0, 0, 4, 0, 110],
110 => [3, 1, 1, 8, 1, 160], # Это первый уровень
160 => [1, 0, 0, 2, 0, 215],
215 => [1, 0, 0, 2, 0, 280],
280 => [1, 0, 0, 4, 0, 350],
350 => [1, 0, 0, 8, 0, 410],
410 => [3, 1, 1, 16, 1, 530], # Это второй уровень
530 => [1, 0, 0, 8, 0, 670],
670 => [1, 0, 0, 12, 0, 830],
830 => [1, 0, 0, 16, 0, 950],
950 => [1, 0, 0, 24, 0, 1100],
1100 => [1, 0, 0, 32, 0, 1300],
1300 => [3, 1, 1, 40, 1, 1450], # Это третий уровень
1450 => [1, 0, 0, 10, 0, 1650],
1650 => [1, 0, 0, 20, 0, 1850],
1850 => [1, 0, 0, 30, 0, 2050],
2050 => [1, 0, 0, 40, 0, 2200],
2200 => [1, 0, 0, 50, 0, 2500],
2500 => [5, 1, 1, 70, 1, 2900], # Это четвёртый уровень
2900 => [1, 0, 0, 10, 0, 3350],
3350 => [1, 0, 0, 20, 0, 3800],
3800 => [1, 0, 0, 30, 0, 4200],
4200 => [1, 0, 0, 40, 0, 4600],
4600 => [1, 0, 0, 50, 0, 5000],
5000 => [3, 1, 1, 80, 1, 6000], # Это пятый уровень
6000 => [1, 0, 0, 15, 0, 7000],
7000 => [1, 0, 0, 30, 0, 8000],
8000 => [1, 0, 0, 40, 0, 9000],
9000 => [1, 0, 0, 50, 0, 10000],
10000 => [1, 0, 0, 40, 0, 11000],
11000 => [1, 0, 0, 50, 0, 12000],
12000 => [1, 0, 0, 60, 0, 12500],
12500 => [3, 1, 1, 90, 1, 14000], # Это шестой уровень
14000 => [1, 0, 0, 20, 0, 15500],
15500 => [1, 0, 0, 30, 0, 17000],
17000 => [1, 0, 0, 50, 0, 19000],
19000 => [1, 0, 0, 55, 0, 21000],
21000 => [1, 0, 0, 50, 0, 23000],
23000 => [1, 0, 0, 55, 0, 27000],
27000 => [1, 0, 0, 50, 0, 30000],
30000 => [5, 1, 1, 100, 1, 60000], # Это седьмой уровень
60000 => [1, 0, 0, 100, 0, 75000],
75000 => [1, 0, 0, 100, 0, 150000],
150000 => [1, 0, 0, 150, 0, 175000],
175000 => [1, 0, 0, 50, 0, 200000],
200000 => [1, 0, 0, 100, 0, 225000],
225000 => [1, 0, 0, 50, 0, 250000],
250000 => [1, 0, 0, 100, 0, 260000],
260000 => [1, 0, 0, 50, 0, 280000],
280000 => [1, 0, 0, 100, 0, 300000],
300000 => [5, 1, 1, 700, 1, 1500000], # Это восьмой уровень
1500000 => [1, 0, 0, 500, 0, 1750000],
1750000 => [1, 0, 0, 200, 0, 2000000],
2000000 => [1, 0, 0, 300, 0, 2175000],
2175000 => [1, 0, 0, 100, 0, 2300000],
2300000 => [1, 0, 0, 100, 0, 2400000],
2400000 => [1, 0, 0, 100, 0, 2500000],
2500000 => [1, 0, 0, 200, 0, 2600000],
2600000 => [1, 0, 0, 100, 0, 2800000],
2800000 => [1, 0, 0, 200, 0, 3000000],
3000000 => [5, 1, 2, 1000, 1, 6000000], # Это девятый уровень
6000000 => [1, 0, 0, 200, 0, 6500000],
6500000 => [1, 0, 0, 250, 0, 7500000],
7500000 => [1, 0, 0, 200, 0, 8500000],
8500000 => [1, 0, 0, 250, 0, 9000000],
9000000 => [1, 0, 0, 400, 0, 9250000],
9250000 => [1, 0, 0, 250, 0, 9500000],
9500000 => [1, 0, 0, 400, 0, 9750000],
9750000 => [1, 0, 0, 350, 0, 9900000],
9900000 => [1, 0, 0, 500, 0, 10000000],
10000000 => [9, 1, 3, 2000, 1, 13000000], # Это десятый уровень
13000000 => [2, 0, 0, 200, 0, 14000000],
14000000 => [2, 0, 0, 200, 0, 15000000],
15000000 => [2, 0, 0, 200, 0, 16000000],
16000000 => [2, 0, 0, 200, 0, 17000000],
17000000 => [2, 0, 0, 200, 0, 17500000],
17500000 => [2, 0, 0, 200, 0, 18000000],
18000000 => [2, 0, 0, 200, 0, 19000000],
19000000 => [2, 0, 0, 200, 0, 19500000],
19500000 => [2, 0, 0, 200, 0, 20000000],
20000000 => [2, 0, 0, 250, 0, 30000000],
30000000 => [2, 0, 0, 200, 0, 32000000],
32000000 => [2, 0, 0, 250, 0, 34000000],
34000000 => [2, 0, 0, 200, 0, 35000000],
35000000 => [2, 0, 0, 250, 0, 36000000],
36000000 => [2, 0, 0, 200, 0, 38000000],
38000000 => [2, 0, 0, 250, 0, 40000000],
40000000 => [2, 0, 0, 200, 0, 42000000],
42000000 => [2, 0, 0, 250, 0, 44000000],
44000000 => [2, 0, 0, 350, 0, 47000000],
47000000 => [2, 0, 0, 300, 0, 50000000],
50000000 => [2, 0, 0, 350, 0, 52000000],
52000000 => [10, 1, 3, 3000, 1, 58000000], # Это одиннадцатый уровень
58000000 => [1, 0, 0, 350, 0, 65000000],
65000000 => [1, 0, 0, 300, 0, 72000000],
72000000 => [1, 0, 0, 350, 0, 77000000],
77000000 => [1, 0, 0, 350, 0, 82000000],
82000000 => [1, 0, 0, 300, 0, 87000000],
87000000 => [1, 0, 0, 350, 0, 92000000],
92000000 => [1, 0, 0, 350, 0, 100000000],
100000000 => [1, 0, 0, 350, 0, 120000000],
120000000 => [2, 0, 0, 400, 0, 140000000],
140000000 => [2, 0, 0, 400, 0, 160000000],
160000000 => [2, 0, 0, 600, 0, 180000000],
180000000 => [2, 0, 0, 400, 0, 210000000],
210000000 => [2, 0, 0, 400, 0, 240000000],
240000000 => [10, 2, 4, 5000, 1, 260000000], # Это двеннадцатый уровень
260000000 => [2, 0, 0, 400, 0, 320000000],
320000000 => [2, 0, 0, 400, 0, 400000000],
400000000 => [3, 0, 0, 600, 0, 455000000],
455000000 => [2, 0, 0, 150, 0, 510000000],
510000000 => [2, 0, 0, 100, 0, 600000000],
600000000 => [2, 0, 0, 300, 0, 750000000],
750000000 => [5, 0, 0, 700, 0, 770000000],
770000000 => [1, 0, 0, 400, 0, 815000000],
815000000 => [1, 0, 0, 200, 0, 860000000],
860000000 => [1, 0, 0, 600, 0, 1000000000],
1000000000 => [1, 0, 0, 300, 0, 1100000000],
1100000000 => [1, 0, 0, 450, 0, 1250000000],
1250000000 => [1, 0, 0, 450, 0, 1500000000],
1500000000 => [10, 1, 5, 8000, 1, 9999999999], # Это тринадцатый уровень
];
public static $cavedata = [621 => ['x1' => 6, 'y1' => 11, 'dir1' => 1, 'x2' => 10, 'y2' => 8, 'dir2' => 1, 'x3' => 20, 'y3' => 4, 'dir3' => 1, 'x4' => 10, 'y4' => 10, 'dir4' => 1, 'delay' => 360, 'name1' => 'Проклятый Рудник', 'name2' => 'Проклятого Рудника']];
//DB
protected static $db = [
'host' => '192.168.20.5',
'name' => 'battles',
'user' => 'battles',
'password' => 'bottle-neck-horse',
'port' => 32101,
'charset' => 'utf8',
];
}