| @@ -0,0 +1,1139 @@ | |||
| 1 | + | <?php | |
| 2 | + | if (!defined('ZNOTE_OS')) { | |
| 3 | + | $isWindows = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'); | |
| 4 | + | define('ZNOTE_OS', ($isWindows) ? 'WINDOWS' : 'LINUX'); | |
| 5 | + | } | |
| 6 | + | ||
| 7 | + | // Optional item browser page. | |
| 8 | + | $config['items'] = false; | |
| 9 | + | ||
| 10 | + | // Server engine: TFS_02, TFS_03, OTHIRE, TFS_10, TFS_16, CANARY or BLACKTEK. | |
| 11 | + | $config['ServerEngine'] = 'TFS_10'; | |
| 12 | + | $config['CustomVersion'] = false; | |
| 13 | + | ||
| 14 | + | // Maintenance mode. Both are editable from Admin Panel > Settings, which is | |
| 15 | + | // the normal way to use them - visitors see the message, admins keep full | |
| 16 | + | // access so you can still work on the site while it is closed. | |
| 17 | + | $config['maintenance'] = false; | |
| 18 | + | $config['maintenance_message'] = 'The website is down for maintenance. Please come back shortly.'; | |
| 19 | + | ||
| 20 | + | $config['site_title'] = 'ZnoteX'; | |
| 21 | + | $config['site_title_context'] = 'Because open communities are good communities. :3'; | |
| 22 | + | $config['site_url'] = "https://opengamescommunity.com"; | |
| 23 | + | ||
| 24 | + | // Server data folder path, without trailing slash. | |
| 25 | + | $config['server_path'] = ''; | |
| 26 | + | ||
| 27 | + | // -------- \\ | |
| 28 | + | // DATABASE \\ | |
| 29 | + | // -------- \\ | |
| 30 | + | ||
| 31 | + | $config['sqlUser'] = 'tfs13'; | |
| 32 | + | $config['sqlPassword'] = 'tfs13'; | |
| 33 | + | $config['sqlDatabase'] = 'tfs13'; | |
| 34 | + | $config['sqlHost'] = '127.0.0.1'; | |
| 35 | + | ||
| 36 | + | // -------------------------- \\ | |
| 37 | + | // CORE WEBSITE SETTINGS \\ | |
| 38 | + | // -------------------------- \\ | |
| 39 | + | ||
| 40 | + | $config['client'] = 1098; | |
| 41 | + | $config['client_download'] = 'http://tibiaclient.otslist.eu/download/tibia'. $config['client'] .'.exe'; | |
| 42 | + | $config['client_download_linux'] = 'http://tibiaclient.otslist.eu/download/tibia'. $config['client'] .'.tgz'; | |
| 43 | + | $config['downloads'] = array( | |
| 44 | + | 'entries' => array( | |
| 45 | + | array('key' => 'windows_client', 'label' => 'Windows Client', 'section' => 'official', 'enabled' => true, 'url' => '', 'image' => '', 'description' => ''), | |
| 46 | + | array('key' => 'linux_client', 'label' => 'Linux Client', 'section' => 'unsupported', 'enabled' => true, 'url' => '', 'image' => '', 'description' => ''), | |
| 47 | + | array('key' => 'macos_client', 'label' => 'MacOS Client', 'section' => 'unsupported', 'enabled' => false, 'url' => '', 'image' => '', 'description' => ''), | |
| 48 | + | array('key' => 'android_client', 'label' => 'Android Client', 'section' => 'unsupported', 'enabled' => false, 'url' => '', 'image' => '', 'description' => ''), | |
| 49 | + | array('key' => 'ios_client', 'label' => 'iOS Client', 'section' => 'unsupported', 'enabled' => false, 'url' => '', 'image' => '', 'description' => ''), | |
| 50 | + | array('key' => 'bot', 'label' => 'Bot', 'section' => 'tools', 'enabled' => false, 'url' => '', 'image' => '', 'description' => ''), | |
| 51 | + | array('key' => 'minimap', 'label' => 'Minimap', 'section' => 'tools', 'enabled' => false, 'url' => '', 'image' => '', 'description' => ''), | |
| 52 | + | array('key' => 'custom_1', 'label' => 'Custom Download 1', 'section' => 'custom', 'enabled' => false, 'url' => '', 'image' => '', 'description' => ''), | |
| 53 | + | array('key' => 'custom_2', 'label' => 'Custom Download 2', 'section' => 'custom', 'enabled' => false, 'url' => '', 'image' => '', 'description' => ''), | |
| 54 | + | array('key' => 'custom_3', 'label' => 'Custom Download 3', 'section' => 'custom', 'enabled' => false, 'url' => '', 'image' => '', 'description' => ''), | |
| 55 | + | array('key' => 'custom_4', 'label' => 'Custom Download 4', 'section' => 'custom', 'enabled' => false, 'url' => '', 'image' => '', 'description' => ''), | |
| 56 | + | array('key' => 'custom_5', 'label' => 'Custom Download 5', 'section' => 'custom', 'enabled' => false, 'url' => '', 'image' => '', 'description' => ''), | |
| 57 | + | ), | |
| 58 | + | ); | |
| 59 | + | ||
| 60 | + | // Editable from Admin Panel > Settings > Content. Starts with a few | |
| 61 | + | // generic questions about the site itself; replace them with whatever | |
| 62 | + | // fits your server. | |
| 63 | + | $config['faq'] = array( | |
| 64 | + | 'entries' => array( | |
| 65 | + | array( | |
| 66 | + | 'question' => 'What is this website?', | |
| 67 | + | 'answer' => 'This is the official website for our Open Tibia server, built with ZnoteX. Here you can create an account, download the client, check the highscores, read the news and manage everything about your characters.', | |
| 68 | + | ), | |
| 69 | + | array( | |
| 70 | + | 'question' => 'How do I start playing?', | |
| 71 | + | 'answer' => 'Download the client from the Downloads page, create a free account, create a character, then log in with the client using your account name and password.', | |
| 72 | + | ), | |
| 73 | + | array( | |
| 74 | + | 'question' => 'I forgot my password, what do I do?', | |
| 75 | + | 'answer' => 'Use the "Forgot password" link on the login page to recover access to your account.', | |
| 76 | + | ), | |
| 77 | + | array( | |
| 78 | + | 'question' => 'How can I support the server?', | |
| 79 | + | 'answer' => 'Check the Shop page - donations there help keep the server running and usually come with in-game rewards.', | |
| 80 | + | ), | |
| 81 | + | array( | |
| 82 | + | 'question' => 'I found a bug or need help, who do I contact?', | |
| 83 | + | 'answer' => 'Open a ticket on the Support page, or reach out to a staff member listed on the Team page.', | |
| 84 | + | ), | |
| 85 | + | ), | |
| 86 | + | ); | |
| 87 | + | ||
| 88 | + | $config['port'] = 7171; | |
| 89 | + | $config['account_create_premdays'] = 0; | |
| 90 | + | ||
| 91 | + | $config['status'] = array( | |
| 92 | + | 'status_check' => false, | |
| 93 | + | 'status_ip' => '127.0.0.1', | |
| 94 | + | 'status_port' => '7171', | |
| 95 | + | ); | |
| 96 | + | ||
| 97 | + | $config['login_web_service'] = true; | |
| 98 | + | $config['gameserver'] = array( | |
| 99 | + | 'ip' => '127.0.0.1', | |
| 100 | + | 'port' => 7172, | |
| 101 | + | 'name' => 'Forgotten' | |
| 102 | + | ); | |
| 103 | + | ||
| 104 | + | // Site language. Falls back to the visitor's browser language, then to this. | |
| 105 | + | $config['language'] = 'en'; | |
| 106 | + | ||
| 107 | + | // Which flags the language switcher offers. Codes: en, pt_br, es, pl, de. | |
| 108 | + | $config['languages_enabled'] = array('en', 'pt_br', 'es', 'pl', 'de'); | |
| 109 | + | ||
| 110 | + | // Show the switcher on every theme. Off means only themes that place it. | |
| 111 | + | $config['language_selector'] = true; | |
| 112 | + | ||
| 113 | + | // Login web service payload: auto, 11, 12, 13 or 15. auto follows $config['client']. | |
| 114 | + | $config['login_protocol'] = 'auto'; | |
| 115 | + | ||
| 116 | + | // Canary only. Must match authType in your config.lua: password or session. | |
| 117 | + | $config['login_auth_type'] = 'password'; | |
| 118 | + | $config['login_session_ttl'] = 86400; | |
| 119 | + | ||
| 120 | + | $config['page_admin_access'] = array( | |
| 121 | + | 'firstaccountName', | |
| 122 | + | 'secondaccountName', | |
| 123 | + | ); | |
| 124 | + | ||
| 125 | + | // Optional least-privilege access to the admin panel. Existing entries in | |
| 126 | + | // page_admin_access remain owners with unrestricted access. Keys are account | |
| 127 | + | // names (or account IDs on OTHIRE); values may contain: auditor, content, | |
| 128 | + | // moderator, support, economy and ops. Example: | |
| 129 | + | // $config['page_admin_roles']['Helper'] = array('moderator', 'support'); | |
| 130 | + | $config['page_admin_roles'] = array(); | |
| 131 | + | ||
| 132 | + | // Outfit images. | |
| 133 | + | $config['show_outfits'] = array( | |
| 134 | + | 'shop' => true, | |
| 135 | + | 'highscores' => true, | |
| 136 | + | 'characterprofile' => true, | |
| 137 | + | 'onlinelist' => true, | |
| 138 | + | 'imageServer' => 'https://outfit-images.ots.me/1285/animoutfit.php' | |
| 139 | + | ); | |
| 140 | + | ||
| 141 | + | // Shop offers are managed from Admin Panel > Shop Manager. | |
| 142 | + | $config['shop'] = array( | |
| 143 | + | 'enabled' => true, | |
| 144 | + | 'loginToView' => false, | |
| 145 | + | 'enableShopConfirmation' => true, | |
| 146 | + | 'showImage' => true, | |
| 147 | + | // Item images. | |
| 148 | + | 'imageServer' => 'items.znote.eu', | |
| 149 | + | 'imageType' => 'gif', | |
| 150 | + | ); | |
| 151 | + | ||
| 152 | + | // Vocation IDs, names and which vocation ID they got promoted from | |
| 153 | + | $config['vocations'] = array( | |
| 154 | + | 0 => array( | |
| 155 | + | 'name' => 'No vocation', | |
| 156 | + | 'fromVoc' => false | |
| 157 | + | ), | |
| 158 | + | 1 => array( | |
| 159 | + | 'name' => 'Sorcerer', | |
| 160 | + | 'fromVoc' => false | |
| 161 | + | ), | |
| 162 | + | 2 => array( | |
| 163 | + | 'name' => 'Druid', | |
| 164 | + | 'fromVoc' => false | |
| 165 | + | ), | |
| 166 | + | 3 => array( | |
| 167 | + | 'name' => 'Paladin', | |
| 168 | + | 'fromVoc' => false | |
| 169 | + | ), | |
| 170 | + | 4 => array( | |
| 171 | + | 'name' => 'Knight', | |
| 172 | + | 'fromVoc' => false | |
| 173 | + | ), | |
| 174 | + | 5 => array( | |
| 175 | + | 'name' => 'Master Sorcerer', | |
| 176 | + | 'fromVoc' => 1 | |
| 177 | + | ), | |
| 178 | + | 6 => array( | |
| 179 | + | 'name' => 'Elder Druid', | |
| 180 | + | 'fromVoc' => 2 | |
| 181 | + | ), | |
| 182 | + | 7 => array( | |
| 183 | + | 'name' => 'Royal Paladin', | |
| 184 | + | 'fromVoc' => 3 | |
| 185 | + | ), | |
| 186 | + | 8 => array( | |
| 187 | + | 'name' => 'Elite Knight', | |
| 188 | + | 'fromVoc' => 4 | |
| 189 | + | ), | |
| 190 | + | // -- MONK (Tibia 2025 summer update) -- | |
| 191 | + | /* | |
| 192 | + | 9 => array( | |
| 193 | + | 'name' => 'Monk', | |
| 194 | + | 'fromVoc' => false | |
| 195 | + | ), | |
| 196 | + | 10 => array( | |
| 197 | + | 'name' => 'Exalted Monk', | |
| 198 | + | 'fromVoc' => 9 | |
| 199 | + | ) | |
| 200 | + | */ | |
| 201 | + | ); | |
| 202 | + | ||
| 203 | + | /* Vocation stat gains per level | |
| 204 | + | - Ordered by vocation ID | |
| 205 | + | - Currently used for admin_skills page. */ | |
| 206 | + | $config['vocations_gain'] = array( | |
| 207 | + | 0 => array( | |
| 208 | + | 'hp' => 5, | |
| 209 | + | 'mp' => 5, | |
| 210 | + | 'cap' => 10 | |
| 211 | + | ), | |
| 212 | + | 1 => array( | |
| 213 | + | 'hp' => 5, | |
| 214 | + | 'mp' => 30, | |
| 215 | + | 'cap' => 10 | |
| 216 | + | ), | |
| 217 | + | 2 => array( | |
| 218 | + | 'hp' => 5, | |
| 219 | + | 'mp' => 30, | |
| 220 | + | 'cap' => 10 | |
| 221 | + | ), | |
| 222 | + | 3 => array( | |
| 223 | + | 'hp' => 10, | |
| 224 | + | 'mp' => 15, | |
| 225 | + | 'cap' => 20 | |
| 226 | + | ), | |
| 227 | + | 4 => array( | |
| 228 | + | 'hp' => 15, | |
| 229 | + | 'mp' => 5, | |
| 230 | + | 'cap' => 25 | |
| 231 | + | ), | |
| 232 | + | 5 => array( | |
| 233 | + | 'hp' => 5, | |
| 234 | + | 'mp' => 30, | |
| 235 | + | 'cap' => 10 | |
| 236 | + | ), | |
| 237 | + | 6 => array( | |
| 238 | + | 'hp' => 5, | |
| 239 | + | 'mp' => 30, | |
| 240 | + | 'cap' => 10 | |
| 241 | + | ), | |
| 242 | + | 7 => array( | |
| 243 | + | 'hp' => 10, | |
| 244 | + | 'mp' => 15, | |
| 245 | + | 'cap' => 20 | |
| 246 | + | ), | |
| 247 | + | 8 => array( | |
| 248 | + | 'hp' => 15, | |
| 249 | + | 'mp' => 5, | |
| 250 | + | 'cap' => 25 | |
| 251 | + | ), | |
| 252 | + | // -- MONK (Tibia 2025 summer update) -- | |
| 253 | + | /* | |
| 254 | + | 9 => array( | |
| 255 | + | 'hp' => 10, | |
| 256 | + | 'mp' => 10, | |
| 257 | + | 'cap' => 25 | |
| 258 | + | ), | |
| 259 | + | 10 => array( | |
| 260 | + | 'hp' => 10, | |
| 261 | + | 'mp' => 10, | |
| 262 | + | 'cap' => 25 | |
| 263 | + | ), | |
| 264 | + | */ | |
| 265 | + | ); | |
| 266 | + | // Town ids and names: (In RME map editor, open map, click CTRL + T to view towns, their names and their IDs. | |
| 267 | + | // townID => 'townName' ex: [1 => 'Rookgaard'] | |
| 268 | + | $config['towns'] = array( | |
| 269 | + | 1 => 'Rookgaard', | |
| 270 | + | 2 => 'Rookgaard Tutorial Island', | |
| 271 | + | 3 => 'Island Of Destiny', | |
| 272 | + | 4 => 'Dawnport', | |
| 273 | + | 5 => "Ab'Dendriel", | |
| 274 | + | 6 => 'Carlin', | |
| 275 | + | 7 => 'Kazordoon', | |
| 276 | + | 8 => 'Thais', | |
| 277 | + | 9 => 'Venore', | |
| 278 | + | 10 => 'Ankrahmun', | |
| 279 | + | 11 => 'Edron', | |
| 280 | + | 12 => 'Farmine', | |
| 281 | + | 13 => 'Darashia', | |
| 282 | + | 14 => 'Liberty Bay', | |
| 283 | + | 15 => 'Port Hope', | |
| 284 | + | 16 => 'Svargrond', | |
| 285 | + | 17 => 'Yalahar', | |
| 286 | + | 18 => 'Gray Beach', | |
| 287 | + | 19 => 'Krailos', | |
| 288 | + | 20 => 'Rathleton', | |
| 289 | + | 21 => 'Roshamuul', | |
| 290 | + | 22 => 'Issavi' | |
| 291 | + | ); | |
| 292 | + | ||
| 293 | + | // ---------------- \\ | |
| 294 | + | // Create Character \\ | |
| 295 | + | // ---------------- \\ | |
| 296 | + | ||
| 297 | + | // Max characters on each account: | |
| 298 | + | $config['max_characters'] = 7; | |
| 299 | + | ||
| 300 | + | // Available character vocation users can choose (specify vocation ID). | |
| 301 | + | // Add 9 for Monk if your server has it: array(1, 2, 3, 4, 9); | |
| 302 | + | $config['available_vocations'] = array(1, 2, 3, 4); | |
| 303 | + | ||
| 304 | + | // Available towns (specify town ids, etc: (1, 2, 3); to display 3 town options (town id 1, 2 and 3). | |
| 305 | + | // Town IDs are the ones from $config['towns'] array | |
| 306 | + | $config['available_towns'] = array(6, 7, 8, 9); | |
| 307 | + | ||
| 308 | + | $config['player'] = array( | |
| 309 | + | 'base' => array( | |
| 310 | + | 'level' => 8, | |
| 311 | + | 'health' => 185, | |
| 312 | + | 'mana' => 90, | |
| 313 | + | 'cap' => 470, | |
| 314 | + | 'soul' => 100 | |
| 315 | + | ), | |
| 316 | + | // Health, mana cap etc are calculated with $config['vocations_gain'] and 'base' values of $config['player'] | |
| 317 | + | 'create' => array( | |
| 318 | + | 'level' => 8, | |
| 319 | + | 'novocation' => array( // Vocation id 0 (No vocation) special settings | |
| 320 | + | 'level' => 1, | |
| 321 | + | 'forceTown' => true, | |
| 322 | + | 'townId' => 1 | |
| 323 | + | ), | |
| 324 | + | 'skills' => array( // See $config['vocations'] for proper vocation names of these IDs | |
| 325 | + | // No vocation | |
| 326 | + | 0 => array( | |
| 327 | + | 'magic' => 0, | |
| 328 | + | 'fist' => 10, | |
| 329 | + | 'club' => 10, | |
| 330 | + | 'axe' => 10, | |
| 331 | + | 'sword' => 10, | |
| 332 | + | 'dist' => 10, | |
| 333 | + | 'shield' => 10, | |
| 334 | + | 'fishing' => 10, | |
| 335 | + | ), | |
| 336 | + | // Sorcerer | |
| 337 | + | 1 => array( | |
| 338 | + | 'magic' => 0, | |
| 339 | + | 'fist' => 10, | |
| 340 | + | 'club' => 10, | |
| 341 | + | 'axe' => 10, | |
| 342 | + | 'sword' => 10, | |
| 343 | + | 'dist' => 10, | |
| 344 | + | 'shield' => 10, | |
| 345 | + | 'fishing' => 10, | |
| 346 | + | ), | |
| 347 | + | // Druid | |
| 348 | + | 2 => array( | |
| 349 | + | 'magic' => 0, | |
| 350 | + | 'fist' => 10, | |
| 351 | + | 'club' => 10, | |
| 352 | + | 'axe' => 10, | |
| 353 | + | 'sword' => 10, | |
| 354 | + | 'dist' => 10, | |
| 355 | + | 'shield' => 10, | |
| 356 | + | 'fishing' => 10, | |
| 357 | + | ), | |
| 358 | + | // Paladin | |
| 359 | + | 3 => array( | |
| 360 | + | 'magic' => 0, | |
| 361 | + | 'fist' => 10, | |
| 362 | + | 'club' => 10, | |
| 363 | + | 'axe' => 10, | |
| 364 | + | 'sword' => 10, | |
| 365 | + | 'dist' => 10, | |
| 366 | + | 'shield' => 10, | |
| 367 | + | 'fishing' => 10, | |
| 368 | + | ), | |
| 369 | + | // Knight | |
| 370 | + | 4 => array( | |
| 371 | + | 'magic' => 0, | |
| 372 | + | 'fist' => 10, | |
| 373 | + | 'club' => 10, | |
| 374 | + | 'axe' => 10, | |
| 375 | + | 'sword' => 10, | |
| 376 | + | 'dist' => 10, | |
| 377 | + | 'shield' => 10, | |
| 378 | + | 'fishing' => 10, | |
| 379 | + | ), | |
| 380 | + | // -- MONK (Tibia 2025 summer update) -- | |
| 381 | + | /* | |
| 382 | + | 9 => array( | |
| 383 | + | 'magic' => 0, | |
| 384 | + | 'fist' => 10, | |
| 385 | + | 'club' => 10, | |
| 386 | + | 'axe' => 10, | |
| 387 | + | 'sword' => 10, | |
| 388 | + | 'dist' => 10, | |
| 389 | + | 'shield' => 10, | |
| 390 | + | 'fishing' => 10, | |
| 391 | + | ), | |
| 392 | + | */ | |
| 393 | + | ), | |
| 394 | + | 'male_outfit' => array( | |
| 395 | + | 'id' => 128, | |
| 396 | + | 'head' => 78, | |
| 397 | + | 'body' => 68, | |
| 398 | + | 'legs' => 58, | |
| 399 | + | 'feet' => 76 | |
| 400 | + | ), | |
| 401 | + | 'female_outfit' => array( | |
| 402 | + | 'id' => 136, | |
| 403 | + | 'head' => 78, | |
| 404 | + | 'body' => 68, | |
| 405 | + | 'legs' => 58, | |
| 406 | + | 'feet' => 76 | |
| 407 | + | ) | |
| 408 | + | ) | |
| 409 | + | ); | |
| 410 | + | ||
| 411 | + | // Minimum allowed letters in character name. Ex: 4 letters: "Kare". | |
| 412 | + | $config['minL'] = 3; | |
| 413 | + | // Maximum allowed letters in character name. Ex: 20 letters: "Bobkareolesofiesberg" | |
| 414 | + | $config['maxL'] = 20; | |
| 415 | + | // Maximum allowed words in character name. Ex: 2 words = "Bob Kare", 3 words: "Bob Arne Kare" as maximum char name words. | |
| 416 | + | $config['maxW'] = 3; | |
| 417 | + | ||
| 418 | + | ////////// | |
| 419 | + | /// Let players sell, buy and bid on characters. | |
| 420 | + | /// Creates a deeper shop economy, encourages players to spend more money in shop for points. | |
| 421 | + | /// Pay to win/progress mechanic, but also lets people who can barely afford points to gain it | |
| 422 | + | /// by leveling characters to sell. It can also discourages illegal/risky third-party account | |
| 423 | + | /// services. Since players can buy officially & support the server, dodgy competitors have to sell for cheaper. | |
| 424 | + | /// Without admin interference this is organic to each individual community economy inflation. | |
| 425 | + | ////////// | |
| 426 | + | $config['shop_auction'] = array( | |
| 427 | + | 'characterAuction' => false, // Enable/disable this system | |
| 428 | + | // Account ID of the account that stores players in the auction. | |
| 429 | + | // Make sure storage account has a very secure password! | |
| 430 | + | 'storage_account_id' => 500000, // Separate secure account ID, not your GM. | |
| 431 | + | 'step' => 5, // Minimum amount someone can raise a bid by | |
| 432 | + | 'step_duration' => 1 * 60 * 60, // When bidding over someone else, extend bid period by 1 hour. | |
| 433 | + | 'lowestLevel' => 20, // Minimum level of sold character | |
| 434 | + | 'lowestPrice' => 10, // Lowest donation points a char can be sold for. | |
| 435 | + | 'biddingDuration' => 1 * 24 * 60 * 60, // = 1 day, 0 to disable bidding | |
| 436 | + | 'deposit' => 10 // Seller has to add 10=10% deposit to auction which he gets back later. | |
| 437 | + | ); | |
| 438 | + | ||
| 439 | + | // Two-factor authentication requires TFS 1.2+. | |
| 440 | + | $config['twoFactorAuthenticator'] = false; | |
| 441 | + | ||
| 442 | + | // Website 2FA v2 - independent of the game engine. Stores everything in | |
| 443 | + | // znote_2fa* tables, so it works the same on TFS, Canary, otHire or BlackTek. | |
| 444 | + | $config['twoFactorV2'] = array( | |
| 445 | + | 'enabled' => false, | |
| 446 | + | 'email_otp_enabled' => true, // Lets a player receive a one-time code by e-mail instead of using an authenticator app. Requires mailserver to be configured. | |
| 447 | + | 'force_admins' => false, // Accounts with panel access (page_admin_access) must set up 2FA v2 before they can use the account. | |
| 448 | + | 'recovery_codes_count' => 10, | |
| 449 | + | 'trusted_device_days' => 30, // "Remember this device" duration. 0 disables the option. | |
| 450 | + | ); | |
| 451 | + | ||
| 452 | + | // Login attempt tracking / IP lockout. Every attempt is logged; an IP that | |
| 453 | + | // fails too many times within the window is locked out for a while. | |
| 454 | + | $config['login_guard'] = array( | |
| 455 | + | 'enabled' => true, | |
| 456 | + | 'threshold' => 5, // Failed attempts allowed in the window below before an IP is locked out. | |
| 457 | + | 'window_minutes' => 15, // How far back failed attempts are counted. | |
| 458 | + | 'lockout_minutes' => 15, // How long a locked-out IP has to wait. | |
| 459 | + | ); | |
| 460 | + | ||
| 461 | + | function getClock($time = false, $format = false, $adjust = true) { | |
| 462 | + | if ($time === false) $time = time(); | |
| 463 | + | $date = "d F Y (H:i)"; | |
| 464 | + | if ($adjust) $adjust = (1 * 3600); | |
| 465 | + | else $adjust = 0; | |
| 466 | + | if ($format) return date($date, $time+$adjust); | |
| 467 | + | else return $time+$adjust; | |
| 468 | + | } | |
| 469 | + | ||
| 470 | + | // --------------- \\ | |
| 471 | + | // SECURITY STUFF \\ | |
| 472 | + | // --------------- \\ | |
| 473 | + | $config['use_token'] = false; | |
| 474 | + | // Set up captcha keys on https://www.google.com/recaptcha/ | |
| 475 | + | $config['use_captcha'] = false; | |
| 476 | + | $config['captcha_site_key'] = "Site key"; | |
| 477 | + | $config['captcha_secret_key'] = "Secret key"; | |
| 478 | + | $config['captcha_use_curl'] = false; // Set to false if you don't have cURL installed, otherwise set it to true | |
| 479 | + | ||
| 480 | + | // Session prefix, if you are hosting multiple sites, make the session name different to avoid conflict. | |
| 481 | + | $config['session_prefix'] = 'znote_'; | |
| 482 | + | ||
| 483 | + | $config['session'] = array( | |
| 484 | + | 'cookie_secure' => null, // If you use Cloudflare or reverse proxy that listen http with apache use true here | |
| 485 | + | 'cookie_samesite' => 'Lax', | |
| 486 | + | 'cookie_path' => '/', | |
| 487 | + | 'cookie_domain' => '', | |
| 488 | + | 'cookie_lifetime' => 0, | |
| 489 | + | ); | |
| 490 | + | ||
| 491 | + | // Runtime and browser hardening. Keep HSTS disabled until the public domain | |
| 492 | + | // is permanently available over HTTPS; browsers remember that choice. | |
| 493 | + | $config['security'] = array( | |
| 494 | + | 'display_errors' => false, | |
| 495 | + | 'show_database_errors' => false, | |
| 496 | + | 'headers_enabled' => true, | |
| 497 | + | 'content_type_options' => true, | |
| 498 | + | 'frame_options' => 'SAMEORIGIN', | |
| 499 | + | 'referrer_policy' => 'strict-origin-when-cross-origin', | |
| 500 | + | 'permissions_policy' => 'camera=(), microphone=(), geolocation=(), browsing-topics=()', | |
| 501 | + | 'content_security_policy' => "frame-ancestors 'self'; object-src 'none'; base-uri 'self'", | |
| 502 | + | 'cross_domain_policy' => true, | |
| 503 | + | 'hsts' => false, | |
| 504 | + | 'hsts_max_age' => 31536000, | |
| 505 | + | 'hsts_include_subdomains' => false, | |
| 506 | + | ); | |
| 507 | + | ||
| 508 | + | // TFS 1.x powergamers and top online | |
| 509 | + | // Before enabling powergamers, make sure that you have added Lua files and added the SQL columns to your server db. | |
| 510 | + | // files can be found at Lua folder. | |
| 511 | + | $config['powergamers'] = array( | |
| 512 | + | 'enabled' => false, // Enable or disable page | |
| 513 | + | 'limit' => 20, // Number of players that it will show. | |
| 514 | + | ); | |
| 515 | + | ||
| 516 | + | $config['toponline'] = array( | |
| 517 | + | 'enabled' => false, // Enable or disable page | |
| 518 | + | 'limit' => 20, // Number of players that it will show. | |
| 519 | + | ); | |
| 520 | + | ||
| 521 | + | // -- HOUSE AUCTION SYSTEM! (TFS 1.x, TFS 1.6 and Canary) | |
| 522 | + | // Not available on OTHIRE, TFS_02 or TFS_03: those schemas have no auction | |
| 523 | + | // columns on `houses`. Canary names them differently (internal_bid, | |
| 524 | + | // bid_end_date, highest_bid, bidder); houseCol()/houseSelect() in | |
| 525 | + | // engine/function/general.php map them, so nothing here changes per engine. | |
| 526 | + | $config['houseConfig'] = array( | |
| 527 | + | 'HouseListDefaultTown' => 8, // Default town id to display when visting house list page page. | |
| 528 | + | 'minimumBidSQM' => 200, // Minimum bid cost on auction (per SQM) | |
| 529 | + | 'auctionPeriod' => 24 * 60 * 60, // 24 hours auction time. | |
| 530 | + | 'housesPerPlayer' => 1, | |
| 531 | + | 'requirePremium' => false, | |
| 532 | + | 'levelToBuyHouse' => 8, | |
| 533 | + | // Instant buy with shop points | |
| 534 | + | 'shopPoints' => array( | |
| 535 | + | 'enabled' => true, | |
| 536 | + | // SQM count => points cost | |
| 537 | + | 'cost' => array( | |
| 538 | + | 1 => 10, | |
| 539 | + | 25 => 15, | |
| 540 | + | 60 => 25, | |
| 541 | + | 100 => 30, | |
| 542 | + | 200 => 40, | |
| 543 | + | 300 => 50, | |
| 544 | + | ), | |
| 545 | + | ), | |
| 546 | + | ); | |
| 547 | + | ||
| 548 | + | // Leave on black square in map and player should get teleported to their selected town. | |
| 549 | + | // If chars get buggy set this position to a beginner location to force players there. | |
| 550 | + | $config['default_pos'] = array( | |
| 551 | + | 'x' => 5, | |
| 552 | + | 'y' => 5, | |
| 553 | + | 'z' => 2, | |
| 554 | + | ); | |
| 555 | + | ||
| 556 | + | $config['war_status'] = array( | |
| 557 | + | 0 => 'Pending', | |
| 558 | + | 1 => 'Accepted', | |
| 559 | + | 2 => 'Rejected', | |
| 560 | + | 3 => 'Canceled', | |
| 561 | + | 4 => 'Ended by kill limit', | |
| 562 | + | 5 => 'Ended', | |
| 563 | + | ); | |
| 564 | + | ||
| 565 | + | /* -- SUB PAGES -- | |
| 566 | + | Some custom layouts/templates have custom pages, they can use | |
| 567 | + | this sub page functionality for that. | |
| 568 | + | */ | |
| 569 | + | $config['allowSubPages'] = true; | |
| 570 | + | ||
| 571 | + | // -------------- \\ | |
| 572 | + | // WEBSITE STUFF \\ | |
| 573 | + | // -------------- \\ | |
| 574 | + | ||
| 575 | + | // News to be displayed per page | |
| 576 | + | $config['news_per_page'] = 5; | |
| 577 | + | ||
| 578 | + | // Enable or disable changelog ticker in news page. | |
| 579 | + | $config['UseChangelogTicker'] = true; | |
| 580 | + | ||
| 581 | + | $config['credits_enabled'] = true; | |
| 582 | + | ||
| 583 | + | $config['queststatus_enabled'] = false; | |
| 584 | + | ||
| 585 | + | $config['contact_info'] = ''; | |
| 586 | + | ||
| 587 | + | // Highscore configuration | |
| 588 | + | $config['highscore'] = array( | |
| 589 | + | 'rows' => 100, | |
| 590 | + | 'rowsPerPage' => 20, | |
| 591 | + | 'ignoreGroupId' => 2, // Ignore this and higher group ids (staff) | |
| 592 | + | ); | |
| 593 | + | ||
| 594 | + | // ONLY FOR TFS 0.2 (TFS 0.3/4 users don't need to care about this, as its fully loaded from db) | |
| 595 | + | $config['house'] = array( | |
| 596 | + | 'house_file' => 'C:\test\Mystic Spirit_0.2.5\data\world\forgotten-house.xml', | |
| 597 | + | 'price_sqm' => '50', // price per house sqm | |
| 598 | + | ); | |
| 599 | + | ||
| 600 | + | $config['delete_character_interval'] = '3 DAY'; // Delay after user character delete request is executed, ex: 1 DAY, 2 HOUR, 3 MONTH etc. | |
| 601 | + | ||
| 602 | + | $config['validate_IP'] = false; | |
| 603 | + | $config['salt'] = false; | |
| 604 | + | ||
| 605 | + | // Use guild logo system | |
| 606 | + | $config['use_guild_logos'] = true; | |
| 607 | + | ||
| 608 | + | // Use country flags | |
| 609 | + | $config['country_flags'] = array( | |
| 610 | + | 'enabled' => true, | |
| 611 | + | 'highscores' => true, | |
| 612 | + | 'onlinelist' => true, | |
| 613 | + | 'characterprofile' => true, | |
| 614 | + | 'server' => 'http://flag.znote.eu' | |
| 615 | + | ); | |
| 616 | + | ||
| 617 | + | // Show advanced inventory data in character profile | |
| 618 | + | $config['EQ_shower'] = array( | |
| 619 | + | 'enabled' => true, | |
| 620 | + | 'equipment' => true, | |
| 621 | + | 'skills' => true, | |
| 622 | + | 'outfits' => true, | |
| 623 | + | // Player storage (storage_value + outfitId) | |
| 624 | + | // used to see if player has outfit. | |
| 625 | + | // see Lua scripts folder for otserv code | |
| 626 | + | 'storage_value' => 10000 | |
| 627 | + | ); | |
| 628 | + | ||
| 629 | + | // Level requirement to create guild? (Just set it to 1 to allow all levels). | |
| 630 | + | $config['create_guild_level'] = 8; | |
| 631 | + | ||
| 632 | + | // Change Gender can be purchased in shop, or perhaps you want to allow everyone to change gender for free? | |
| 633 | + | $config['free_sex_change'] = false; | |
| 634 | + | ||
| 635 | + | // Do you need to have premium account to create a guild? | |
| 636 | + | $config['guild_require_premium'] = true; | |
| 637 | + | ||
| 638 | + | // There is a TFS 1.3 bug related to guild nicks | |
| 639 | + | // https://github.com/otland/forgottenserver/issues/2561 | |
| 640 | + | // So if your using TFS 1.x, you might need to disable guild nicks until the crash has been fixed. | |
| 641 | + | $config['guild_allow_nicknames'] = true; | |
| 642 | + | ||
| 643 | + | $config['guildwar_enabled'] = false; | |
| 644 | + | ||
| 645 | + | // Use htaccess rewrite? (basically this makes website.com/username work instead of website.com/characterprofile.php?name=username | |
| 646 | + | // Linux users needs to enable mod_rewrite php extention to make it work properly, so set it to false if your lost and using Linux. | |
| 647 | + | $config['htwrite'] = true; | |
| 648 | + | ||
| 649 | + | // Unlock all protocol 12 client features? Free premium in config.lua? Then set this to true. | |
| 650 | + | $config['freePremium'] = false; | |
| 651 | + | ||
| 652 | + | // How often do you want highscores (cache) to update? | |
| 653 | + | $config['cache'] = array( | |
| 654 | + | // If you have two instances installed on same server, make each instance prefix unique | |
| 655 | + | 'prefix' => 'znote_', | |
| 656 | + | // 60 * 15; // 15 minutes. | |
| 657 | + | 'lifespan' => 5, | |
| 658 | + | // Store cache in memory/RAM? Requires PHP extension APCu | |
| 659 | + | 'memory' => true | |
| 660 | + | ); | |
| 661 | + | ||
| 662 | + | // Built-in FORUM | |
| 663 | + | // Enable forum, enable guildboards, level to create threads/post in them | |
| 664 | + | // How long do they have to wait to create thread or post? | |
| 665 | + | // How to design/display hidden/closed/sticky threads. | |
| 666 | + | $config['forum'] = array( | |
| 667 | + | 'enabled' => true, | |
| 668 | + | // Images allowed per post. 0 blocks images entirely. | |
| 669 | + | 'maxImagesPerPost' => 1, | |
| 670 | + | 'outfit_avatars' => true, // Show character outfit as forum avatar? | |
| 671 | + | 'player_position' => true, // Show character position? ex: Tutor, Community Manager, God | |
| 672 | + | 'guildboard' => true, | |
| 673 | + | 'level' => 5, | |
| 674 | + | 'cooldownPost' => 1, // 60, | |
| 675 | + | 'cooldownCreate' => 1, // 180, | |
| 676 | + | 'newPostsBumpThreads' => true, | |
| 677 | + | 'hidden' => '<font color="orange">[H]</font>', | |
| 678 | + | 'closed' => '<font color="red">[C]</font>', | |
| 679 | + | 'sticky' => '<font color="green">[S]</font>', | |
| 680 | + | ); | |
| 681 | + | ||
| 682 | + | // Guilds and guild war pages will do lots of queries on bigger databases. | |
| 683 | + | // So its recommended to require login to view them, but you can disable this | |
| 684 | + | // If you don't have any problems with load. | |
| 685 | + | $config['require_login'] = array( | |
| 686 | + | 'guilds' => false, | |
| 687 | + | 'guildwars' => false, | |
| 688 | + | ); | |
| 689 | + | ||
| 690 | + | // IMPORTANT! Write a character name(that exist) that will represent website bans! | |
| 691 | + | // Or remember to create character named "God Website". | |
| 692 | + | // If you don't do this, ban from admin panel won't work properly. | |
| 693 | + | $config['website_char'] = 'God Website'; | |
| 694 | + | ||
| 695 | + | // ---------------- \\ | |
| 696 | + | // ADVANCED STUFF \\ | |
| 697 | + | // ---------------- \\ | |
| 698 | + | // API config | |
| 699 | + | $config['api'] = array( | |
| 700 | + | 'debug' => false, | |
| 701 | + | ); | |
| 702 | + | ||
| 703 | + | // website.com/gallery.php | |
| 704 | + | // website.com/admin/index.php?p=gallery | |
| 705 | + | // we use imgur as image host, and need to register app with them and add client/secret id. | |
| 706 | + | // https://github.com/Znote/ZnoteAAC/wiki/IMGUR-powered-Gallery-page | |
| 707 | + | $config['gallery'] = array( | |
| 708 | + | 'Client Name' => 'ZnoteAAC-Gallery', | |
| 709 | + | 'Client ID' => '4dfcdc4f2cabca6', | |
| 710 | + | 'Client Secret' => '697af737777c99a8c0be07c2f4419aebb2c48ac5' | |
| 711 | + | ); | |
| 712 | + | ||
| 713 | + | // Email Server configurations (SMTP) | |
| 714 | + | /* Please consider using a released stable version of PHPMailer or you may run into issues. | |
| 715 | + | Download PHPMailer: https://github.com/PHPMailer/PHPMailer/releases | |
| 716 | + | Extract to ZnoteX directory (where this config.php file is located) | |
| 717 | + | Rename the folder to "PHPMailer". Then configure this with your SMTP mail settings from your email provider. | |
| 718 | + | */ | |
| 719 | + | $config['mailserver'] = array( | |
| 720 | + | 'register' => false, // Send activation mail | |
| 721 | + | 'accountRecovery' => false, // Recover username or password through mail | |
| 722 | + | 'myaccount_verify_email' => false, // Allow user to verify their email in myaccount page | |
| 723 | + | 'verify_email_points' => 0, // 0 = disabled. Give users points reward for verifying their email | |
| 724 | + | 'host' => "mailserver.znote.eu", // Outgoing mail server host. | |
| 725 | + | 'securityType' => 'ssl', // ssl or tls | |
| 726 | + | 'port' => 465, // SMTP port number - likely to be 465(ssl) or 587(tls) | |
| 727 | + | 'email' => 'noreply@znote.eu', | |
| 728 | + | 'username' => 'noreply@znote.eu', // Likely the same as email | |
| 729 | + | 'password' => 'emailpassword', // The password. | |
| 730 | + | 'debug' => false, // Enable debugging if you have problems and are looking for errors. | |
| 731 | + | 'fromName' => $config['site_title'], | |
| 732 | + | ); | |
| 733 | + | ||
| 734 | + | // Don't touch this unless you know what you are doing. (modifying these (key value) also requires modifications in OT files data/XML/groups.xml). | |
| 735 | + | $config['ingame_positions'] = array( | |
| 736 | + | 1 => 'Player', | |
| 737 | + | 2 => 'Tutor', | |
| 738 | + | 3 => 'Senior Tutor', | |
| 739 | + | 4 => 'Gamemaster', | |
| 740 | + | 5 => 'Community Manager', | |
| 741 | + | 6 => 'God', | |
| 742 | + | ); | |
| 743 | + | ||
| 744 | + | // Enable OS advanced features? false = no, true = yes | |
| 745 | + | $config['os_enabled'] = false; | |
| 746 | + | ||
| 747 | + | // What kind of computer are you hosting this website on? | |
| 748 | + | // Available options: LINUX or WINDOWS | |
| 749 | + | $config['os'] = ZNOTE_OS; // Use 'ZNOTE_OS' to auto-detect | |
| 750 | + | ||
| 751 | + | // Measure how much players are lagging in-game. (Not completed). | |
| 752 | + | $config['ping'] = false; | |
| 753 | + | ||
| 754 | + | // BAN STUFF - Don't touch this unless you know what you are doing. | |
| 755 | + | // You can order the lines the way you want, from top to bottom, in which order you | |
| 756 | + | // wish for them to be displayed in admin panel. Just make sure key[#] represent your description. | |
| 757 | + | $config['ban_type'] = array( | |
| 758 | + | 4 => 'NOTATION_ACCOUNT', | |
| 759 | + | 2 => 'NAMELOCK_PLAYER', | |
| 760 | + | 3 => 'BAN_ACCOUNT', | |
| 761 | + | 5 => 'DELETE_ACCOUNT', | |
| 762 | + | 1 => 'BAN_IPADDRESS', | |
| 763 | + | ); | |
| 764 | + | ||
| 765 | + | // BAN STUFF - Don't touch this unless you know what you are doing. | |
| 766 | + | // You can order the lines the way you want, from top to bot, in which order you | |
| 767 | + | // wish for them to be displayed in admin panel. Just make sure key[#] represent your description. | |
| 768 | + | $config['ban_action'] = array( | |
| 769 | + | 0 => 'Notation', | |
| 770 | + | 1 => 'Name Report', | |
| 771 | + | 2 => 'Banishment', | |
| 772 | + | 3 => 'Name Report + Banishment', | |
| 773 | + | 4 => 'Banishment + Final Warning', | |
| 774 | + | 5 => 'NR + Ban + FW', | |
| 775 | + | 6 => 'Statement Report', | |
| 776 | + | ); | |
| 777 | + | ||
| 778 | + | // Ban reasons, for changes beside default values to work with client, | |
| 779 | + | // you also need to edit sources (https://github.com/otland/forgottenserver/blob/master/src/enums.h#L29) | |
| 780 | + | $config['ban_reason'] = array( | |
| 781 | + | 0 => 'Offensive Name', | |
| 782 | + | 1 => 'Invalid Name Format', | |
| 783 | + | 2 => 'Unsuitable Name', | |
| 784 | + | 3 => 'Name Inciting Rule Violation', | |
| 785 | + | 4 => 'Offensive Statement', | |
| 786 | + | 5 => 'Spamming', | |
| 787 | + | 6 => 'Illegal Advertising', | |
| 788 | + | 7 => 'Off-Topic Public Statement', | |
| 789 | + | 8 => 'Non-English Public Statement', | |
| 790 | + | 9 => 'Inciting Rule Violation', | |
| 791 | + | 10 => 'Bug Abuse', | |
| 792 | + | 11 => 'Game Weakness Abuse', | |
| 793 | + | 12 => 'Using Unofficial Software to Play', | |
| 794 | + | 13 => 'Hacking', | |
| 795 | + | 14 => 'Multi-Clienting', | |
| 796 | + | 15 => 'Account Trading or Sharing', | |
| 797 | + | 16 => 'Threatening Gamemaster', | |
| 798 | + | 17 => 'Pretending to Have Influence on Rule Enforcement', | |
| 799 | + | 18 => 'False Report to Gamemaster', | |
| 800 | + | 19 => 'Destructive Behaviour', | |
| 801 | + | 20 => 'Excessive Unjustified Player Killing', | |
| 802 | + | 21 => 'Spoiling Auction', | |
| 803 | + | ); | |
| 804 | + | ||
| 805 | + | // BAN STUFF | |
| 806 | + | // Ban time duration selection in admin panel | |
| 807 | + | // seconds => description | |
| 808 | + | $config['ban_time'] = array( | |
| 809 | + | 3600 => '1 hour', | |
| 810 | + | 21600 => '6 hours', | |
| 811 | + | 43200 => '12 hours', | |
| 812 | + | 86400 => '1 day', | |
| 813 | + | 259200 => '3 days', | |
| 814 | + | 604800 => '1 week', | |
| 815 | + | 1209600 => '2 weeks', | |
| 816 | + | 2592000 => '1 month', | |
| 817 | + | ); | |
| 818 | + | ||
| 819 | + | /* Store visitor data | |
| 820 | + | Store visitor data in the database, logging every IP visiting site, | |
| 821 | + | and how many times they have visited the site. And sometimes what | |
| 822 | + | they do on the site. | |
| 823 | + | ||
| 824 | + | This helps to prevent POST SPAM (like register 1000 accounts in a few seconds) | |
| 825 | + | and other things which can stress and slow down the server. | |
| 826 | + | ||
| 827 | + | The only downside is that database can get pretty fed up with much IP data | |
| 828 | + | if table never gets flushed once in a while. So I highly recommend you | |
| 829 | + | to configure flush_ip_logs if IPs are logged. | |
| 830 | + | */ | |
| 831 | + | $config['log_ip'] = false; | |
| 832 | + | ||
| 833 | + | // Flush IP logs each configured seconds, 60 * 15 = 15 minutes. | |
| 834 | + | // Set to false to entirely disable ip log flush. | |
| 835 | + | // It is important to flush for optimal performance. | |
| 836 | + | $config['flush_ip_logs'] = 59 * 27; | |
| 837 | + | ||
| 838 | + | /* IP SECURTY REQUIRE: $config['log_ip'] = true; | |
| 839 | + | Configure how tight this security shall be. | |
| 840 | + | Etc: You can max click on anything/refresh page | |
| 841 | + | [max activity] 15 times, within time period 10 | |
| 842 | + | seconds. During time_period, you can also only | |
| 843 | + | register 1 account and 1 character. | |
| 844 | + | */ | |
| 845 | + | $config['ip_security'] = array( | |
| 846 | + | 'time_period' => 10, // In seconds | |
| 847 | + | 'max_activity' => 10, // page clicks/visits | |
| 848 | + | 'max_post' => 6, // register, create, highscore, character search and such actions | |
| 849 | + | 'max_account' => 1, // register | |
| 850 | + | 'max_character' => 1, // create char | |
| 851 | + | 'max_forum_post' => 1, // create threads and post in forum | |
| 852 | + | ); | |
| 853 | + | ||
| 854 | + | // Buy points page. Off hides buypoints.php whichever gateways are configured. | |
| 855 | + | $config['buypoints_enabled'] = true; | |
| 856 | + | ||
| 857 | + | ////////////// | |
| 858 | + | /// PAYPAL /// | |
| 859 | + | ////////////// | |
| 860 | + | // https://www.paypal.com/ | |
| 861 | + | ||
| 862 | + | // Write your paypal address here, and what currency you want to receive money in. | |
| 863 | + | $config['paypal'] = array( | |
| 864 | + | 'enabled' => false, | |
| 865 | + | 'email' => 'edit@me.com', // Example: paypal@mail.com | |
| 866 | + | 'currency' => 'EUR', | |
| 867 | + | 'points_per_currency' => 10, // 1 currency = ? points? [ONLY used to calculate bonuses] | |
| 868 | + | 'success' => "http://".$_SERVER['HTTP_HOST']."/success.php", | |
| 869 | + | 'failed' => "http://".$_SERVER['HTTP_HOST']."/failed.php", | |
| 870 | + | 'ipn' => "http://".$_SERVER['HTTP_HOST']."/ipn.php", | |
| 871 | + | 'showBonus' => true, | |
| 872 | + | ); | |
| 873 | + | ||
| 874 | + | // Configure the "buy now" buttons prices, first write price, then how many points you get. | |
| 875 | + | // Giving some bonus points for higher donations will tempt users to donate more. | |
| 876 | + | $config['paypal_prices'] = array( | |
| 877 | + | // price => points, | |
| 878 | + | 1 => 45, // -10% bonus | |
| 879 | + | 10 => 100, // 0% bonus | |
| 880 | + | 15 => 165, // +10% bonus | |
| 881 | + | 20 => 240, // +20% bonus | |
| 882 | + | 25 => 325, // +30% bonus | |
| 883 | + | 30 => 420, // +40% bonus | |
| 884 | + | ); | |
| 885 | + | ||
| 886 | + | ////////////// | |
| 887 | + | /// STRIPE /// | |
| 888 | + | ////////////// | |
| 889 | + | // https://stripe.com/ | |
| 890 | + | // Uses hosted Checkout. Points are credited only by payment_webhook.php. | |
| 891 | + | $config['stripe'] = array( | |
| 892 | + | 'enabled' => false, | |
| 893 | + | 'test_mode' => true, | |
| 894 | + | 'publishable_key' => '', | |
| 895 | + | 'secret_key' => '', | |
| 896 | + | 'webhook_secret' => '', | |
| 897 | + | 'currency' => 'EUR', | |
| 898 | + | 'points_per_currency' => 10, | |
| 899 | + | 'amount_multiplier' => 100, // 100 for EUR/USD/BRL, 1 for zero-decimal currencies. | |
| 900 | + | 'success' => "http://".$_SERVER['HTTP_HOST']."/success.php", | |
| 901 | + | 'failed' => "http://".$_SERVER['HTTP_HOST']."/failed.php", | |
| 902 | + | 'webhook_url' => "http://".$_SERVER['HTTP_HOST']."/payment_webhook.php?provider=stripe", | |
| 903 | + | 'showBonus' => true, | |
| 904 | + | ); | |
| 905 | + | ||
| 906 | + | //////////////////// | |
| 907 | + | /// MERCADO PAGO /// | |
| 908 | + | //////////////////// | |
| 909 | + | // https://www.mercadopago.com/ | |
| 910 | + | // Uses Checkout Pro preferences. Points are credited only by payment_webhook.php. | |
| 911 | + | $config['mercadopago'] = array( | |
| 912 | + | 'enabled' => false, | |
| 913 | + | 'test_mode' => true, | |
| 914 | + | 'public_key' => '', | |
| 915 | + | 'access_token' => '', | |
| 916 | + | 'webhook_secret' => '', | |
| 917 | + | 'currency' => 'BRL', | |
| 918 | + | 'points_per_currency' => 10, | |
| 919 | + | 'success' => "http://".$_SERVER['HTTP_HOST']."/success.php", | |
| 920 | + | 'failed' => "http://".$_SERVER['HTTP_HOST']."/failed.php", | |
| 921 | + | 'webhook_url' => "http://".$_SERVER['HTTP_HOST']."/payment_webhook.php?provider=mercadopago", | |
| 922 | + | 'showBonus' => true, | |
| 923 | + | ); | |
| 924 | + | ||
| 925 | + | ///////////////// | |
| 926 | + | /// PAGSEGURO /// | |
| 927 | + | ///////////////// | |
| 928 | + | // https://pagseguro.uol.com.br/ | |
| 929 | + | ||
| 930 | + | // Write your pagseguro address here, and what currency you want to receive money in. | |
| 931 | + | $config['pagseguro'] = array( | |
| 932 | + | 'enabled' => false, | |
| 933 | + | 'sandbox' => false, | |
| 934 | + | 'email' => 'edit@me.com', // Example: pagseguro@mail.com | |
| 935 | + | 'token' => '', | |
| 936 | + | 'currency' => 'BRL', | |
| 937 | + | 'product_name' => '', | |
| 938 | + | 'price' => 100, // 1 real | |
| 939 | + | 'ipn' => "http://".$_SERVER['HTTP_HOST']."/pagseguro_ipn.php", | |
| 940 | + | 'urls' => array( | |
| 941 | + | 'www' => 'pagseguro.uol.com.br', | |
| 942 | + | 'ws' => 'ws.pagseguro.uol.com.br', | |
| 943 | + | 'stc' => 'stc.pagseguro.uol.com.br' | |
| 944 | + | ) | |
| 945 | + | ); | |
| 946 | + | ||
| 947 | + | if ($config['pagseguro']['sandbox']) { | |
| 948 | + | $config['pagseguro']['urls'] = array_map(function ($item) { | |
| 949 | + | return str_replace('pagseguro', 'sandbox.pagseguro', $item); | |
| 950 | + | }, $config['pagseguro']['urls']); | |
| 951 | + | } | |
| 952 | + | ||
| 953 | + | ////////////////// | |
| 954 | + | /// PAYGOL SMS /// | |
| 955 | + | ////////////////// | |
| 956 | + | // https://www.paygol.com/ | |
| 957 | + | // !!! Paygol takes 60%~ of the money, and send aprox 40% to your paypal. | |
| 958 | + | // You can configure paygol to send each month, then they will send money | |
| 959 | + | // to you 1 month after receiving 50+ eur. | |
| 960 | + | $config['paygol'] = array( | |
| 961 | + | 'enabled' => false, | |
| 962 | + | 'serviceID' => 86648, // Service ID from paygol.com | |
| 963 | + | 'secretKey' => 'xxxx-xxxx-xxxx-xxxx', // Secret key from paygol.com. Never share your secret key | |
| 964 | + | 'currency' => 'SEK', | |
| 965 | + | 'price' => 20, | |
| 966 | + | 'points' => 20, | |
| 967 | + | 'name' => '20 points', | |
| 968 | + | 'returnURL' => "http://".$_SERVER['HTTP_HOST']."/success.php", | |
| 969 | + | 'cancelURL' => "http://".$_SERVER['HTTP_HOST']."/failed.php" | |
| 970 | + | ); | |
| 971 | + | ||
| 972 | + | ////////////////////////// | |
| 973 | + | /// OTServers.eu voting | |
| 974 | + | // | |
| 975 | + | // Start by creating an account at OTServers.eu and add your server. | |
| 976 | + | // You can find your secret token by logging in on OTServers.eu and go to 'MY SERVER' then 'Encourage players to vote'. | |
| 977 | + | $config['otservers_eu_voting'] = [ | |
| 978 | + | 'enabled' => false, | |
| 979 | + | 'simpleVoteUrl' => '', // This url is used if the player isn't logged in. | |
| 980 | + | 'voteUrl' => 'https://api.otservers.eu/vote_link.php', | |
| 981 | + | 'voteCheckUrl' => 'https://api.otservers.eu/vote_check.php', | |
| 982 | + | 'secretToken' => '', // Enter your secret token. Do not share with anyone! | |
| 983 | + | 'landingPage' => '/voting.php?action=reward', // The user will be redirected to this page after voting | |
| 984 | + | 'points' => '1' // Amount of points to give as reward | |
| 985 | + | ]; | |
| 986 | + | ||
| 987 | + | // -------------------- \\ | |
| 988 | + | // LARGE OPTIONAL LISTS \\ | |
| 989 | + | // -------------------- \\ | |
| 990 | + | ||
| 991 | + | // Achievements example. Add more entries here if achievements are enabled. | |
| 992 | + | $config['Ach'] = false; | |
| 993 | + | $config['achievements'] = array( | |
| 994 | + | 35000 => array( | |
| 995 | + | 'First Dragon', | |
| 996 | + | 'Rumours say that you will never forget your first Dragon', | |
| 997 | + | 'points' => '1', | |
| 998 | + | 'img' => 'https://i.imgur.com/Nk2XDge.gif', | |
| 999 | + | ), | |
| 1000 | + | ); | |
| 1001 | + | ||
| 1002 | + | ||
| 1003 | + | // ------------------- \\ | |
| 1004 | + | // CUSTOM SERVER STUFF \\ | |
| 1005 | + | // ------------------- \\ | |
| 1006 | + | // Enable / disable Questlog function (true / false) | |
| 1007 | + | $config['EnableQuests'] = false; | |
| 1008 | + | ||
| 1009 | + | // array for filling questlog (Questid, max value, name, end of the quest fill 1 for the last part 0 for all others) | |
| 1010 | + | $config['quests'] = array( | |
| 1011 | + | array(1501,100,"Killing in the Name of",0), | |
| 1012 | + | array(1502,150,"Killing in the Name of",0), | |
| 1013 | + | array(65001,100,"Killing in the Name of",0), | |
| 1014 | + | array(65002,150,"Killing in the Name of",0), | |
| 1015 | + | array(65003,300,"Killing in the Name of",0), | |
| 1016 | + | array(65004,3,"Killing in the Name of",0), | |
| 1017 | + | array(65005,300,"Killing in the Name of",0), | |
| 1018 | + | array(65006,150,"Killing in the Name of",0), | |
| 1019 | + | array(65007,200,"Killing in the Name of",0), | |
| 1020 | + | array(65008,300,"Killing in the Name of",0), | |
| 1021 | + | array(65009,300,"Killing in the Name of",0), | |
| 1022 | + | array(65010,300,"Killing in the Name of",0), | |
| 1023 | + | array(65011,300,"Killing in the Name of",0), | |
| 1024 | + | array(65012,300,"Killing in the Name of",0), | |
| 1025 | + | array(65013,300,"Killing in the Name of",0), | |
| 1026 | + | array(65014,300,"Killing in the Name of",1), | |
| 1027 | + | array(12110,2,"The Inquisition",0), | |
| 1028 | + | array(12111,7,"The Inquisition",0), | |
| 1029 | + | array(12112,3,"The Inquisition",0), | |
| 1030 | + | array(12113,6,"The Inquisition",0), | |
| 1031 | + | array(12114,3,"The Inquisition",0), | |
| 1032 | + | array(12115,3,"The Inquisition",0), | |
| 1033 | + | array(12116,3,"The Inquisition",0), | |
| 1034 | + | array(12117,5,"The Inquisition",1), | |
| 1035 | + | array(330,3,"Sam's Old Backpack",1), | |
| 1036 | + | array(12121,3,"The Ape City",0), | |
| 1037 | + | array(12122,5,"The Ape City",0), | |
| 1038 | + | array(12123,3,"The Ape City",0), | |
| 1039 | + | array(12124,3,"The Ape City",0), | |
| 1040 | + | array(12125,3,"The Ape City",0), | |
| 1041 | + | array(12126,3,"The Ape City",0), | |
| 1042 | + | array(12127,4,"The Ape City",0), | |
| 1043 | + | array(12128,3,"The Ape City",0), | |
| 1044 | + | array(12129,3,"The Ape City",1), | |
| 1045 | + | array(12101,1,"The Ancient Tombs",0), | |
| 1046 | + | array(12102,1,"The Ancient Tombs",0), | |
| 1047 | + | array(12103,1,"The Ancient Tombs",0), | |
| 1048 | + | array(12104,1,"The Ancient Tombs",0), | |
| 1049 | + | array(12105,1,"The Ancient Tombs",0), | |
| 1050 | + | array(12106,1,"The Ancient Tombs",0), | |
| 1051 | + | array(12107,1,"The Ancient Tombs",1), | |
| 1052 | + | array(12022,3,"Barbarian Test Quest",0), | |
| 1053 | + | array(12022,3,"Barbarian Test Quest",0), | |
| 1054 | + | array(12022,3,"Barbarian Test Quest",1), | |
| 1055 | + | array(12025,3,"The Ice Islands Quest",0), | |
| 1056 | + | array(12026,5,"The Ice Islands Quest",0), | |
| 1057 | + | array(12027,3,"The Ice Islands Quest",0), | |
| 1058 | + | array(12028,2,"The Ice Islands Quest",0), | |
| 1059 | + | array(12029,6,"The Ice Islands Quest",0), | |
| 1060 | + | array(12030,8,"The Ice Islands Quest",0), | |
| 1061 | + | array(12031,3,"The Ice Islands Quest",0), | |
| 1062 | + | array(12032,4,"The Ice Islands Quest",0), | |
| 1063 | + | array(12033,2,"The Ice Islands Quest",0), | |
| 1064 | + | array(12034,2,"The Ice Islands Quest",0), | |
| 1065 | + | array(12035,2,"The Ice Islands Quest",0), | |
| 1066 | + | array(12036,6,"The Ice Islands Quest",1), | |
| 1067 | + | ); | |
| 1068 | + | ||
| 1069 | + | // Restricted names | |
| 1070 | + | $config['invalidNameTags'] = array( | |
| 1071 | + | "owner", "gamemaster", "hoster", "admin", "staff", "tibia", "account", "god", "hitler", "cm", "gm", "game master", "anal", "anus", "arse", "ass", "asses", "assfucker", "assfukka", "asshole", "arsehole", "asswhole", "assmunch", "ballsack", "wanky", "whore", "whoar", "xxx", "xx", "yaoi", "yury", "bastard", "beastial", "bestial", "bellend", "bdsm", "beastiality", "bestiality", "bitch", "bitches", "bitchin", "bitching", "bimbo", "bimbos", "blow job", "blowjob", "blowjobs", "blue waffle", "boob", "boobs", "booobs", "boooobs", "booooobs", "booooooobs", "breasts", "booty call", "brown shower", "brown showers", "boner", "bondage", "buceta", "bukake", "bukkake", "bullshit", "bull shit", "busty", "butthole", "carpet muncher", "cawk", "chink", "cipa", "clit", "clits", "clitoris", "cnut", "cock", "cocks", "cockface", "cockhead", "cockmunch", "cockmuncher", "cocksuck", "cocksucked", "cocksucking", "cocksucks", "cocksucker", "cokmuncher", "coon", "cow girl", "cow girls", "cowgirl", "cowgirls", "crap", "crotch", "cum", "cummer", "cumming", "cuming", "cums", "cumshot", "cunilingus", "cunillingus", "cunnilingus", "cunt", "cuntlicker", "cuntlicking", "cunts", "damn", "dick", "dickhead", "dildo", "dildos", "dink", "dinks", "deepthroat", "deep throat", "dog style", "doggie style", "doggiestyle", "doggy style", "doggystyle", "donkeyribber", "doosh", "douche", "duche", "dyke", "ejaculate", "ejaculated", "ejaculates", "ejaculating", "ejaculatings", "ejaculation", "ejakulate", "erotic", "erotism", "fag", "faggot", "fagging", "faggit", "faggitt", "faggs", "fagot", "fagots", "fags", "fatass", "femdom", "fingering", "footjob", "foot job", "fuck", "fucks", "fucker", "fuckers", "fucked", "fuckhead", "fuckheads", "fuckin", "fucking", "fcuk", "fcuker", "fcuking", "felching", "fellate", "fellatio", "fingerfuck", "fingerfucked", "fingerfucker", "fingerfuckers", "fingerfucking", "fingerfucks", "fistfuck", "fistfucked", "fistfucker", "fistfuckers", "fistfucking", "fistfuckings", "fistfucks", "flange", "fook", "fooker", "fucka", "fuk", "fuks", "fuker", "fukker", "fukkin", "fukking", "futanari", "futanary", "gangbang", "gangbanged", "gang bang", "gokkun", "golden shower", "goldenshower", "gaysex", "goatse", "handjob", "hand job", "hentai", "hooker", "hoer", "homo", "horny", "incest", "jackoff", "jack off", "jerkoff", "jerk off", "jizz", "knob", "kinbaku", "labia", "masturbate", "masochist", "mofo", "mothafuck", "motherfuck", "motherfucker", "mothafucka", "mothafuckas", "mothafuckaz", "mothafucked", "mothafucker", "mothafuckers", "mothafuckin", "mothafucking", "mothafuckings", "mothafucks", "mother fucker", "motherfucked", "motherfucker", "motherfuckers", "motherfuckin", "motherfucking", "motherfuckings", "motherfuckka", "motherfucks", "milf", "muff", "negro", "nigga", "nigger", "nigg", "nipple", "nipples", "nob", "nob jokey", "nobhead", "nobjocky", "nobjokey", "numbnuts", "nutsack", "nude", "nudes", "orgy", "orgasm", "orgasms", "panty", "panties", "penis", "playboy", "pinto", "porn", "porno", "pornography", "pron", "punheta", "pussy", "pussies", "puta", "rape", "raping", "rapist", "rectum", "retard", "rimming", "sadist", "sadism", "schlong", "scrotum", "sex", "semen", "shemale", "she male", "shibari", "shibary", "shit", "shitdick", "shitfuck", "shitfull", "shithead", "shiting", "shitings", "shits", "shitted", "shitters", "shitting", "shittings", "shitty", "shota", "skank", "slut", "sluts", "smut", "smegma", "spunk", "strip club", "stripclub", "tit", "tits", "titties", "titty", "titfuck", "tittiefucker", "titties", "tittyfuck", "tittywank", "titwank", "threesome", "three some", "throating", "twat", "twathead", "twatty", "twunt", "viagra", "vagina", "vulva", "viado", "wank", "wanker", | |
| 1072 | + | ); | |
| 1073 | + | // Comment out the below array if you want to allow players to use creature names: | |
| 1074 | + | $config['creatureNameTags'] = array( | |
| 1075 | + | "acolyte of the cult", "adept of the cult", "amazon", "ancient scarab", "arachnophobica", "assassin", "azure frog", "badger", "bandit", "banshee", "barbarian bloodwalker", "barbarian brutetamer", "barbarian headsplitter", "barbarian skullhunter", "bat", "bear", "behemoth", "betrayed wraith", "biting book", "black knight", "black sphinx acolyte", "blightwalker", "blood beast", "blood crab", "blood hand", "blood priest", "blue djinn", "boar", "bog frog", "bog raider", "bonebeast", "bonelord", "boogy", "brain squid", "braindeath", "breach brood", "brimstone bug", "burning book", "burning gladiator", "burster spectre", "carniphila", "carrion worm", "cave devourer", "centipede", "chakoya toolshaper", "chakoya tribewarden", "chakoya windcaller", "choking fear", "clay guardian", "clomp", "cobra", "coral frog", "corym charlatan", "corym skirmisher", "corym vanguard", "crab", "crazed beggar", "crazed summer rearguard", "crazed summer vanguard", "crazed winter rearguard", "crazed winter vanguard", "crimson frog", "crocodile", "crypt defiler", "crypt shambler", "crypt warden", "crystal spider", "crystalcrusher", "cult believer", "cult enforcer", "cult scholar", "cyclops", "cyclops drone", "cyclops smith", "dark apprentice", "dark faun", "dark magician", "dark monk", "dark torturer", "dawnfire asura", "death blob", "deathling scout", "deathling spellsinger", "deepling guard", "deepling scout", "deepling spellsinger", "deepling warrior", "deepling worker", "deepworm", "defiler", "demon outcast", "demon skeleton", "demon", "destroyer", "devourer", "diabolic imp", "diamond servant", "diremaw", "dragon hatchling", "dragon lord hatchling", "dragon lord", "dragon", "draken abomination", "draken elite", "draken spellweaver", "draken warmaster", "dread intruder", "drillworm", "dwarf geomancer", "dwarf guard", "dwarf henchman", "dwarf soldier", "dwarf", "dworc fleshhunter", "dworc venomsniper", "dworc voodoomaster", "earth elemental", "efreet", "elder bonelord", "elder wyrm", "elephant", "elf arcanist", "elf scout", "elf", "emerald damselfly", "energetic book", "energy elemental", "enfeebled silencer", "enlightened of the cult", "enraged crystal golem", "eternal guardian", "falcon knight", "falcon paladin", "faun", "fire devil", "fire elemental", "firestarter", "forest fury", "fox", "frazzlemaw", "frost dragon hatchling", "frost dragon", "frost flower asura", "fury", "gargoyle", "gazer spectre", "ghastly dragon", "ghost", "ghoul", "giant spider", "gladiator", "gloom wolf", "glooth bandit", "glooth blob", "glooth brigand", "glooth golem", "gnarlhound", "guzzlemaw", "hand of cursed fate", "haunted treeling", "hellhound", "hellflayer", "hellfire fighter", "hellspawn", "hero", "honour guard", "hunter", "hydra", "ice golem", "ice witch", "infernalist", "juggernaut", "killer caiman", "kongra", "lancer beetle", "lamassu", "lich", "lizard chosen", "lizard dragon priest", "lizard high guard", "lizard legionnaire", "lizard sentinel", "lizard snakecharmer", "lizard templar", "lizard zaogun", "lost soul", "lumbering carnivor", "mad scientist", "mammoth", "marid", "marsh stalker", "medusa", "menacing carnivor", "mercury blob", "merlkin", "metal gargoyle", "midnight asura", "minotaur amazon", "minotaur archer", "minotaur cult follower", "minotaur cult prophet", "minotaur cult zealot", "minotaur guard", "minotaur hunter", "minotaur mage", "minotaur", "monk", "mooh'tah warrior", "moohtant", "mummy", "mutated bat", "mutated human", "mutated rat", "mutated tiger", "necromancer", "nightmare scion", "nightmare", "nightstalker", "nomad", "novice of the cult ", "nymph", "omnivora", "orc berserker", "orc leader", "orc rider", "orc shaman", "orc warlord", "orc warrior", "orc", "pirate buccaneer", "pirate corsair", "pirate cutthroat", "pirate ghost", "pirate marauder", "pirate skeleton", "pixie", "plaguesmith", "priestess", "pooka", "ravenous lava lurker", "renegade knight", "retching horror", "ripper spectre", "roaring lion", "rot elemental", "rotworm", "rustheap golem", "scarab", "scorpion", "sea serpent", "serpent spawn", "sibang", "silencer", "skeleton elite warrior", "souleater", "spectre", "spiky carnivor", "stone golem", "stonerefiner", "swamp troll", "tarantula", "terramite", "thornback tortoise", "toad", "tortoise", "twisted pooka", "undead elite gladiator", "undead gladiator", "valkyrie", "vampire bride", "vampire viscount", "vampire", "vexclaw", "vicious squire", "vile grandmaster", "vulcongra", "wailing widow", "war golem", "war wolf", "warlock", "wasp", "water elemental", "weakened frazzlemaw", "werebadger", "werebear", "wereboar", "werefox", "werewolf", "worm priestess", "wolf", "wyrm", "wyvern", "yielothax", "young sea serpent", "zombie", "adult goanna", "black sphinx acolyte", "burning gladiator", "cobra assassin", "cobra scout", "cobra vizier", "crypt warden", "feral sphinx", "lamassu", "manticore", "ogre rowdy", "ogre ruffian", "ogre sage", "priestess of the wild sun", "sphinx", "sun-marked goanna", "young goanna", "cursed prospector", "evil prospector", "flimsy lost soul", "freakish lost soul", "mean lost soul", "a shielded astral glyph", "abyssador", "an astral glyph", "ascending ferumbras", "annihilon", "apocalypse", "apprentice sheng", "arachir the ancient one", "armenius", "azerus", "barbaria", "baron brute", "battlemaster zunzu", "bazir", "big boss trolliver", "bones", "boogey", "bretzecutioner", "brokul", "bruise payne", "brutus bloodbeard", "bullwark", "chizzoron the distorter", "coldheart", "countess sorrow", "deadeye devious", "deathbine", "deathstrike", "demodras", "dharalion", "diblis the fair", "dirtbeard", "diseased bill", "diseased dan", "diseased fred", "doomhowl", "dracola", "dreadwing", "ekatrix", "energized raging mage", "esmeralda", "ethershreck", "evil mastermind", "fatality", "fazzrah", "fernfang", "feroxa", "ferumbras", "flameborn", "fleshcrawler", "fleshslicer", "fluffy", "foreman kneebiter", "freegoiz", "fury of the emperor", "furyosa", "gaz'haragoth", "general murius", "ghazbaran", "glitterscale", "gnomevil", "golgordan", "grand mother foulscale", "groam", "grorlam", "gorgo", "hairman the huge", "haunter", "hellgorak", "hemming", "heoni", "hide", "hirintror", "horadron", "horestis", "incineron", "infernatil", "inky", "jaul", "kerberos", "koshei the deathless", "kraknaknork's demon", "kraknaknork", "kroazur", "latrivan", "lethal lissy", "leviathan", "lisa", "lizard abomination", "lord of the elements", "mad mage", "mad technomancer", "madareth", "man in the cave", "massacre", "mawhawk", "menace", "mephiles", "minishabaal", "monstor", "morgaroth", "morik the gladiator", "mr. punish", "munster", "mutated zalamon", "necropharus", "obujos", "orshabaal", "paiz the pauperizer", "raging mage", "ribstride", "rocko", "ron the ripper", "rottie the rotworm", "rotworm queen", "scarlett etzel", "scorn of the emperor", "shardhead", "sharptooth", "sir valorcrest", "snake god essence", "snake thing", "spider queen", "spite of the emperor", "splasher", "stonecracker", "sulphur scuttler", "tanjis", "terofar", "teleskor", "the abomination", "the axeorcist", "the blightfather", "the bloodtusk", "the bloodweb", "the book of death", "the collector", "the count", "the weakened count", "the dreadorian", "the evil eye", "the frog prince", "the handmaiden", "the horned fox", "the keeper", "the imperor", "the many", "the noxious spawn", "the old widow", "the pale count", "the plasmother", "the snapper", "the distorted astral source", "the astral source", "thul", "tiquandas revenge", "tirecz", "tyrn", "tormentor", "tremorak", "tromphonyte", "ungreez", "ushuriel", "verminor", "versperoth", "warlord ruzad", "white pale", "wrath of the emperor", "xenia", "yaga the crone", "yakchal", "zanakeph", "zavarash", "zevelon duskbringer", "zomba", "zoralurk", "zugurosh", "zushuka", "zulazza the corruptor", "glooth bomb", "bibby bloodbath", "doctor perhaps", "mooh'tah master", "the welter" | |
| 1076 | + | ); | |
| 1077 | + | ||
| 1078 | + | // ------------------------------------------------------------------ \ | |
| 1079 | + | // LAYOUT REPOSITORY \ | |
| 1080 | + | // ------------------------------------------------------------------ \ | |
| 1081 | + | // Lets Admin Panel > Layout > Browse themes list themes hosted outside | |
| 1082 | + | // this install and install them with one click. | |
| 1083 | + | // | |
| 1084 | + | // A theme is PHP that runs on your server, so downloading one is running | |
| 1085 | + | // someone else's code. Only ever point this at a repository you trust. | |
| 1086 | + | // Downloads are refused unless the URL is https and its host is in | |
| 1087 | + | // allowed_hosts below. | |
| 1088 | + | $config['layout_repository'] = array( | |
| 1089 | + | 'enabled' => true, | |
| 1090 | + | ||
| 1091 | + | // JSON catalogue of downloadable themes. See layouts/README.md for its shape. | |
| 1092 | + | 'index' => 'https://raw.githubusercontent.com/Open-Games-Community/ZnoteX/layouts/index.json', | |
| 1093 | + | ||
| 1094 | + | // Nothing is downloaded from a host that is not on this list. | |
| 1095 | + | 'allowed_hosts' => array( | |
| 1096 | + | 'raw.githubusercontent.com', | |
| 1097 | + | 'codeload.github.com', | |
| 1098 | + | 'github.com', | |
| 1099 | + | 'objects.githubusercontent.com', | |
| 1100 | + | ), | |
| 1101 | + | ||
| 1102 | + | // How long the catalogue is kept before being fetched again, in seconds. | |
| 1103 | + | 'cache_time' => 3600, | |
| 1104 | + | ||
| 1105 | + | // Largest theme archive accepted, in megabytes. | |
| 1106 | + | 'max_size_mb' => 64, | |
| 1107 | + | ); | |
| 1108 | + | ||
| 1109 | + | // Plugin repository | |
| 1110 | + | $config['plugin_repository'] = array( | |
| 1111 | + | 'enabled' => true, | |
| 1112 | + | ||
| 1113 | + | // JSON catalogue of downloadable plugins. See plugins/README.md for its shape. | |
| 1114 | + | 'index' => 'https://raw.githubusercontent.com/Open-Games-Community/ZnoteX/plugins/index.json', | |
| 1115 | + | ||
| 1116 | + | 'allowed_hosts' => array( | |
| 1117 | + | 'raw.githubusercontent.com', | |
| 1118 | + | 'codeload.github.com', | |
| 1119 | + | 'github.com', | |
| 1120 | + | 'objects.githubusercontent.com', | |
| 1121 | + | ), | |
| 1122 | + | ||
| 1123 | + | 'cache_time' => 3600, | |
| 1124 | + | 'max_size_mb' => 64, | |
| 1125 | + | ); | |
| 1126 | + | ||
| 1127 | + | // -------------------------------------------------------------------- \ | |
| 1128 | + | // LOCAL OVERRIDES \ | |
| 1129 | + | // -------------------------------------------------------------------- \ | |
| 1130 | + | // config.local.php holds the values specific to THIS install - database | |
| 1131 | + | // credentials, server engine, site name, admin names. The installer writes | |
| 1132 | + | // it, and it is included last so it wins over everything above. | |
| 1133 | + | // | |
| 1134 | + | // The point is that config.php stays replaceable: a ZnoteX update can ship | |
| 1135 | + | // a new one without touching your settings. Keep config.local.php out of | |
| 1136 | + | // version control and out of backups you share. | |
| 1137 | + | if (is_file(__DIR__ . '/config.local.php')) { | |
| 1138 | + | require __DIR__ . '/config.local.php'; | |
| 1139 | + | } |
| @@ -0,0 +1,5 @@ | |||
| 1 | + | <?php require_once 'engine/init.php'; theme_open(); | |
| 2 | + | ||
| 3 | + | view('contact'); | |
| 4 | + | ||
| 5 | + | theme_close(); |
| @@ -0,0 +1,122 @@ | |||
| 1 | + | <?php require_once 'engine/init.php'; | |
| 2 | + | protect_page(); | |
| 3 | + | theme_open(); | |
| 4 | + | ||
| 5 | + | if (empty($_POST) === false) { | |
| 6 | + | // $_POST[''] | |
| 7 | + | $required_fields = array('name', 'selected_town'); | |
| 8 | + | foreach($_POST as $key=>$value) { | |
| 9 | + | if (empty($value) && in_array($key, $required_fields) === true) { | |
| 10 | + | $errors[] = t('reg.fill_all'); | |
| 11 | + | break 1; | |
| 12 | + | } | |
| 13 | + | } | |
| 14 | + | ||
| 15 | + | // check errors (= user exist, pass long enough | |
| 16 | + | if (empty($errors) === true) { | |
| 17 | + | if (!Token::isValid($_POST['token'])) { | |
| 18 | + | $errors[] = t('login.token_invalid'); | |
| 19 | + | } | |
| 20 | + | $_POST['name'] = validate_name($_POST['name']); | |
| 21 | + | if ($_POST['name'] === false) { | |
| 22 | + | $errors[] = t('acc.name_max_words'); | |
| 23 | + | } else { | |
| 24 | + | if (user_character_exist($_POST['name']) !== false) { | |
| 25 | + | $errors[] = t('acc.name_taken'); | |
| 26 | + | } | |
| 27 | + | if (!preg_match("/^[a-zA-Z ]+$/", $_POST['name'])) { | |
| 28 | + | $errors[] = t('acc.name_letters'); | |
| 29 | + | } | |
| 30 | + | if (strlen($_POST['name']) < $config['minL'] || strlen($_POST['name']) > $config['maxL']) { | |
| 31 | + | $errors[] = t('acc.name_length', ['min' => $config['minL'], 'max' => $config['maxL']]); | |
| 32 | + | } | |
| 33 | + | // name restriction | |
| 34 | + | $resname = explode(" ", $_POST['name']); | |
| 35 | + | $username = $_POST['name']; | |
| 36 | + | foreach($resname as $res) { | |
| 37 | + | if(in_array(strtolower($res), $config['invalidNameTags'])) { | |
| 38 | + | $errors[] = t('reg.restricted_word'); | |
| 39 | + | } | |
| 40 | + | if(strlen($res) == 1) { | |
| 41 | + | $errors[] = t('reg.words_too_short'); | |
| 42 | + | } | |
| 43 | + | } | |
| 44 | + | if(in_array(strtolower($username), $config['creatureNameTags'])) { | |
| 45 | + | $errors[] = t('createchar.creature_name'); | |
| 46 | + | } | |
| 47 | + | // Validate vocation id | |
| 48 | + | if (!in_array((int)$_POST['selected_vocation'], $config['available_vocations'])) { | |
| 49 | + | $errors[] = t('createchar.bad_vocation'); | |
| 50 | + | } | |
| 51 | + | // Validate town id | |
| 52 | + | if (!in_array((int)$_POST['selected_town'], $config['available_towns'])) { | |
| 53 | + | $errors[] = t('createchar.bad_town'); | |
| 54 | + | } | |
| 55 | + | // Validate gender id | |
| 56 | + | if (!in_array((int)$_POST['selected_gender'], array(0, 1))) { | |
| 57 | + | $errors[] = t('createchar.bad_gender'); | |
| 58 | + | } | |
| 59 | + | if (vocation_id_to_name($_POST['selected_vocation']) === false) { | |
| 60 | + | $errors[] = t('createchar.no_vocation'); | |
| 61 | + | } | |
| 62 | + | if (town_id_to_name($_POST['selected_town']) === false) { | |
| 63 | + | $errors[] = t('createchar.no_town'); | |
| 64 | + | } | |
| 65 | + | if (gender_exist($_POST['selected_gender']) === false) { | |
| 66 | + | $errors[] = t('createchar.no_gender'); | |
| 67 | + | } | |
| 68 | + | // Char count | |
| 69 | + | $char_count = user_character_list_count($session_user_id); | |
| 70 | + | if ($char_count >= $config['max_characters'] && !is_admin($user_data)) { | |
| 71 | + | $errors[] = t('createchar.max_chars', ['max' => $config['max_characters']]); | |
| 72 | + | } | |
| 73 | + | if (validate_ip(getIP()) === false && $config['validate_IP'] === true) { | |
| 74 | + | $errors[] = t('reg.bad_ip'); | |
| 75 | + | } | |
| 76 | + | } | |
| 77 | + | } | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | /** | |
| 81 | + | * What the view has to render: 'success', 'errors' or 'form'. | |
| 82 | + | * The character creation stays here - a theme must never carry it. | |
| 83 | + | */ | |
| 84 | + | $formState = 'form'; | |
| 85 | + | ||
| 86 | + | if (isset($_GET['success']) && empty($_GET['success'])) { | |
| 87 | + | $formState = 'success'; | |
| 88 | + | ||
| 89 | + | } elseif (empty($_POST) === false && empty($errors) === true) { | |
| 90 | + | ||
| 91 | + | if ($config['log_ip']) { | |
| 92 | + | znote_visitor_insert_detailed_data(2); | |
| 93 | + | } | |
| 94 | + | ||
| 95 | + | $character_data = array( | |
| 96 | + | 'name' => format_character_name($_POST['name']), | |
| 97 | + | 'account_id' => $session_user_id, | |
| 98 | + | 'vocation' => $_POST['selected_vocation'], | |
| 99 | + | 'town_id' => $_POST['selected_town'], | |
| 100 | + | 'sex' => $_POST['selected_gender'], | |
| 101 | + | 'lastip' => getIPLong(), | |
| 102 | + | 'created' => time() | |
| 103 | + | ); | |
| 104 | + | ||
| 105 | + | user_create_character($character_data); | |
| 106 | + | ||
| 107 | + | znote_hook('character.created', array( | |
| 108 | + | 'name' => $character_data['name'], | |
| 109 | + | 'account_id' => $character_data['account_id'], | |
| 110 | + | 'vocation' => $character_data['vocation'], | |
| 111 | + | )); | |
| 112 | + | ||
| 113 | + | header('Location: createcharacter.php?success'); | |
| 114 | + | exit; | |
| 115 | + | ||
| 116 | + | } elseif (empty($errors) === false) { | |
| 117 | + | $formState = 'errors'; | |
| 118 | + | } | |
| 119 | + | ||
| 120 | + | view('createcharacter'); | |
| 121 | + | ||
| 122 | + | theme_close(); |
| @@ -0,0 +1,63 @@ | |||
| 1 | + | <?php require_once 'engine/init.php'; | |
| 2 | + | theme_open(); | |
| 3 | + | ||
| 4 | + | /** | |
| 5 | + | * Creature library. | |
| 6 | + | * | |
| 7 | + | * The monster data is uploaded and parsed in the admin panel, under Server Info. | |
| 8 | + | * An install that still points $config['server_path'] at the server folder keeps | |
| 9 | + | * working: that is the fallback source when nothing was uploaded. | |
| 10 | + | * | |
| 11 | + | * Prepared for the view: | |
| 12 | + | * $creaturesPath the data folder used, for the "not configured" message | |
| 13 | + | * $creatures [name, health, experience, speed, race, looktype] | |
| 14 | + | * $creatureSearch the current filter | |
| 15 | + | * $creatureRaces races present in the data, for the filter buttons | |
| 16 | + | * $creatureError message when the files could not be read, else '' | |
| 17 | + | */ | |
| 18 | + | ||
| 19 | + | $creatureError = ''; | |
| 20 | + | $creatures = array(); | |
| 21 | + | $creatureRaces = array(); | |
| 22 | + | $creatureSearch = trim((string)($_GET['search'] ?? '')); | |
| 23 | + | $creatureRace = trim((string)($_GET['race'] ?? '')); | |
| 24 | + | ||
| 25 | + | $creatureSource = serverdata_creature_source(); | |
| 26 | + | $creaturesPath = $creatureSource['label']; | |
| 27 | + | ||
| 28 | + | $loaded = serverdata_load('creatures'); | |
| 29 | + | ||
| 30 | + | if ($loaded === false) { | |
| 31 | + | $rebuildError = null; | |
| 32 | + | if (serverdata_rebuild('creatures', $rebuildError)) { | |
| 33 | + | $loaded = serverdata_load('creatures'); | |
| 34 | + | } else { | |
| 35 | + | $creatureError = (string)$rebuildError; | |
| 36 | + | } | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | $creatures = is_array($loaded) ? $loaded : array(); | |
| 40 | + | ||
| 41 | + | // Races present, for the filter row. | |
| 42 | + | foreach ($creatures as $creature) { | |
| 43 | + | if ($creature['race'] !== '') { | |
| 44 | + | $creatureRaces[$creature['race']] = true; | |
| 45 | + | } | |
| 46 | + | } | |
| 47 | + | $creatureRaces = array_keys($creatureRaces); | |
| 48 | + | sort($creatureRaces); | |
| 49 | + | ||
| 50 | + | // Filtering happens on the cached array: no second pass over the files. | |
| 51 | + | if ($creatureSearch !== '' || $creatureRace !== '') { | |
| 52 | + | $needle = strtolower($creatureSearch); | |
| 53 | + | $creatures = array_values(array_filter($creatures, static function (array $c) use ($needle, $creatureRace): bool { | |
| 54 | + | if ($creatureRace !== '' && $c['race'] !== $creatureRace) { | |
| 55 | + | return false; | |
| 56 | + | } | |
| 57 | + | return $needle === '' || str_contains(strtolower($c['name']), $needle); | |
| 58 | + | })); | |
| 59 | + | } | |
| 60 | + | ||
| 61 | + | view('creatures'); | |
| 62 | + | ||
| 63 | + | theme_close(); |
| @@ -0,0 +1,19 @@ | |||
| 1 | + | <?php require_once 'engine/init.php'; | |
| 2 | + | ||
| 3 | + | if (!($config['credits_enabled'] ?? true)) { | |
| 4 | + | header('Location: index.php'); | |
| 5 | + | exit(); | |
| 6 | + | } | |
| 7 | + | ||
| 8 | + | theme_open(); | |
| 9 | + | ||
| 10 | + | $creditsMaintainer = array( | |
| 11 | + | 'login' => 'Alexv45', | |
| 12 | + | 'url' => 'https://github.com/Alexv45', | |
| 13 | + | 'avatar' => 'https://avatars.githubusercontent.com/u/89811188?s=400&u=5299472333b12cff2d5ae9cff220541abb3cfb7b&v=4', | |
| 14 | + | 'role' => 'ZnoteX remaster and maintenance', | |
| 15 | + | ); | |
| 16 | + | ||
| 17 | + | view('credits'); | |
| 18 | + | ||
| 19 | + | theme_close(); |
| @@ -0,0 +1,18 @@ | |||
| 1 | + | <?php require_once 'engine/init.php'; theme_open(); | |
| 2 | + | $cache = new Cache('engine/cache/deaths'); | |
| 3 | + | if ($cache->hasExpired()) { | |
| 4 | + | ||
| 5 | + | if (in_array(znote_server_adapter()->normalizedEngine(), array('TFS_02', 'TFS_10'), true)) { | |
| 6 | + | $deaths = fetchLatestDeaths(); | |
| 7 | + | } else { | |
| 8 | + | $deaths = fetchLatestDeaths_03(30); | |
| 9 | + | } | |
| 10 | + | $cache->setContent($deaths); | |
| 11 | + | $cache->save(); | |
| 12 | + | } else { | |
| 13 | + | $deaths = $cache->load(); | |
| 14 | + | } | |
| 15 | + | ||
| 16 | + | view('deaths'); | |
| 17 | + | ||
| 18 | + | theme_close(); |
| @@ -0,0 +1,72 @@ | |||
| 1 | + | services: | |
| 2 | + | znotex: | |
| 3 | + | build: | |
| 4 | + | context: . | |
| 5 | + | dockerfile: Dockerfile | |
| 6 | + | restart: unless-stopped | |
| 7 | + | ports: | |
| 8 | + | - "${ZNOTEX_HTTP_PORT:-8080}:80" | |
| 9 | + | environment: | |
| 10 | + | ZNOTE_DB_HOST: db | |
| 11 | + | ZNOTE_DB_PORT: 3306 | |
| 12 | + | ZNOTE_DB_NAME: ${MYSQL_DATABASE:-znotex} | |
| 13 | + | ZNOTE_DB_USER: ${MYSQL_USER:-znotex} | |
| 14 | + | ZNOTE_DB_PASSWORD: ${MYSQL_PASSWORD:-znotex} | |
| 15 | + | ZNOTE_SITE_URL: ${ZNOTE_SITE_URL:-http://localhost:8080} | |
| 16 | + | ZNOTE_SITE_TITLE: ${ZNOTE_SITE_TITLE:-ZnoteX} | |
| 17 | + | ZNOTE_SERVER_ENGINE: ${ZNOTE_SERVER_ENGINE:-TFS_10} | |
| 18 | + | ZNOTE_ADMIN_ACCOUNT: ${ZNOTE_ADMIN_ACCOUNT:-demo} | |
| 19 | + | volumes: | |
| 20 | + | - znotex_cache:/var/www/html/engine/cache | |
| 21 | + | - znotex_theme_img:/var/www/html/engine/img/theme | |
| 22 | + | depends_on: | |
| 23 | + | db: | |
| 24 | + | condition: service_healthy | |
| 25 | + | ||
| 26 | + | db: | |
| 27 | + | image: mysql:8.4 | |
| 28 | + | restart: unless-stopped | |
| 29 | + | environment: | |
| 30 | + | MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-znotex_root} | |
| 31 | + | MYSQL_DATABASE: ${MYSQL_DATABASE:-znotex} | |
| 32 | + | MYSQL_USER: ${MYSQL_USER:-znotex} | |
| 33 | + | MYSQL_PASSWORD: ${MYSQL_PASSWORD:-znotex} | |
| 34 | + | ZNOTE_SERVER_ENGINE: ${ZNOTE_SERVER_ENGINE:-TFS_10} | |
| 35 | + | volumes: | |
| 36 | + | - znotex_db:/var/lib/mysql | |
| 37 | + | - ./docker/mysql/00-init.sh:/docker-entrypoint-initdb.d/00-init.sh:ro | |
| 38 | + | - ./docker/mysql/schemas:/schemas:ro | |
| 39 | + | - ./docker/mysql/demo-data-tfs_10.sql:/demo-data-tfs_10.sql:ro | |
| 40 | + | - ./SQL/znote_schema.sql:/znote-schema.sql:ro | |
| 41 | + | ports: | |
| 42 | + | - "${ZNOTEX_DB_PORT:-3306}:3306" | |
| 43 | + | healthcheck: | |
| 44 | + | test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD:-znotex_root}"] | |
| 45 | + | interval: 5s | |
| 46 | + | timeout: 5s | |
| 47 | + | retries: 20 | |
| 48 | + | ||
| 49 | + | phpmyadmin: | |
| 50 | + | image: phpmyadmin/phpmyadmin | |
| 51 | + | restart: unless-stopped | |
| 52 | + | environment: | |
| 53 | + | PMA_HOST: db | |
| 54 | + | PMA_USER: root | |
| 55 | + | PMA_PASSWORD: ${MYSQL_ROOT_PASSWORD:-znotex_root} | |
| 56 | + | ports: | |
| 57 | + | - "${ZNOTEX_PMA_PORT:-8081}:80" | |
| 58 | + | depends_on: | |
| 59 | + | db: | |
| 60 | + | condition: service_healthy | |
| 61 | + | ||
| 62 | + | mailpit: | |
| 63 | + | image: axllent/mailpit | |
| 64 | + | restart: unless-stopped | |
| 65 | + | ports: | |
| 66 | + | - "${ZNOTEX_MAILPIT_SMTP_PORT:-1025}:1025" | |
| 67 | + | - "${ZNOTEX_MAILPIT_WEB_PORT:-8025}:8025" | |
| 68 | + | ||
| 69 | + | volumes: | |
| 70 | + | znotex_db: | |
| 71 | + | znotex_cache: | |
| 72 | + | znotex_theme_img: |
| @@ -0,0 +1,4 @@ | |||
| 1 | + | <Directory /var/www/html> | |
| 2 | + | AllowOverride All | |
| 3 | + | Require all granted | |
| 4 | + | </Directory> |
| @@ -0,0 +1,56 @@ | |||
| 1 | + | #!/bin/sh | |
| 2 | + | set -e | |
| 3 | + | ||
| 4 | + | ROOT=/var/www/html | |
| 5 | + | ||
| 6 | + | quote() { | |
| 7 | + | printf "%s" "$1" | sed "s/\\\\/\\\\\\\\/g; s/'/\\\\'/g" | |
| 8 | + | } | |
| 9 | + | ||
| 10 | + | cat > "$ROOT/config.local.php" <<PHP | |
| 11 | + | <?php | |
| 12 | + | /** | |
| 13 | + | * Written by the ZnoteX Docker entrypoint on every container start. | |
| 14 | + | * Edit docker-compose.yml environment values, not this file - it is | |
| 15 | + | * regenerated each time the container boots. | |
| 16 | + | */ | |
| 17 | + | ||
| 18 | + | \$config['sqlHost'] = '$(quote "${ZNOTE_DB_HOST:-db}")'; | |
| 19 | + | \$config['sqlUser'] = '$(quote "${ZNOTE_DB_USER:-znotex}")'; | |
| 20 | + | \$config['sqlPassword'] = '$(quote "${ZNOTE_DB_PASSWORD:-znotex}")'; | |
| 21 | + | \$config['sqlDatabase'] = '$(quote "${ZNOTE_DB_NAME:-znotex}")'; | |
| 22 | + | ||
| 23 | + | \$config['ServerEngine'] = '$(quote "${ZNOTE_SERVER_ENGINE:-TFS_10}")'; | |
| 24 | + | \$config['site_title'] = '$(quote "${ZNOTE_SITE_TITLE:-ZnoteX}")'; | |
| 25 | + | \$config['site_url'] = '$(quote "${ZNOTE_SITE_URL:-http://localhost:8080}")'; | |
| 26 | + | ||
| 27 | + | \$config['mailserver'] = array( | |
| 28 | + | 'register' => true, | |
| 29 | + | 'accountRecovery' => true, | |
| 30 | + | 'myaccount_verify_email' => true, | |
| 31 | + | 'verify_email_points' => 0, | |
| 32 | + | 'host' => 'mailpit', | |
| 33 | + | 'securityType' => '', | |
| 34 | + | 'port' => 1025, | |
| 35 | + | 'email' => 'noreply@znotex.local', | |
| 36 | + | 'username' => '', | |
| 37 | + | 'password' => '', | |
| 38 | + | 'debug' => false, | |
| 39 | + | 'fromName' => \$config['site_title'], | |
| 40 | + | ); | |
| 41 | + | ||
| 42 | + | // Admin access is granted by account name (not character name). | |
| 43 | + | \$config['page_admin_access'] = array( | |
| 44 | + | '$(quote "${ZNOTE_ADMIN_ACCOUNT:-demo}")', | |
| 45 | + | ); | |
| 46 | + | PHP | |
| 47 | + | ||
| 48 | + | mkdir -p "$ROOT/install" | |
| 49 | + | if [ ! -f "$ROOT/install/installed.lock" ]; then | |
| 50 | + | printf "Installed by the ZnoteX Docker entrypoint on %s\nDelete this file only if you mean to run the installer again.\n" "$(date '+%Y-%m-%d %H:%M:%S')" > "$ROOT/install/installed.lock" | |
| 51 | + | fi | |
| 52 | + | ||
| 53 | + | mkdir -p "$ROOT/engine/cache" "$ROOT/engine/img/theme" | |
| 54 | + | chown -R www-data:www-data "$ROOT/engine/cache" "$ROOT/engine/img/theme" "$ROOT/config.local.php" 2>/dev/null || true | |
| 55 | + | ||
| 56 | + | exec "$@" |
| @@ -0,0 +1,37 @@ | |||
| 1 | + | #!/bin/sh | |
| 2 | + | set -e | |
| 3 | + | ||
| 4 | + | engine=$(printf "%s" "${ZNOTE_SERVER_ENGINE:-TFS_10}" | tr '[:upper:]' '[:lower:]') | |
| 5 | + | schema="/schemas/${engine}.sql" | |
| 6 | + | ||
| 7 | + | if [ ! -f "$schema" ]; then | |
| 8 | + | case "$engine" in | |
| 9 | + | tfs_02) | |
| 10 | + | echo "[znotex] No dedicated TFS 0.2.13+ schema is bundled; falling back to the TFS_03 schema (TFS 0.3.6+/0.4/OTX). Ultra-legacy tables some TFS_02-only pages use may be missing." >&2 | |
| 11 | + | schema="/schemas/tfs_03.sql" | |
| 12 | + | ;; | |
| 13 | + | *) | |
| 14 | + | echo "[znotex] Unknown ZNOTE_SERVER_ENGINE '${ZNOTE_SERVER_ENGINE}', falling back to TFS_10." >&2 | |
| 15 | + | schema="/schemas/tfs_10.sql" | |
| 16 | + | ;; | |
| 17 | + | esac | |
| 18 | + | fi | |
| 19 | + | ||
| 20 | + | echo "[znotex] Importing game schema: $schema" | |
| 21 | + | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" "$MYSQL_DATABASE" < "$schema" | |
| 22 | + | ||
| 23 | + | if [ "$engine" = "tfs_10" ] && [ -f /demo-data-tfs_10.sql ]; then | |
| 24 | + | echo "[znotex] Importing TFS_10 demo accounts/players/guild." | |
| 25 | + | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" "$MYSQL_DATABASE" < /demo-data-tfs_10.sql | |
| 26 | + | else | |
| 27 | + | echo "[znotex] No demo game data for engine '$engine' - the database will have ZnoteX's own tables only, no demo accounts/characters." | |
| 28 | + | fi | |
| 29 | + | ||
| 30 | + | echo "[znotex] Importing ZnoteX's own schema." | |
| 31 | + | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" "$MYSQL_DATABASE" < /znote-schema.sql | |
| 32 | + | ||
| 33 | + | if [ "$engine" = "tfs_10" ]; then | |
| 34 | + | echo "[znotex] Activating the demo account." | |
| 35 | + | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" "$MYSQL_DATABASE" \ | |
| 36 | + | -e "UPDATE znote_accounts SET active = 1, active_email = 1 WHERE account_id = 1;" | |
| 37 | + | fi |
| @@ -0,0 +1,19 @@ | |||
| 1 | + | -- Demo game data for the ZnoteX Docker environment. | |
| 2 | + | -- Login: account "demo", password "demo123". The character "Admin" is | |
| 3 | + | -- granted admin panel access by docker/entrypoint.sh (page_admin_access). | |
| 4 | + | ||
| 5 | + | INSERT INTO `accounts` (`id`, `name`, `password`, `type`, `premdays`, `email`, `creation`) VALUES | |
| 6 | + | (1, 'demo', SHA1('demo123'), 1, 90, 'demo@znotex.local', UNIX_TIMESTAMP()); | |
| 7 | + | ||
| 8 | + | INSERT INTO `players` (`id`, `name`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `mana`, `manamax`, `experience`, `looktype`, `lookhead`, `lookbody`, `looklegs`, `lookfeet`, `town_id`, `conditions`, `sex`, `lastlogin`, `onlinetime`) VALUES | |
| 9 | + | (1, 'Admin', 3, 1, 200, 4, 4585, 4585, 3155, 3155, 698737485, 268, 78, 68, 58, 76, 1, '', 1, UNIX_TIMESTAMP(), 3600), | |
| 10 | + | (2, 'Rookgaard', 1, 1, 15, 1, 185, 185, 35, 35, 4200, 128, 78, 68, 58, 76, 1, '', 1, UNIX_TIMESTAMP(), 1200), | |
| 11 | + | (3, 'Thais Mage', 2, 1, 80, 2, 1240, 1240, 920, 920, 1520000, 138, 78, 68, 58, 76, 1, '', 0, UNIX_TIMESTAMP(), 900); | |
| 12 | + | ||
| 13 | + | -- The oncreate_guilds trigger auto-creates 3 guild_ranks rows for this guild, | |
| 14 | + | -- so they are not inserted here. | |
| 15 | + | INSERT INTO `guilds` (`id`, `name`, `ownerid`, `creationdata`, `motd`) VALUES | |
| 16 | + | (1, 'ZnoteX Guardians', 1, UNIX_TIMESTAMP(), 'Welcome to the demo guild.'); | |
| 17 | + | ||
| 18 | + | INSERT INTO `guild_membership` (`player_id`, `guild_id`, `rank_id`, `nick`) VALUES | |
| 19 | + | (1, 1, (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = 1 AND `level` = 3 LIMIT 1), ''); |
| @@ -0,0 +1,888 @@ | |||
| 1 | + | -- Canary database schema. | |
| 2 | + | -- Source: https://github.com/opentibiabr/canary/blob/main/schema.sql | |
| 3 | + | -- License: GPL-2.0. Covers ZnoteX's CANARY engine choice ("Canary / OTServBR-Global"). | |
| 4 | + | ||
| 5 | + | -- Canary - Database (Schema) | |
| 6 | + | ||
| 7 | + | -- Table structure `server_config` | |
| 8 | + | CREATE TABLE IF NOT EXISTS `server_config` ( | |
| 9 | + | `config` varchar(50) NOT NULL, | |
| 10 | + | `value` varchar(256) NOT NULL DEFAULT '', | |
| 11 | + | CONSTRAINT `server_config_pk` PRIMARY KEY (`config`) | |
| 12 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 13 | + | ||
| 14 | + | INSERT INTO `server_config` (`config`, `value`) VALUES ('db_version', '59'), ('motd_hash', ''), ('motd_num', '0'), ('players_record', '0'); | |
| 15 | + | ||
| 16 | + | -- Table structure `accounts` | |
| 17 | + | CREATE TABLE IF NOT EXISTS `accounts` ( | |
| 18 | + | `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 19 | + | `name` varchar(32) NOT NULL, | |
| 20 | + | `password` VARCHAR(255) NOT NULL, | |
| 21 | + | `email` varchar(255) NOT NULL DEFAULT '', | |
| 22 | + | `premdays` int(11) NOT NULL DEFAULT '0', | |
| 23 | + | `premdays_purchased` int(11) NOT NULL DEFAULT '0', | |
| 24 | + | `lastday` int(10) UNSIGNED NOT NULL DEFAULT '0', | |
| 25 | + | `type` tinyint(1) UNSIGNED NOT NULL DEFAULT '1', | |
| 26 | + | `coins` int(12) UNSIGNED NOT NULL DEFAULT '0', | |
| 27 | + | `coins_transferable` int(12) UNSIGNED NOT NULL DEFAULT '0', | |
| 28 | + | `tournament_coins` int(12) UNSIGNED NOT NULL DEFAULT '0', | |
| 29 | + | `creation` int(11) UNSIGNED NOT NULL DEFAULT '0', | |
| 30 | + | `recruiter` INT(6) DEFAULT 0, | |
| 31 | + | `house_bid_id` int(11) NOT NULL DEFAULT '0', | |
| 32 | + | CONSTRAINT `accounts_pk` PRIMARY KEY (`id`), | |
| 33 | + | CONSTRAINT `accounts_unique` UNIQUE (`name`), | |
| 34 | + | INDEX `accounts_email` (`email`), | |
| 35 | + | INDEX `accounts_password` (`password`) | |
| 36 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 37 | + | ||
| 38 | + | -- Table structure `coins_transactions` | |
| 39 | + | CREATE TABLE IF NOT EXISTS `coins_transactions` ( | |
| 40 | + | `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 41 | + | `account_id` int(11) UNSIGNED NOT NULL, | |
| 42 | + | `type` tinyint(1) UNSIGNED NOT NULL, | |
| 43 | + | `coin_type` tinyint(1) UNSIGNED NOT NULL DEFAULT '1', | |
| 44 | + | `amount` int(12) UNSIGNED NOT NULL, | |
| 45 | + | `description` varchar(3500) NOT NULL, | |
| 46 | + | `timestamp` timestamp DEFAULT CURRENT_TIMESTAMP, | |
| 47 | + | INDEX `account_id` (`account_id`), | |
| 48 | + | CONSTRAINT `coins_transactions_pk` PRIMARY KEY (`id`), | |
| 49 | + | CONSTRAINT `coins_transactions_account_fk` | |
| 50 | + | FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) | |
| 51 | + | ON DELETE CASCADE | |
| 52 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 53 | + | ||
| 54 | + | -- Table structure `players` | |
| 55 | + | CREATE TABLE IF NOT EXISTS `players` ( | |
| 56 | + | `id` int(11) NOT NULL AUTO_INCREMENT, | |
| 57 | + | `name` varchar(255) NOT NULL, | |
| 58 | + | `group_id` int(11) NOT NULL DEFAULT '1', | |
| 59 | + | `account_id` int(11) UNSIGNED NOT NULL DEFAULT '0', | |
| 60 | + | `level` int(11) NOT NULL DEFAULT '1', | |
| 61 | + | `vocation` int(11) NOT NULL DEFAULT '0', | |
| 62 | + | `health` int(11) NOT NULL DEFAULT '150', | |
| 63 | + | `healthmax` int(11) NOT NULL DEFAULT '150', | |
| 64 | + | `experience` bigint(20) NOT NULL DEFAULT '0', | |
| 65 | + | `lookbody` int(11) NOT NULL DEFAULT '0', | |
| 66 | + | `lookfeet` int(11) NOT NULL DEFAULT '0', | |
| 67 | + | `lookhead` int(11) NOT NULL DEFAULT '0', | |
| 68 | + | `looklegs` int(11) NOT NULL DEFAULT '0', | |
| 69 | + | `looktype` int(11) NOT NULL DEFAULT '136', | |
| 70 | + | `lookaddons` int(11) NOT NULL DEFAULT '0', | |
| 71 | + | `maglevel` int(11) NOT NULL DEFAULT '0', | |
| 72 | + | `mana` int(11) NOT NULL DEFAULT '0', | |
| 73 | + | `manamax` int(11) NOT NULL DEFAULT '0', | |
| 74 | + | `manaspent` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 75 | + | `soul` int(10) UNSIGNED NOT NULL DEFAULT '0', | |
| 76 | + | `town_id` int(11) NOT NULL DEFAULT '1', | |
| 77 | + | `posx` int(11) NOT NULL DEFAULT '0', | |
| 78 | + | `posy` int(11) NOT NULL DEFAULT '0', | |
| 79 | + | `posz` int(11) NOT NULL DEFAULT '0', | |
| 80 | + | `conditions` mediumblob NOT NULL, | |
| 81 | + | `cap` int(11) NOT NULL DEFAULT '0', | |
| 82 | + | `sex` int(11) NOT NULL DEFAULT '0', | |
| 83 | + | `pronoun` int(11) NOT NULL DEFAULT '0', | |
| 84 | + | `lastlogin` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 85 | + | `lastip` int(10) UNSIGNED NOT NULL DEFAULT '0', | |
| 86 | + | `save` tinyint(1) NOT NULL DEFAULT '1', | |
| 87 | + | `skull` tinyint(1) NOT NULL DEFAULT '0', | |
| 88 | + | `skulltime` bigint(20) NOT NULL DEFAULT '0', | |
| 89 | + | `expert_pvp_mode` tinyint(1) UNSIGNED NOT NULL DEFAULT '0', | |
| 90 | + | `lastlogout` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 91 | + | `blessings` tinyint(2) NOT NULL DEFAULT '0', | |
| 92 | + | `blessings1` tinyint(4) NOT NULL DEFAULT '0', | |
| 93 | + | `blessings2` tinyint(4) NOT NULL DEFAULT '0', | |
| 94 | + | `blessings3` tinyint(4) NOT NULL DEFAULT '0', | |
| 95 | + | `blessings4` tinyint(4) NOT NULL DEFAULT '0', | |
| 96 | + | `blessings5` tinyint(4) NOT NULL DEFAULT '0', | |
| 97 | + | `blessings6` tinyint(4) NOT NULL DEFAULT '0', | |
| 98 | + | `blessings7` tinyint(4) NOT NULL DEFAULT '0', | |
| 99 | + | `blessings8` tinyint(4) NOT NULL DEFAULT '0', | |
| 100 | + | `onlinetime` int(11) NOT NULL DEFAULT '0', | |
| 101 | + | `deletion` bigint(15) NOT NULL DEFAULT '0', | |
| 102 | + | `balance` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 103 | + | `offlinetraining_time` smallint(5) UNSIGNED NOT NULL DEFAULT '43200', | |
| 104 | + | `offlinetraining_skill` tinyint(2) NOT NULL DEFAULT '-1', | |
| 105 | + | `stamina` smallint(5) UNSIGNED NOT NULL DEFAULT '2520', | |
| 106 | + | `skill_fist` int(10) UNSIGNED NOT NULL DEFAULT '10', | |
| 107 | + | `skill_fist_tries` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 108 | + | `skill_club` int(10) UNSIGNED NOT NULL DEFAULT '10', | |
| 109 | + | `skill_club_tries` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 110 | + | `skill_sword` int(10) UNSIGNED NOT NULL DEFAULT '10', | |
| 111 | + | `skill_sword_tries` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 112 | + | `skill_axe` int(10) UNSIGNED NOT NULL DEFAULT '10', | |
| 113 | + | `skill_axe_tries` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 114 | + | `skill_dist` int(10) UNSIGNED NOT NULL DEFAULT '10', | |
| 115 | + | `skill_dist_tries` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 116 | + | `skill_shielding` int(10) UNSIGNED NOT NULL DEFAULT '10', | |
| 117 | + | `skill_shielding_tries` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 118 | + | `skill_fishing` int(10) UNSIGNED NOT NULL DEFAULT '10', | |
| 119 | + | `skill_fishing_tries` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 120 | + | `skill_critical_hit_chance` int(10) UNSIGNED NOT NULL DEFAULT '0', | |
| 121 | + | `skill_critical_hit_chance_tries` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 122 | + | `skill_critical_hit_damage` int(10) UNSIGNED NOT NULL DEFAULT '0', | |
| 123 | + | `skill_critical_hit_damage_tries` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 124 | + | `skill_life_leech_chance` int(10) UNSIGNED NOT NULL DEFAULT '0', | |
| 125 | + | `skill_life_leech_chance_tries` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 126 | + | `skill_life_leech_amount` int(10) UNSIGNED NOT NULL DEFAULT '0', | |
| 127 | + | `skill_life_leech_amount_tries` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 128 | + | `skill_mana_leech_chance` int(10) UNSIGNED NOT NULL DEFAULT '0', | |
| 129 | + | `skill_mana_leech_chance_tries` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 130 | + | `skill_mana_leech_amount` int(10) UNSIGNED NOT NULL DEFAULT '0', | |
| 131 | + | `skill_mana_leech_amount_tries` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 132 | + | `skill_criticalhit_chance` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 133 | + | `skill_criticalhit_damage` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 134 | + | `skill_lifeleech_chance` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 135 | + | `skill_lifeleech_amount` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 136 | + | `skill_manaleech_chance` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 137 | + | `skill_manaleech_amount` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 138 | + | `manashield` INT UNSIGNED NOT NULL DEFAULT '0', | |
| 139 | + | `max_manashield` INT UNSIGNED NOT NULL DEFAULT '0', | |
| 140 | + | `xpboost_stamina` smallint(5) UNSIGNED DEFAULT NULL, | |
| 141 | + | `xpboost_value` tinyint(4) UNSIGNED DEFAULT NULL, | |
| 142 | + | `marriage_status` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 143 | + | `marriage_spouse` int(11) NOT NULL DEFAULT '-1', | |
| 144 | + | `bonus_rerolls` bigint(21) NOT NULL DEFAULT '0', | |
| 145 | + | `prey_wildcard` bigint(21) NOT NULL DEFAULT '0', | |
| 146 | + | `task_points` bigint(21) NOT NULL DEFAULT '0', | |
| 147 | + | `quickloot_fallback` tinyint(1) DEFAULT '0', | |
| 148 | + | `lookmountbody` tinyint(3) unsigned NOT NULL DEFAULT '0', | |
| 149 | + | `lookmountfeet` tinyint(3) unsigned NOT NULL DEFAULT '0', | |
| 150 | + | `lookmounthead` tinyint(3) unsigned NOT NULL DEFAULT '0', | |
| 151 | + | `lookmountlegs` tinyint(3) unsigned NOT NULL DEFAULT '0', | |
| 152 | + | `lookfamiliarstype` int(11) unsigned NOT NULL DEFAULT '0', | |
| 153 | + | `isreward` tinyint(1) NOT NULL DEFAULT '1', | |
| 154 | + | `istutorial` tinyint(1) NOT NULL DEFAULT '0', | |
| 155 | + | `forge_dusts` bigint(21) NOT NULL DEFAULT '0', | |
| 156 | + | `forge_dust_level` bigint(21) NOT NULL DEFAULT '100', | |
| 157 | + | `randomize_mount` tinyint(1) NOT NULL DEFAULT '0', | |
| 158 | + | `boss_points` int NOT NULL DEFAULT '0', | |
| 159 | + | `comment` varchar(255) NOT NULL DEFAULT '', | |
| 160 | + | `animus_mastery` mediumblob DEFAULT NULL, | |
| 161 | + | INDEX `account_id` (`account_id`), | |
| 162 | + | INDEX `vocation` (`vocation`), | |
| 163 | + | CONSTRAINT `players_pk` PRIMARY KEY (`id`), | |
| 164 | + | CONSTRAINT `players_unique` UNIQUE (`name`), | |
| 165 | + | CONSTRAINT `players_account_fk` | |
| 166 | + | FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) | |
| 167 | + | ON DELETE CASCADE | |
| 168 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 169 | + | ||
| 170 | + | -- Table structure `account_bans` | |
| 171 | + | CREATE TABLE IF NOT EXISTS `account_bans` ( | |
| 172 | + | `account_id` int(11) UNSIGNED NOT NULL, | |
| 173 | + | `reason` varchar(255) NOT NULL, | |
| 174 | + | `banned_at` bigint(20) NOT NULL, | |
| 175 | + | `expires_at` bigint(20) NOT NULL, | |
| 176 | + | `banned_by` int(11) NOT NULL, | |
| 177 | + | INDEX `banned_by` (`banned_by`), | |
| 178 | + | CONSTRAINT `account_bans_pk` PRIMARY KEY (`account_id`), | |
| 179 | + | CONSTRAINT `account_bans_account_fk` | |
| 180 | + | FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) | |
| 181 | + | ON DELETE CASCADE | |
| 182 | + | ON UPDATE CASCADE, | |
| 183 | + | CONSTRAINT `account_bans_player_fk` | |
| 184 | + | FOREIGN KEY (`banned_by`) REFERENCES `players` (`id`) | |
| 185 | + | ON DELETE CASCADE | |
| 186 | + | ON UPDATE CASCADE | |
| 187 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 188 | + | ||
| 189 | + | -- Table structure `account_ban_history` | |
| 190 | + | CREATE TABLE IF NOT EXISTS `account_ban_history` ( | |
| 191 | + | `id` int(11) NOT NULL AUTO_INCREMENT, | |
| 192 | + | `account_id` int(11) UNSIGNED NOT NULL, | |
| 193 | + | `reason` varchar(255) NOT NULL, | |
| 194 | + | `banned_at` bigint(20) NOT NULL, | |
| 195 | + | `expired_at` bigint(20) NOT NULL, | |
| 196 | + | `banned_by` int(11) NOT NULL, | |
| 197 | + | INDEX `account_id` (`account_id`), | |
| 198 | + | INDEX `banned_by` (`banned_by`), | |
| 199 | + | CONSTRAINT `account_bans_history_account_fk` | |
| 200 | + | FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) | |
| 201 | + | ON DELETE CASCADE | |
| 202 | + | ON UPDATE CASCADE, | |
| 203 | + | CONSTRAINT `account_bans_history_player_fk` | |
| 204 | + | FOREIGN KEY (`banned_by`) REFERENCES `players` (`id`) | |
| 205 | + | ON DELETE CASCADE | |
| 206 | + | ON UPDATE CASCADE, | |
| 207 | + | CONSTRAINT `account_ban_history_pk` PRIMARY KEY (`id`) | |
| 208 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 209 | + | ||
| 210 | + | -- Table structure `account_viplist` | |
| 211 | + | CREATE TABLE IF NOT EXISTS `account_viplist` ( | |
| 212 | + | `account_id` int(11) UNSIGNED NOT NULL COMMENT 'id of account whose viplist entry it is', | |
| 213 | + | `player_id` int(11) NOT NULL COMMENT 'id of target player of viplist entry', | |
| 214 | + | `description` varchar(128) NOT NULL DEFAULT '', | |
| 215 | + | `icon` tinyint(2) UNSIGNED NOT NULL DEFAULT '0', | |
| 216 | + | `notify` tinyint(1) NOT NULL DEFAULT '0', | |
| 217 | + | INDEX `account_id` (`account_id`), | |
| 218 | + | INDEX `player_id` (`player_id`), | |
| 219 | + | CONSTRAINT `account_viplist_unique` UNIQUE (`account_id`, `player_id`), | |
| 220 | + | CONSTRAINT `account_viplist_account_fk` | |
| 221 | + | FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) | |
| 222 | + | ON DELETE CASCADE, | |
| 223 | + | CONSTRAINT `account_viplist_player_fk` | |
| 224 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 225 | + | ON DELETE CASCADE | |
| 226 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 227 | + | ||
| 228 | + | -- Table structure `account_vipgroup` | |
| 229 | + | CREATE TABLE IF NOT EXISTS `account_vipgroups` ( | |
| 230 | + | `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 231 | + | `account_id` int(11) UNSIGNED NOT NULL COMMENT 'id of account whose vip group entry it is', | |
| 232 | + | `name` varchar(128) NOT NULL, | |
| 233 | + | `customizable` BOOLEAN NOT NULL DEFAULT '1', | |
| 234 | + | CONSTRAINT `account_vipgroups_pk` PRIMARY KEY (`id`, `account_id`), | |
| 235 | + | CONSTRAINT `account_vipgroups_accounts_fk` | |
| 236 | + | FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) | |
| 237 | + | ON DELETE CASCADE | |
| 238 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 239 | + | ||
| 240 | + | -- | |
| 241 | + | -- Trigger | |
| 242 | + | -- | |
| 243 | + | DELIMITER // | |
| 244 | + | CREATE TRIGGER `oncreate_accounts` AFTER INSERT ON `accounts` FOR EACH ROW BEGIN | |
| 245 | + | INSERT INTO `account_vipgroups` (`account_id`, `name`, `customizable`) VALUES (NEW.`id`, 'Enemies', 0); | |
| 246 | + | INSERT INTO `account_vipgroups` (`account_id`, `name`, `customizable`) VALUES (NEW.`id`, 'Friends', 0); | |
| 247 | + | INSERT INTO `account_vipgroups` (`account_id`, `name`, `customizable`) VALUES (NEW.`id`, 'Trading Partner', 0); | |
| 248 | + | END | |
| 249 | + | // | |
| 250 | + | DELIMITER ; | |
| 251 | + | ||
| 252 | + | -- Table structure `account_vipgrouplist` | |
| 253 | + | CREATE TABLE IF NOT EXISTS `account_vipgrouplist` ( | |
| 254 | + | `account_id` int(11) UNSIGNED NOT NULL COMMENT 'id of account whose viplist entry it is', | |
| 255 | + | `player_id` int(11) NOT NULL COMMENT 'id of target player of viplist entry', | |
| 256 | + | `vipgroup_id` int(11) UNSIGNED NOT NULL COMMENT 'id of vip group that player belongs', | |
| 257 | + | INDEX `account_id` (`account_id`), | |
| 258 | + | INDEX `player_id` (`player_id`), | |
| 259 | + | INDEX `vipgroup_id` (`vipgroup_id`), | |
| 260 | + | CONSTRAINT `account_vipgrouplist_unique` UNIQUE (`account_id`, `player_id`, `vipgroup_id`), | |
| 261 | + | CONSTRAINT `account_vipgrouplist_player_fk` | |
| 262 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 263 | + | ON DELETE CASCADE, | |
| 264 | + | CONSTRAINT `account_vipgrouplist_vipgroup_fk` | |
| 265 | + | FOREIGN KEY (`vipgroup_id`, `account_id`) REFERENCES `account_vipgroups` (`id`, `account_id`) | |
| 266 | + | ON DELETE CASCADE | |
| 267 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 268 | + | ||
| 269 | + | -- Table structure `boosted_boss` | |
| 270 | + | CREATE TABLE IF NOT EXISTS `boosted_boss` ( | |
| 271 | + | `boostname` TEXT, | |
| 272 | + | `date` varchar(250) NOT NULL DEFAULT '', | |
| 273 | + | `raceid` varchar(250) NOT NULL DEFAULT '', | |
| 274 | + | `looktypeEx` int(11) NOT NULL DEFAULT 0, | |
| 275 | + | `looktype` int(11) NOT NULL DEFAULT 136, | |
| 276 | + | `lookfeet` int(11) NOT NULL DEFAULT 0, | |
| 277 | + | `looklegs` int(11) NOT NULL DEFAULT 0, | |
| 278 | + | `lookhead` int(11) NOT NULL DEFAULT 0, | |
| 279 | + | `lookbody` int(11) NOT NULL DEFAULT 0, | |
| 280 | + | `lookaddons` int(11) NOT NULL DEFAULT 0, | |
| 281 | + | `lookmount` int(11) DEFAULT 0, | |
| 282 | + | PRIMARY KEY (`date`) | |
| 283 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 284 | + | ||
| 285 | + | INSERT INTO `boosted_boss` (`boostname`, `date`, `raceid`) VALUES ('default', 0, 0); | |
| 286 | + | ||
| 287 | + | -- Table structure `boosted_creature` | |
| 288 | + | CREATE TABLE IF NOT EXISTS `boosted_creature` ( | |
| 289 | + | `boostname` TEXT, | |
| 290 | + | `date` varchar(250) NOT NULL DEFAULT '', | |
| 291 | + | `raceid` varchar(250) NOT NULL DEFAULT '', | |
| 292 | + | `looktype` int(11) NOT NULL DEFAULT 136, | |
| 293 | + | `lookfeet` int(11) NOT NULL DEFAULT 0, | |
| 294 | + | `looklegs` int(11) NOT NULL DEFAULT 0, | |
| 295 | + | `lookhead` int(11) NOT NULL DEFAULT 0, | |
| 296 | + | `lookbody` int(11) NOT NULL DEFAULT 0, | |
| 297 | + | `lookaddons` int(11) NOT NULL DEFAULT 0, | |
| 298 | + | `lookmount` int(11) DEFAULT 0, | |
| 299 | + | PRIMARY KEY (`date`) | |
| 300 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 301 | + | ||
| 302 | + | INSERT INTO `boosted_creature` (`boostname`, `date`, `raceid`) VALUES ('default', 0, 0); | |
| 303 | + | ||
| 304 | + | -- Tabble Structure `daily_reward_history` | |
| 305 | + | CREATE TABLE IF NOT EXISTS `daily_reward_history` ( | |
| 306 | + | `id` int(11) NOT NULL AUTO_INCREMENT, | |
| 307 | + | `daystreak` smallint(2) NOT NULL DEFAULT 0, | |
| 308 | + | `player_id` int(11) NOT NULL, | |
| 309 | + | `timestamp` int(11) NOT NULL, | |
| 310 | + | `description` varchar(255) DEFAULT NULL, | |
| 311 | + | INDEX `player_id` (`player_id`), | |
| 312 | + | CONSTRAINT `daily_reward_history_pk` PRIMARY KEY (`id`), | |
| 313 | + | CONSTRAINT `daily_reward_history_player_fk` | |
| 314 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 315 | + | ON DELETE CASCADE | |
| 316 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 317 | + | ||
| 318 | + | -- Tabble Structure `forge_history` | |
| 319 | + | CREATE TABLE IF NOT EXISTS `forge_history` ( | |
| 320 | + | `id` int NOT NULL AUTO_INCREMENT, | |
| 321 | + | `player_id` int NOT NULL, | |
| 322 | + | `action_type` int NOT NULL DEFAULT '0', | |
| 323 | + | `description` text NOT NULL, | |
| 324 | + | `is_success` tinyint NOT NULL DEFAULT '0', | |
| 325 | + | `bonus` tinyint NOT NULL DEFAULT '0', | |
| 326 | + | `done_at` bigint NOT NULL, | |
| 327 | + | `done_at_date` datetime DEFAULT NOW(), | |
| 328 | + | `cost` bigint UNSIGNED NOT NULL DEFAULT '0', | |
| 329 | + | `gained` bigint UNSIGNED NOT NULL DEFAULT '0', | |
| 330 | + | CONSTRAINT `forge_history_pk` PRIMARY KEY (`id`), | |
| 331 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE, | |
| 332 | + | UNIQUE KEY `unique_player_done_at` (`player_id`, `done_at`) | |
| 333 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 334 | + | ||
| 335 | + | -- Table structure `global_storage` | |
| 336 | + | CREATE TABLE IF NOT EXISTS `global_storage` ( | |
| 337 | + | `key` varchar(32) NOT NULL, | |
| 338 | + | `value` text NOT NULL, | |
| 339 | + | CONSTRAINT `global_storage_unique` UNIQUE (`key`) | |
| 340 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 341 | + | ||
| 342 | + | -- Table structure `guilds` | |
| 343 | + | CREATE TABLE IF NOT EXISTS `guilds` ( | |
| 344 | + | `id` int(11) NOT NULL AUTO_INCREMENT, | |
| 345 | + | `level` int(11) NOT NULL DEFAULT '1', | |
| 346 | + | `name` varchar(255) NOT NULL, | |
| 347 | + | `ownerid` int(11) NOT NULL, | |
| 348 | + | `creationdata` int(11) NOT NULL, | |
| 349 | + | `motd` varchar(255) NOT NULL DEFAULT '', | |
| 350 | + | `residence` int(11) NOT NULL DEFAULT '0', | |
| 351 | + | `balance` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 352 | + | `points` int(11) NOT NULL DEFAULT '0', | |
| 353 | + | CONSTRAINT `guilds_pk` PRIMARY KEY (`id`), | |
| 354 | + | CONSTRAINT `guilds_name_unique` UNIQUE (`name`), | |
| 355 | + | CONSTRAINT `guilds_owner_unique` UNIQUE (`ownerid`), | |
| 356 | + | CONSTRAINT `guilds_ownerid_fk` | |
| 357 | + | FOREIGN KEY (`ownerid`) REFERENCES `players` (`id`) | |
| 358 | + | ON DELETE CASCADE | |
| 359 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 360 | + | ||
| 361 | + | -- Table structure `guild_wars` | |
| 362 | + | CREATE TABLE IF NOT EXISTS `guild_wars` ( | |
| 363 | + | `id` int(11) NOT NULL AUTO_INCREMENT, | |
| 364 | + | `guild1` int(11) NOT NULL DEFAULT '0', | |
| 365 | + | `guild2` int(11) NOT NULL DEFAULT '0', | |
| 366 | + | `name1` varchar(255) NOT NULL, | |
| 367 | + | `name2` varchar(255) NOT NULL, | |
| 368 | + | `status` tinyint(2) UNSIGNED NOT NULL DEFAULT '0', | |
| 369 | + | `started` bigint(15) NOT NULL DEFAULT '0', | |
| 370 | + | `ended` bigint(15) NOT NULL DEFAULT '0', | |
| 371 | + | `frags_limit` smallint(4) UNSIGNED NOT NULL DEFAULT '0', | |
| 372 | + | `payment` bigint(13) UNSIGNED NOT NULL DEFAULT '0', | |
| 373 | + | `duration_days` tinyint(3) UNSIGNED NOT NULL DEFAULT '0', | |
| 374 | + | INDEX `guild1` (`guild1`), | |
| 375 | + | INDEX `guild2` (`guild2`), | |
| 376 | + | CONSTRAINT `guild_wars_pk` PRIMARY KEY (`id`) | |
| 377 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 378 | + | ||
| 379 | + | -- Table structure `guildwar_kills` | |
| 380 | + | CREATE TABLE IF NOT EXISTS `guildwar_kills` ( | |
| 381 | + | `id` int(11) NOT NULL AUTO_INCREMENT, | |
| 382 | + | `killer` varchar(50) NOT NULL, | |
| 383 | + | `target` varchar(50) NOT NULL, | |
| 384 | + | `killerguild` int(11) NOT NULL DEFAULT '0', | |
| 385 | + | `targetguild` int(11) NOT NULL DEFAULT '0', | |
| 386 | + | `warid` int(11) NOT NULL DEFAULT '0', | |
| 387 | + | `time` bigint(15) NOT NULL, | |
| 388 | + | INDEX `warid` (`warid`), | |
| 389 | + | CONSTRAINT `guildwar_kills_pk` PRIMARY KEY (`id`), | |
| 390 | + | CONSTRAINT `guildwar_kills_warid_fk` | |
| 391 | + | FOREIGN KEY (`warid`) REFERENCES `guild_wars` (`id`) | |
| 392 | + | ON DELETE CASCADE | |
| 393 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 394 | + | ||
| 395 | + | -- Table structure `guild_invites` | |
| 396 | + | CREATE TABLE IF NOT EXISTS `guild_invites` ( | |
| 397 | + | `player_id` int(11) NOT NULL DEFAULT '0', | |
| 398 | + | `guild_id` int(11) NOT NULL DEFAULT '0', | |
| 399 | + | `date` int(11) NOT NULL, | |
| 400 | + | INDEX `guild_id` (`guild_id`), | |
| 401 | + | CONSTRAINT `guild_invites_pk` PRIMARY KEY (`player_id`, `guild_id`), | |
| 402 | + | CONSTRAINT `guild_invites_player_fk` | |
| 403 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 404 | + | ON DELETE CASCADE, | |
| 405 | + | CONSTRAINT `guild_invites_guild_fk` | |
| 406 | + | FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) | |
| 407 | + | ON DELETE CASCADE | |
| 408 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 409 | + | ||
| 410 | + | -- Table structure `guild_ranks` | |
| 411 | + | CREATE TABLE IF NOT EXISTS `guild_ranks` ( | |
| 412 | + | `id` int(11) NOT NULL AUTO_INCREMENT, | |
| 413 | + | `guild_id` int(11) NOT NULL COMMENT 'guild', | |
| 414 | + | `name` varchar(255) NOT NULL COMMENT 'rank name', | |
| 415 | + | `level` int(11) NOT NULL COMMENT 'rank level - leader, vice, member, maybe something else', | |
| 416 | + | INDEX `guild_id` (`guild_id`), | |
| 417 | + | CONSTRAINT `guild_ranks_pk` PRIMARY KEY (`id`), | |
| 418 | + | CONSTRAINT `guild_ranks_fk` | |
| 419 | + | FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) | |
| 420 | + | ON DELETE CASCADE | |
| 421 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 422 | + | ||
| 423 | + | -- | |
| 424 | + | -- Trigger | |
| 425 | + | -- | |
| 426 | + | DELIMITER // | |
| 427 | + | CREATE TRIGGER `oncreate_guilds` AFTER INSERT ON `guilds` FOR EACH ROW BEGIN | |
| 428 | + | INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('The Leader', 3, NEW.`id`); | |
| 429 | + | INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Vice-Leader', 2, NEW.`id`); | |
| 430 | + | INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Member', 1, NEW.`id`); | |
| 431 | + | END | |
| 432 | + | // | |
| 433 | + | DELIMITER ; | |
| 434 | + | ||
| 435 | + | -- Table structure `guild_membership` | |
| 436 | + | CREATE TABLE IF NOT EXISTS `guild_membership` ( | |
| 437 | + | `player_id` int(11) NOT NULL, | |
| 438 | + | `guild_id` int(11) NOT NULL, | |
| 439 | + | `rank_id` int(11) NOT NULL, | |
| 440 | + | `nick` varchar(15) NOT NULL DEFAULT '', | |
| 441 | + | INDEX `guild_id` (`guild_id`), | |
| 442 | + | INDEX `rank_id` (`rank_id`), | |
| 443 | + | CONSTRAINT `guild_membership_pk` PRIMARY KEY (`player_id`), | |
| 444 | + | CONSTRAINT `guild_membership_player_fk` | |
| 445 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 446 | + | ON DELETE CASCADE | |
| 447 | + | ON UPDATE CASCADE, | |
| 448 | + | CONSTRAINT `guild_membership_guild_fk` | |
| 449 | + | FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) | |
| 450 | + | ON DELETE CASCADE | |
| 451 | + | ON UPDATE CASCADE, | |
| 452 | + | CONSTRAINT `guild_membership_rank_fk` | |
| 453 | + | FOREIGN KEY (`rank_id`) REFERENCES `guild_ranks` (`id`) | |
| 454 | + | ON DELETE CASCADE | |
| 455 | + | ON UPDATE CASCADE | |
| 456 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 457 | + | ||
| 458 | + | -- Table structure `houses` | |
| 459 | + | CREATE TABLE IF NOT EXISTS `houses` ( | |
| 460 | + | `id` int(11) NOT NULL AUTO_INCREMENT, | |
| 461 | + | `owner` int(11) NOT NULL, | |
| 462 | + | `new_owner` int(11) NOT NULL DEFAULT '-1', | |
| 463 | + | `paid` int(10) UNSIGNED NOT NULL DEFAULT '0', | |
| 464 | + | `warnings` int(11) NOT NULL DEFAULT '0', | |
| 465 | + | `name` varchar(255) NOT NULL, | |
| 466 | + | `rent` int(11) NOT NULL DEFAULT '0', | |
| 467 | + | `town_id` int(11) NOT NULL DEFAULT '0', | |
| 468 | + | `size` int(11) NOT NULL DEFAULT '0', | |
| 469 | + | `guildid` int(11), | |
| 470 | + | `beds` int(11) NOT NULL DEFAULT '0', | |
| 471 | + | `bidder` int(11) NOT NULL DEFAULT '0', | |
| 472 | + | `bidder_name` varchar(255) NOT NULL DEFAULT '', | |
| 473 | + | `highest_bid` int(11) NOT NULL DEFAULT '0', | |
| 474 | + | `internal_bid` int(11) NOT NULL DEFAULT '0', | |
| 475 | + | `bid_end_date` int(11) NOT NULL DEFAULT '0', | |
| 476 | + | `state` smallint(5) UNSIGNED NOT NULL DEFAULT '0', | |
| 477 | + | `transfer_status` tinyint(1) DEFAULT '0', | |
| 478 | + | INDEX `owner` (`owner`), | |
| 479 | + | INDEX `town_id` (`town_id`), | |
| 480 | + | CONSTRAINT `houses_pk` PRIMARY KEY (`id`) | |
| 481 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 482 | + | ||
| 483 | + | -- | |
| 484 | + | -- trigger | |
| 485 | + | -- | |
| 486 | + | DELIMITER // | |
| 487 | + | CREATE TRIGGER `ondelete_players` BEFORE DELETE ON `players` FOR EACH ROW BEGIN | |
| 488 | + | UPDATE `houses` SET `owner` = 0 WHERE `owner` = OLD.`id`; | |
| 489 | + | END | |
| 490 | + | // | |
| 491 | + | DELIMITER ; | |
| 492 | + | ||
| 493 | + | -- Table structure `house_lists` | |
| 494 | + | CREATE TABLE IF NOT EXISTS `house_lists` ( | |
| 495 | + | `house_id` int NOT NULL, | |
| 496 | + | `listid` int NOT NULL, | |
| 497 | + | `version` bigint NOT NULL DEFAULT '0', | |
| 498 | + | `list` text NOT NULL, | |
| 499 | + | PRIMARY KEY (`house_id`, `listid`), | |
| 500 | + | KEY `house_id_index` (`house_id`), | |
| 501 | + | KEY `version` (`version`), | |
| 502 | + | CONSTRAINT `houses_list_house_fk` FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE | |
| 503 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; | |
| 504 | + | ||
| 505 | + | -- Table structure `ip_bans` | |
| 506 | + | CREATE TABLE IF NOT EXISTS `ip_bans` ( | |
| 507 | + | `ip` int(11) NOT NULL, | |
| 508 | + | `reason` varchar(255) NOT NULL, | |
| 509 | + | `banned_at` bigint(20) NOT NULL, | |
| 510 | + | `expires_at` bigint(20) NOT NULL, | |
| 511 | + | `banned_by` int(11) NOT NULL, | |
| 512 | + | INDEX `banned_by` (`banned_by`), | |
| 513 | + | CONSTRAINT `ip_bans_pk` PRIMARY KEY (`ip`), | |
| 514 | + | CONSTRAINT `ip_bans_players_fk` | |
| 515 | + | FOREIGN KEY (`banned_by`) REFERENCES `players` (`id`) | |
| 516 | + | ON DELETE CASCADE | |
| 517 | + | ON UPDATE CASCADE | |
| 518 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 519 | + | ||
| 520 | + | -- Table structure `market_history` | |
| 521 | + | CREATE TABLE IF NOT EXISTS `market_history` ( | |
| 522 | + | `id` int(11) NOT NULL AUTO_INCREMENT, | |
| 523 | + | `player_id` int(11) NOT NULL, | |
| 524 | + | `sale` tinyint(1) NOT NULL DEFAULT '0', | |
| 525 | + | `itemtype` int(10) UNSIGNED NOT NULL, | |
| 526 | + | `amount` smallint(5) UNSIGNED NOT NULL, | |
| 527 | + | `price` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 528 | + | `expires_at` bigint(20) UNSIGNED NOT NULL, | |
| 529 | + | `inserted` bigint(20) UNSIGNED NOT NULL, | |
| 530 | + | `state` tinyint(1) UNSIGNED NOT NULL, | |
| 531 | + | `tier` tinyint UNSIGNED NOT NULL DEFAULT '0', | |
| 532 | + | INDEX `player_id` (`player_id`,`sale`), | |
| 533 | + | CONSTRAINT `market_history_pk` PRIMARY KEY (`id`), | |
| 534 | + | CONSTRAINT `market_history_players_fk` | |
| 535 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 536 | + | ON DELETE CASCADE | |
| 537 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 538 | + | ||
| 539 | + | -- Table structure `market_offers` | |
| 540 | + | CREATE TABLE IF NOT EXISTS `market_offers` ( | |
| 541 | + | `id` int(11) NOT NULL AUTO_INCREMENT, | |
| 542 | + | `player_id` int(11) NOT NULL, | |
| 543 | + | `sale` tinyint(1) NOT NULL DEFAULT '0', | |
| 544 | + | `itemtype` int(10) UNSIGNED NOT NULL, | |
| 545 | + | `amount` smallint(5) UNSIGNED NOT NULL, | |
| 546 | + | `created` bigint(20) UNSIGNED NOT NULL, | |
| 547 | + | `anonymous` tinyint(1) NOT NULL DEFAULT '0', | |
| 548 | + | `price` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 549 | + | `tier` tinyint UNSIGNED NOT NULL DEFAULT '0', | |
| 550 | + | INDEX `sale` (`sale`,`itemtype`), | |
| 551 | + | INDEX `created` (`created`), | |
| 552 | + | INDEX `player_id` (`player_id`), | |
| 553 | + | CONSTRAINT `market_offers_pk` PRIMARY KEY (`id`), | |
| 554 | + | CONSTRAINT `market_offers_players_fk` | |
| 555 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 556 | + | ON DELETE CASCADE | |
| 557 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 558 | + | ||
| 559 | + | -- Table structure `players_online` | |
| 560 | + | CREATE TABLE IF NOT EXISTS `players_online` ( | |
| 561 | + | `player_id` int(11) NOT NULL, | |
| 562 | + | CONSTRAINT `players_online_pk` PRIMARY KEY (`player_id`), | |
| 563 | + | CONSTRAINT `players_online_players_fk` | |
| 564 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 565 | + | ON DELETE CASCADE | |
| 566 | + | ) ENGINE=MEMORY DEFAULT CHARSET=utf8; | |
| 567 | + | ||
| 568 | + | -- Table structure `active_livestream_casters` | |
| 569 | + | CREATE TABLE IF NOT EXISTS `active_livestream_casters` ( | |
| 570 | + | `caster_id` int(11) NOT NULL, | |
| 571 | + | `livestream_status` tinyint(1) UNSIGNED NOT NULL DEFAULT '0', | |
| 572 | + | `livestream_viewers` int(11) UNSIGNED NOT NULL DEFAULT '0', | |
| 573 | + | CONSTRAINT `active_livestream_casters_pk` PRIMARY KEY (`caster_id`), | |
| 574 | + | CONSTRAINT `active_livestream_casters_players_fk` | |
| 575 | + | FOREIGN KEY (`caster_id`) REFERENCES `players` (`id`) | |
| 576 | + | ON DELETE CASCADE | |
| 577 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 578 | + | ||
| 579 | + | -- Table structure `player_charm` | |
| 580 | + | CREATE TABLE IF NOT EXISTS `player_charms` ( | |
| 581 | + | `player_id` int(11) NOT NULL, | |
| 582 | + | `charm_points` SMALLINT NOT NULL DEFAULT '0', | |
| 583 | + | `minor_charm_echoes` SMALLINT NOT NULL DEFAULT '0', | |
| 584 | + | `max_charm_points` SMALLINT NOT NULL DEFAULT '0', | |
| 585 | + | `max_minor_charm_echoes` SMALLINT NOT NULL DEFAULT '0', | |
| 586 | + | `charm_expansion` BOOLEAN NOT NULL DEFAULT FALSE, | |
| 587 | + | `UsedRunesBit` INT NOT NULL DEFAULT '0', | |
| 588 | + | `UnlockedRunesBit` INT NOT NULL DEFAULT '0', | |
| 589 | + | `charms` BLOB NULL, | |
| 590 | + | `tracker list` BLOB NULL, | |
| 591 | + | CONSTRAINT `player_charms_players_fk` | |
| 592 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 593 | + | ON DELETE CASCADE | |
| 594 | + | ) ENGINE = InnoDB DEFAULT CHARSET=utf8; | |
| 595 | + | ||
| 596 | + | -- Table structure `player_deaths` | |
| 597 | + | CREATE TABLE IF NOT EXISTS `player_deaths` ( | |
| 598 | + | `player_id` int(11) NOT NULL, | |
| 599 | + | `time` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 600 | + | `level` int(11) NOT NULL DEFAULT '1', | |
| 601 | + | `killed_by` varchar(255) NOT NULL, | |
| 602 | + | `is_player` tinyint(1) NOT NULL DEFAULT '1', | |
| 603 | + | `mostdamage_by` varchar(100) NOT NULL, | |
| 604 | + | `mostdamage_is_player` tinyint(1) NOT NULL DEFAULT '0', | |
| 605 | + | `unjustified` tinyint(1) NOT NULL DEFAULT '0', | |
| 606 | + | `mostdamage_unjustified` tinyint(1) NOT NULL DEFAULT '0', | |
| 607 | + | `participants` TEXT NOT NULL, | |
| 608 | + | INDEX `player_id` (`player_id`), | |
| 609 | + | INDEX `killed_by` (`killed_by`), | |
| 610 | + | INDEX `mostdamage_by` (`mostdamage_by`), | |
| 611 | + | CONSTRAINT `player_deaths_players_fk` | |
| 612 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 613 | + | ON DELETE CASCADE | |
| 614 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 615 | + | ||
| 616 | + | -- Table structure `player_depotitems` | |
| 617 | + | CREATE TABLE IF NOT EXISTS `player_depotitems` ( | |
| 618 | + | `player_id` int(11) NOT NULL, | |
| 619 | + | `sid` int(11) NOT NULL COMMENT 'any given range eg 0-100 will be reserved for depot lockers and all > 100 will be then normal items inside depots', | |
| 620 | + | `pid` int(11) NOT NULL DEFAULT '0', | |
| 621 | + | `itemtype` int(11) NOT NULL DEFAULT '0', | |
| 622 | + | `count` int(11) NOT NULL DEFAULT '0', | |
| 623 | + | `attributes` blob NOT NULL, | |
| 624 | + | CONSTRAINT `player_depotitems_unique` UNIQUE (`player_id`, `sid`), | |
| 625 | + | CONSTRAINT `player_depotitems_players_fk` | |
| 626 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 627 | + | ON DELETE CASCADE | |
| 628 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 629 | + | ||
| 630 | + | -- Table structure `player_hirelings` | |
| 631 | + | CREATE TABLE IF NOT EXISTS `player_hirelings` ( | |
| 632 | + | `id` INT NOT NULL PRIMARY KEY auto_increment, | |
| 633 | + | `player_id` INT NOT NULL, | |
| 634 | + | `name` varchar(255), | |
| 635 | + | `active` tinyint unsigned NOT NULL DEFAULT '0', | |
| 636 | + | `sex` tinyint unsigned NOT NULL DEFAULT '0', | |
| 637 | + | `posx` int(11) NOT NULL DEFAULT '0', | |
| 638 | + | `posy` int(11) NOT NULL DEFAULT '0', | |
| 639 | + | `posz` int(11) NOT NULL DEFAULT '0', | |
| 640 | + | `lookbody` int(11) NOT NULL DEFAULT '0', | |
| 641 | + | `lookfeet` int(11) NOT NULL DEFAULT '0', | |
| 642 | + | `lookhead` int(11) NOT NULL DEFAULT '0', | |
| 643 | + | `looklegs` int(11) NOT NULL DEFAULT '0', | |
| 644 | + | `looktype` int(11) NOT NULL DEFAULT '136', | |
| 645 | + | FOREIGN KEY(`player_id`) REFERENCES `players`(`id`) | |
| 646 | + | ON DELETE CASCADE | |
| 647 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 648 | + | ||
| 649 | + | -- Table structure `player_inboxitems` | |
| 650 | + | CREATE TABLE IF NOT EXISTS `player_inboxitems` ( | |
| 651 | + | `player_id` int(11) NOT NULL, | |
| 652 | + | `sid` int(11) NOT NULL, | |
| 653 | + | `pid` int(11) NOT NULL DEFAULT '0', | |
| 654 | + | `itemtype` int(11) NOT NULL DEFAULT '0', | |
| 655 | + | `count` int(11) NOT NULL DEFAULT '0', | |
| 656 | + | `attributes` blob NOT NULL, | |
| 657 | + | CONSTRAINT `player_inboxitems_unique` UNIQUE (`player_id`, `sid`), | |
| 658 | + | CONSTRAINT `player_inboxitems_players_fk` | |
| 659 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 660 | + | ON DELETE CASCADE | |
| 661 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 662 | + | ||
| 663 | + | -- Table structure `player_items` | |
| 664 | + | CREATE TABLE IF NOT EXISTS `player_items` ( | |
| 665 | + | `player_id` int(11) NOT NULL DEFAULT '0', | |
| 666 | + | `pid` int(11) NOT NULL DEFAULT '0', | |
| 667 | + | `sid` int(11) NOT NULL DEFAULT '0', | |
| 668 | + | `itemtype` int(11) NOT NULL DEFAULT '0', | |
| 669 | + | `count` int(11) NOT NULL DEFAULT '0', | |
| 670 | + | `attributes` blob NOT NULL, | |
| 671 | + | INDEX `player_id` (`player_id`), | |
| 672 | + | INDEX `sid` (`sid`), | |
| 673 | + | CONSTRAINT `player_items_players_fk` | |
| 674 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 675 | + | ON DELETE CASCADE, | |
| 676 | + | CONSTRAINT `player_items_pk` | |
| 677 | + | PRIMARY KEY (`player_id`, `pid`, `sid`) | |
| 678 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 679 | + | ||
| 680 | + | -- Table structure `player_wheeldata` | |
| 681 | + | CREATE TABLE IF NOT EXISTS `player_wheeldata` ( | |
| 682 | + | `player_id` int(11) NOT NULL, | |
| 683 | + | `slot` blob NOT NULL, | |
| 684 | + | INDEX `player_id` (`player_id`), | |
| 685 | + | CONSTRAINT `player_wheeldata_players_fk` | |
| 686 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 687 | + | ON DELETE CASCADE, | |
| 688 | + | CONSTRAINT `player_wheeldata_pk` | |
| 689 | + | PRIMARY KEY (`player_id`) | |
| 690 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 691 | + | ||
| 692 | + | -- Table structure `player_kills` | |
| 693 | + | CREATE TABLE IF NOT EXISTS `player_kills` ( | |
| 694 | + | `player_id` int(11) NOT NULL, | |
| 695 | + | `time` bigint(20) UNSIGNED NOT NULL DEFAULT '0', | |
| 696 | + | `target` int(11) NOT NULL, | |
| 697 | + | `unavenged` tinyint(1) NOT NULL DEFAULT '0', | |
| 698 | + | CONSTRAINT `player_kills_players_fk` | |
| 699 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 700 | + | ON DELETE CASCADE | |
| 701 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 702 | + | ||
| 703 | + | -- Table structure `player_namelocks` | |
| 704 | + | CREATE TABLE IF NOT EXISTS `player_namelocks` ( | |
| 705 | + | `player_id` int(11) NOT NULL, | |
| 706 | + | `reason` varchar(255) NOT NULL, | |
| 707 | + | `namelocked_at` bigint(20) NOT NULL, | |
| 708 | + | `namelocked_by` int(11) NOT NULL, | |
| 709 | + | INDEX `namelocked_by` (`namelocked_by`), | |
| 710 | + | CONSTRAINT `player_namelocks_unique` UNIQUE (`player_id`), | |
| 711 | + | CONSTRAINT `player_namelocks_players_fk` | |
| 712 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 713 | + | ON DELETE CASCADE | |
| 714 | + | ON UPDATE CASCADE, | |
| 715 | + | CONSTRAINT `player_namelocks_players2_fk` | |
| 716 | + | FOREIGN KEY (`namelocked_by`) REFERENCES `players` (`id`) | |
| 717 | + | ON DELETE CASCADE | |
| 718 | + | ON UPDATE CASCADE | |
| 719 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 720 | + | ||
| 721 | + | -- Table structure `player_prey` | |
| 722 | + | CREATE TABLE IF NOT EXISTS `player_prey` ( | |
| 723 | + | `player_id` int(11) NOT NULL, | |
| 724 | + | `slot` tinyint(1) NOT NULL, | |
| 725 | + | `state` tinyint(1) NOT NULL, | |
| 726 | + | `raceid` varchar(250) NOT NULL, | |
| 727 | + | `option` tinyint(1) NOT NULL, | |
| 728 | + | `bonus_type` tinyint(1) NOT NULL, | |
| 729 | + | `bonus_rarity` tinyint(1) NOT NULL, | |
| 730 | + | `bonus_percentage` varchar(250) NOT NULL, | |
| 731 | + | `bonus_time` varchar(250) NOT NULL, | |
| 732 | + | `free_reroll` bigint(20) NOT NULL, | |
| 733 | + | `monster_list` BLOB NULL, | |
| 734 | + | CONSTRAINT `player_prey_pk` PRIMARY KEY (`player_id`, `slot`), | |
| 735 | + | CONSTRAINT `player_prey_players_fk` | |
| 736 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 737 | + | ON DELETE CASCADE | |
| 738 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 739 | + | ||
| 740 | + | -- Table structure `player_taskhunt` | |
| 741 | + | CREATE TABLE IF NOT EXISTS `player_taskhunt` ( | |
| 742 | + | `player_id` int(11) NOT NULL, | |
| 743 | + | `slot` tinyint(1) NOT NULL, | |
| 744 | + | `state` tinyint(1) NOT NULL, | |
| 745 | + | `raceid` varchar(250) NOT NULL, | |
| 746 | + | `upgrade` tinyint(1) NOT NULL, | |
| 747 | + | `rarity` tinyint(1) NOT NULL, | |
| 748 | + | `kills` varchar(250) NOT NULL, | |
| 749 | + | `disabled_time` bigint(20) NOT NULL, | |
| 750 | + | `free_reroll` bigint(20) NOT NULL, | |
| 751 | + | `monster_list` BLOB NULL, | |
| 752 | + | CONSTRAINT `player_taskhunt_pk` PRIMARY KEY (`player_id`, `slot`), | |
| 753 | + | CONSTRAINT `player_taskhunt_players_fk` | |
| 754 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 755 | + | ON DELETE CASCADE | |
| 756 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 757 | + | ||
| 758 | + | -- Table structure `player_bosstiary` | |
| 759 | + | CREATE TABLE IF NOT EXISTS `player_bosstiary` ( | |
| 760 | + | `player_id` int NOT NULL, | |
| 761 | + | `bossIdSlotOne` int NOT NULL DEFAULT 0, | |
| 762 | + | `bossIdSlotTwo` int NOT NULL DEFAULT 0, | |
| 763 | + | `removeTimes` int NOT NULL DEFAULT 1, | |
| 764 | + | `tracker` blob NOT NULL, | |
| 765 | + | CONSTRAINT `player_bosstiary_players_fk` | |
| 766 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 767 | + | ON DELETE CASCADE | |
| 768 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 769 | + | ||
| 770 | + | -- Table structure `player_rewards` | |
| 771 | + | CREATE TABLE IF NOT EXISTS `player_rewards` ( | |
| 772 | + | `player_id` int(11) NOT NULL, | |
| 773 | + | `sid` int(11) NOT NULL, | |
| 774 | + | `pid` int(11) NOT NULL DEFAULT '0', | |
| 775 | + | `itemtype` int(11) NOT NULL DEFAULT '0', | |
| 776 | + | `count` int(11) NOT NULL DEFAULT '0', | |
| 777 | + | `attributes` blob NOT NULL, | |
| 778 | + | CONSTRAINT `player_rewards_unique` UNIQUE (`player_id`, `sid`), | |
| 779 | + | CONSTRAINT `player_rewards_players_fk` | |
| 780 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 781 | + | ON DELETE CASCADE | |
| 782 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 783 | + | ||
| 784 | + | -- Table structure `player_spells` | |
| 785 | + | CREATE TABLE IF NOT EXISTS `player_spells` ( | |
| 786 | + | `player_id` int(11) NOT NULL, | |
| 787 | + | `name` varchar(255) NOT NULL, | |
| 788 | + | INDEX `player_id` (`player_id`), | |
| 789 | + | CONSTRAINT `player_spells_players_fk` | |
| 790 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 791 | + | ON DELETE CASCADE, | |
| 792 | + | CONSTRAINT `player_spells_pk` PRIMARY KEY (`player_id`, `name`) | |
| 793 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 794 | + | ||
| 795 | + | -- Table structure `player_stash` | |
| 796 | + | CREATE TABLE IF NOT EXISTS `player_stash` ( | |
| 797 | + | `player_id` INT(16) NOT NULL, | |
| 798 | + | `item_id` INT(16) NOT NULL, | |
| 799 | + | `item_count` INT(32) NOT NULL, | |
| 800 | + | CONSTRAINT `player_stash_pk` PRIMARY KEY (`player_id`, `item_id`), | |
| 801 | + | CONSTRAINT `player_stash_players_fk` | |
| 802 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 803 | + | ON DELETE CASCADE | |
| 804 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 805 | + | ||
| 806 | + | -- Table structure `player_storage` | |
| 807 | + | CREATE TABLE IF NOT EXISTS `player_storage` ( | |
| 808 | + | `player_id` int(11) NOT NULL DEFAULT '0', | |
| 809 | + | `key` int(10) UNSIGNED NOT NULL DEFAULT '0', | |
| 810 | + | `value` int(11) NOT NULL DEFAULT '0', | |
| 811 | + | CONSTRAINT `player_storage_pk` PRIMARY KEY (`player_id`, `key`), | |
| 812 | + | CONSTRAINT `player_storage_players_fk` | |
| 813 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) | |
| 814 | + | ON DELETE CASCADE | |
| 815 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 816 | + | ||
| 817 | + | -- Table structure `store_history` | |
| 818 | + | CREATE TABLE IF NOT EXISTS `store_history` ( | |
| 819 | + | `id` int(11) NOT NULL AUTO_INCREMENT, | |
| 820 | + | `account_id` int(11) UNSIGNED NOT NULL, | |
| 821 | + | `mode` smallint(2) NOT NULL DEFAULT '0', | |
| 822 | + | `description` varchar(3500) NOT NULL, | |
| 823 | + | `coin_type` tinyint(1) NOT NULL DEFAULT '0', | |
| 824 | + | `coin_amount` int(12) NOT NULL, | |
| 825 | + | `time` bigint(20) UNSIGNED NOT NULL, | |
| 826 | + | `timestamp` int(11) NOT NULL DEFAULT '0', | |
| 827 | + | `coins` int(11) NOT NULL DEFAULT '0', | |
| 828 | + | INDEX `account_id` (`account_id`), | |
| 829 | + | CONSTRAINT `store_history_pk` PRIMARY KEY (`id`), | |
| 830 | + | CONSTRAINT `store_history_account_fk` | |
| 831 | + | FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) | |
| 832 | + | ON DELETE CASCADE | |
| 833 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 834 | + | ||
| 835 | + | -- Table structure `tile_store` | |
| 836 | + | CREATE TABLE IF NOT EXISTS `tile_store` ( | |
| 837 | + | `house_id` int(11) NOT NULL, | |
| 838 | + | `data` longblob NOT NULL, | |
| 839 | + | INDEX `house_id` (`house_id`), | |
| 840 | + | CONSTRAINT `tile_store_account_fk` | |
| 841 | + | FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) | |
| 842 | + | ON DELETE CASCADE | |
| 843 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 844 | + | ||
| 845 | + | -- Table structure `towns` | |
| 846 | + | CREATE TABLE IF NOT EXISTS `towns` ( | |
| 847 | + | `id` int NOT NULL AUTO_INCREMENT, | |
| 848 | + | `name` varchar(255) NOT NULL, | |
| 849 | + | `posx` int NOT NULL DEFAULT '0', | |
| 850 | + | `posy` int NOT NULL DEFAULT '0', | |
| 851 | + | `posz` int NOT NULL DEFAULT '0', | |
| 852 | + | PRIMARY KEY (`id`), | |
| 853 | + | UNIQUE KEY `name` (`name`) | |
| 854 | + | ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8; | |
| 855 | + | ||
| 856 | + | -- Table structure `account_sessions` | |
| 857 | + | CREATE TABLE IF NOT EXISTS `account_sessions` ( | |
| 858 | + | `id` VARCHAR(191) NOT NULL, | |
| 859 | + | `account_id` INTEGER UNSIGNED NOT NULL, | |
| 860 | + | `expires` BIGINT UNSIGNED NOT NULL, | |
| 861 | + | ||
| 862 | + | PRIMARY KEY (`id`) | |
| 863 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 864 | + | ||
| 865 | + | -- Table structure `kv_store` | |
| 866 | + | CREATE TABLE IF NOT EXISTS `kv_store` ( | |
| 867 | + | `key_name` varchar(191) NOT NULL, | |
| 868 | + | `timestamp` bigint NOT NULL, | |
| 869 | + | `value` longblob NOT NULL, | |
| 870 | + | PRIMARY KEY (`key_name`) | |
| 871 | + | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| 872 | + | ||
| 873 | + | -- Create Account god/god | |
| 874 | + | INSERT INTO `accounts` | |
| 875 | + | (`id`, `name`, `email`, `password`, `type`) VALUES | |
| 876 | + | (1, 'god', '@god', '21298df8a3277357ee55b01df9530b535cf08ec1', 6); | |
| 877 | + | ||
| 878 | + | -- Create player on GOD account | |
| 879 | + | -- Create sample characters | |
| 880 | + | INSERT INTO `players` | |
| 881 | + | (`id`, `name`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `maglevel`, `mana`, `manamax`, `manaspent`, `town_id`, `conditions`, `cap`, `sex`, `skill_club`, `skill_club_tries`, `skill_sword`, `skill_sword_tries`, `skill_axe`, `skill_axe_tries`, `skill_dist`, `skill_dist_tries`) VALUES | |
| 882 | + | (1, 'Rook Sample', 1, 1, 2, 0, 155, 155, 100, 113, 115, 95, 39, 129, 2, 60, 60, 5936, 1, '', 410, 1, 12, 155, 12, 155, 12, 155, 12, 93), | |
| 883 | + | (2, 'Sorcerer Sample', 1, 1, 8, 1, 185, 185, 4200, 113, 115, 95, 39, 129, 0, 90, 90, 0, 8, '', 470, 1, 10, 0, 10, 0, 10, 0, 10, 0), | |
| 884 | + | (3, 'Druid Sample', 1, 1, 8, 2, 185, 185, 4200, 113, 115, 95, 39, 129, 0, 90, 90, 0, 8, '', 470, 1, 10, 0, 10, 0, 10, 0, 10, 0), | |
| 885 | + | (4, 'Paladin Sample', 1, 1, 8, 3, 185, 185, 4200, 113, 115, 95, 39, 129, 0, 90, 90, 0, 8, '', 470, 1, 10, 0, 10, 0, 10, 0, 10, 0), | |
| 886 | + | (5, 'Knight Sample', 1, 1, 8, 4, 185, 185, 4200, 113, 115, 95, 39, 129, 0, 90, 90, 0, 8, '', 470, 1, 10, 0, 10, 0, 10, 0, 10, 0), | |
| 887 | + | (6, 'Monk Sample', 1, 1, 8, 9, 185, 185, 4200, 113, 115, 95, 39, 129, 0, 90, 90, 0, 8, '', 470, 1, 10, 0, 10, 0, 10, 0, 10, 0), | |
| 888 | + | (7, 'GOD', 6, 1, 2, 0, 155, 155, 100, 113, 115, 95, 39, 75, 0, 60, 60, 0, 8, '', 410, 1, 10, 0, 10, 0, 10, 0, 10, 0); |
| @@ -0,0 +1,432 @@ | |||
| 1 | + | -- OTHire database schema. | |
| 2 | + | -- Source: https://github.com/Ezzz-dev/OTHire/blob/master/source/schema.mysql | |
| 3 | + | -- License: GPL-2.0. Covers ZnoteX's OTHIRE engine choice. | |
| 4 | + | ||
| 5 | + | CREATE TABLE `groups` ( | |
| 6 | + | `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 7 | + | `name` VARCHAR(255) NOT NULL COMMENT 'group name', | |
| 8 | + | ||
| 9 | + | `flags` BIGINT UNSIGNED NOT NULL DEFAULT 0, | |
| 10 | + | `access` INT NOT NULL DEFAULT 0, | |
| 11 | + | `violation` INT NOT NULL DEFAULT 0, | |
| 12 | + | `maxdepotitems` INT NOT NULL, | |
| 13 | + | `maxviplist` INT NOT NULL, | |
| 14 | + | ||
| 15 | + | PRIMARY KEY (`id`) | |
| 16 | + | ) ENGINE = InnoDB; | |
| 17 | + | INSERT INTO `groups` VALUES (1, 'Player', 0, 0, 0, 2000, 100),(2, 'Tutor', 16777216, 0, 0, 2000, 100),(3, 'Sennior Tutor', 274894684160, 0, 0, 2000, 100),(4, 'Community Manager', 69681547968463, 2, 0, 1000, 100),(5, 'Game Master', 69681547968463, 2, 0, 1000, 100),(6, 'GOD/OWNER', 57171953819640, 3, 0, 2000, 100); | |
| 18 | + | ||
| 19 | + | CREATE TABLE `accounts` ( | |
| 20 | + | `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 21 | + | `name` VARCHAR(32) NOT NULL, | |
| 22 | + | ||
| 23 | + | `password` VARCHAR(255) NOT NULL/* VARCHAR(32) NOT NULL COMMENT 'MD5'*//* VARCHAR(40) NOT NULL COMMENT 'SHA1'*/, | |
| 24 | + | `email` VARCHAR(255) NOT NULL DEFAULT '', | |
| 25 | + | `premend` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 26 | + | `blocked` TINYINT(1) NOT NULL DEFAULT FALSE, | |
| 27 | + | `warnings` INT NOT NULL DEFAULT 0, | |
| 28 | + | ||
| 29 | + | PRIMARY KEY (`id`), | |
| 30 | + | UNIQUE (`name`) | |
| 31 | + | ) ENGINE = InnoDB; | |
| 32 | + | INSERT INTO `accounts` VALUES (1, 'tibia', 'tibia', '', 0, 0, 0); | |
| 33 | + | ||
| 34 | + | CREATE TABLE `players` ( | |
| 35 | + | `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 36 | + | `name` VARCHAR(255) NOT NULL, | |
| 37 | + | `account_id` INT UNSIGNED NOT NULL, | |
| 38 | + | `group_id` INT UNSIGNED NOT NULL COMMENT 'users group', | |
| 39 | + | ||
| 40 | + | `sex` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 41 | + | `vocation` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 42 | + | `experience` BIGINT UNSIGNED NOT NULL DEFAULT 0, | |
| 43 | + | `level` INT UNSIGNED NOT NULL DEFAULT 1, | |
| 44 | + | `maglevel` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 45 | + | `health` INT NOT NULL DEFAULT 100, | |
| 46 | + | `healthmax` INT NOT NULL DEFAULT 100, | |
| 47 | + | `mana` INT NOT NULL DEFAULT 100, | |
| 48 | + | `manamax` INT NOT NULL DEFAULT 100, | |
| 49 | + | `manaspent` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 50 | + | `soul` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 51 | + | `direction` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 52 | + | `lookbody` INT UNSIGNED NOT NULL DEFAULT 10, | |
| 53 | + | `lookfeet` INT UNSIGNED NOT NULL DEFAULT 10, | |
| 54 | + | `lookhead` INT UNSIGNED NOT NULL DEFAULT 10, | |
| 55 | + | `looklegs` INT UNSIGNED NOT NULL DEFAULT 10, | |
| 56 | + | `looktype` INT UNSIGNED NOT NULL DEFAULT 136, | |
| 57 | + | `lookaddons` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 58 | + | `posx` INT NOT NULL DEFAULT 0, | |
| 59 | + | `posy` INT NOT NULL DEFAULT 0, | |
| 60 | + | `posz` INT NOT NULL DEFAULT 0, | |
| 61 | + | `cap` INT NOT NULL DEFAULT 0, | |
| 62 | + | `lastlogin` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 63 | + | `lastlogout` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 64 | + | `lastip` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 65 | + | `save` TINYINT(1) NOT NULL DEFAULT TRUE, | |
| 66 | + | `conditions` BLOB NOT NULL COMMENT 'drunk, poisoned etc', | |
| 67 | + | `skull_type` INT NOT NULL DEFAULT 0, | |
| 68 | + | `skull_time` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 69 | + | `loss_experience` INT NOT NULL DEFAULT 100, | |
| 70 | + | `loss_mana` INT NOT NULL DEFAULT 100, | |
| 71 | + | `loss_skills` INT NOT NULL DEFAULT 100, | |
| 72 | + | `loss_items` INT NOT NULL DEFAULT 10, | |
| 73 | + | `loss_containers` INT NOT NULL DEFAULT 100, | |
| 74 | + | `town_id` INT NOT NULL COMMENT 'old masterpos, temple spawn point position', | |
| 75 | + | `balance` INT NOT NULL DEFAULT 0 COMMENT 'money balance of the player for houses paying', | |
| 76 | + | `stamina` INT NOT NULL DEFAULT 151200000 COMMENT 'player stamina in milliseconds', | |
| 77 | + | `online` TINYINT(1) NOT NULL DEFAULT 0, | |
| 78 | + | `rank_id` INT NOT NULL COMMENT 'only if you use __OLD_GUILD_SYSTEM__', | |
| 79 | + | `guildnick` VARCHAR(255) NOT NULL COMMENT 'only if you use __OLD_GUILD_SYSTEM__', | |
| 80 | + | ||
| 81 | + | PRIMARY KEY (`id`), | |
| 82 | + | UNIQUE (`name`), | |
| 83 | + | KEY (`online`), | |
| 84 | + | FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE, | |
| 85 | + | FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) | |
| 86 | + | ) ENGINE = InnoDB; | |
| 87 | + | ||
| 88 | + | CREATE TABLE `guilds` ( | |
| 89 | + | `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 90 | + | ||
| 91 | + | `name` VARCHAR(255) NOT NULL, | |
| 92 | + | `owner_id` INT UNSIGNED NOT NULL, | |
| 93 | + | `creationdate` INT NOT NULL, | |
| 94 | + | ||
| 95 | + | PRIMARY KEY (`id`), | |
| 96 | + | UNIQUE (`name`), | |
| 97 | + | FOREIGN KEY (`owner_id`) REFERENCES `players` (`id`) ON DELETE CASCADE | |
| 98 | + | ) ENGINE = InnoDB; | |
| 99 | + | ||
| 100 | + | CREATE TABLE `guild_ranks` ( | |
| 101 | + | `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 102 | + | `guild_id` INT UNSIGNED NOT NULL COMMENT 'guild', | |
| 103 | + | ||
| 104 | + | `name` VARCHAR(255) NOT NULL COMMENT 'rank name', | |
| 105 | + | `level` INT NOT NULL COMMENT 'rank level - leader, vice leader, member, maybe something else', | |
| 106 | + | ||
| 107 | + | PRIMARY KEY (`id`), | |
| 108 | + | FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE | |
| 109 | + | ) ENGINE = InnoDB; | |
| 110 | + | ||
| 111 | + | CREATE TABLE `guild_members` ( | |
| 112 | + | `player_id` INT UNSIGNED NOT NULL COMMENT 'if you doesnt use new guild system you are free to delete this table', | |
| 113 | + | `rank_id` INT UNSIGNED NOT NULL COMMENT 'a rank which belongs to certain guild', | |
| 114 | + | ||
| 115 | + | `nick` VARCHAR(255) NOT NULL DEFAULT '', | |
| 116 | + | ||
| 117 | + | UNIQUE (`player_id`), | |
| 118 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE, | |
| 119 | + | FOREIGN KEY (`rank_id`) REFERENCES `guild_ranks` (`id`) ON DELETE CASCADE | |
| 120 | + | ) ENGINE = InnoDB; | |
| 121 | + | ||
| 122 | + | CREATE TABLE `guild_invites` ( | |
| 123 | + | `player_id` INT UNSIGNED NOT NULL, | |
| 124 | + | `guild_id` INT UNSIGNED NOT NULL COMMENT 'guild', | |
| 125 | + | ||
| 126 | + | UNIQUE (`player_id`), | |
| 127 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE, | |
| 128 | + | FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE | |
| 129 | + | ) ENGINE = InnoDB; | |
| 130 | + | ||
| 131 | + | CREATE TABLE `guild_wars` ( | |
| 132 | + | `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 133 | + | `guild_id` INT UNSIGNED NOT NULL COMMENT 'the guild which declared the war', | |
| 134 | + | `opponent_id` INT UNSIGNED NOT NULL COMMENT 'the enemy guild at war', | |
| 135 | + | ||
| 136 | + | `frag_limit` INT UNSIGNED NOT NULL DEFAULT 10 COMMENT 'kills needed to win the war', | |
| 137 | + | `declaration_date` INT UNSIGNED NOT NULL, | |
| 138 | + | `end_date` INT UNSIGNED NOT NULL, | |
| 139 | + | `guild_fee` INT UNSIGNED NOT NULL DEFAULT 1000 COMMENT 'amount of money the guild has to pay if loses the war', | |
| 140 | + | `opponent_fee` INT UNSIGNED NOT NULL DEFAULT 1000 COMMENT 'amount of money the enemy guild has to pay if loses the war', | |
| 141 | + | `guild_frags` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 142 | + | `opponent_frags` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 143 | + | `comment` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'the guild leader can leave a message for the other guild', | |
| 144 | + | `status` INT NOT NULL DEFAULT 0 COMMENT '-1 -> will be ignored (finished or unaccepted) 0 -> to be started 1 -> started/not finished', | |
| 145 | + | ||
| 146 | + | PRIMARY KEY (`id`), | |
| 147 | + | FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE, | |
| 148 | + | FOREIGN KEY (`opponent_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE | |
| 149 | + | ) ENGINE = InnoDB; | |
| 150 | + | ||
| 151 | + | CREATE TABLE `player_viplist` ( | |
| 152 | + | `player_id` INT UNSIGNED NOT NULL COMMENT 'id of player whose viplist entry it is', | |
| 153 | + | `vip_id` INT UNSIGNED NOT NULL COMMENT 'id of target player of viplist entry', | |
| 154 | + | ||
| 155 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE, | |
| 156 | + | FOREIGN KEY (`vip_id`) REFERENCES `players` (`id`) ON DELETE CASCADE | |
| 157 | + | ) ENGINE = InnoDB; | |
| 158 | + | ||
| 159 | + | CREATE TABLE `player_spells` ( | |
| 160 | + | `player_id` INT UNSIGNED NOT NULL, | |
| 161 | + | `name` VARCHAR(255) NOT NULL, | |
| 162 | + | ||
| 163 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE | |
| 164 | + | ) ENGINE = InnoDB; | |
| 165 | + | ||
| 166 | + | CREATE TABLE `player_storage` ( | |
| 167 | + | `player_id` INT UNSIGNED NOT NULL, | |
| 168 | + | `key` INT NOT NULL, | |
| 169 | + | `value` INT NOT NULL, | |
| 170 | + | ||
| 171 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE | |
| 172 | + | ) ENGINE = InnoDB; | |
| 173 | + | ||
| 174 | + | CREATE TABLE `player_skills` ( | |
| 175 | + | `player_id` INT UNSIGNED NOT NULL, | |
| 176 | + | ||
| 177 | + | `skillid` INT UNSIGNED NOT NULL, | |
| 178 | + | `value` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 179 | + | `count` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 180 | + | ||
| 181 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE | |
| 182 | + | ) ENGINE = InnoDB; | |
| 183 | + | ||
| 184 | + | CREATE TABLE `player_items` ( | |
| 185 | + | `player_id` INT UNSIGNED NOT NULL, | |
| 186 | + | `sid` INT NOT NULL, | |
| 187 | + | `pid` INT NOT NULL DEFAULT 0, | |
| 188 | + | `itemtype` INT NOT NULL, | |
| 189 | + | `count` INT NOT NULL DEFAULT 0, | |
| 190 | + | `attributes` BLOB COMMENT 'replaces unique_id, action_id, text, special_desc', | |
| 191 | + | ||
| 192 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE, | |
| 193 | + | UNIQUE (`player_id`, `sid`) | |
| 194 | + | ) ENGINE = InnoDB; | |
| 195 | + | ||
| 196 | + | CREATE TABLE `houses` ( | |
| 197 | + | `id` INT UNSIGNED NOT NULL, | |
| 198 | + | `townid` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 199 | + | ||
| 200 | + | `name` VARCHAR(100) NOT NULL, | |
| 201 | + | `rent` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 202 | + | `guildhall` TINYINT(1) NOT NULL DEFAULT 0, | |
| 203 | + | `tiles` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 204 | + | `doors` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 205 | + | `beds` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 206 | + | `owner` INT NOT NULL DEFAULT 0, | |
| 207 | + | `paid` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 208 | + | `clear` TINYINT(1) NOT NULL DEFAULT 0, | |
| 209 | + | `warnings` INT NOT NULL DEFAULT 0, | |
| 210 | + | `lastwarning` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 211 | + | ||
| 212 | + | PRIMARY KEY (`id`) | |
| 213 | + | ) ENGINE = InnoDB; | |
| 214 | + | ||
| 215 | + | CREATE TABLE `house_auctions` ( | |
| 216 | + | `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 217 | + | `house_id` INT UNSIGNED NOT NULL, | |
| 218 | + | `player_id` INT UNSIGNED NOT NULL, | |
| 219 | + | ||
| 220 | + | `bid` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 221 | + | `limit` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 222 | + | `endtime` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 223 | + | ||
| 224 | + | FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE, | |
| 225 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE, | |
| 226 | + | PRIMARY KEY (`id`) | |
| 227 | + | ) ENGINE = InnoDB; | |
| 228 | + | ||
| 229 | + | CREATE TABLE `house_lists` ( | |
| 230 | + | `house_id` INT UNSIGNED NOT NULL, | |
| 231 | + | `listid` INT NOT NULL, | |
| 232 | + | `list` TEXT NOT NULL, | |
| 233 | + | ||
| 234 | + | FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE | |
| 235 | + | ) ENGINE = InnoDB; | |
| 236 | + | ||
| 237 | + | CREATE TABLE `bans` ( | |
| 238 | + | `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 239 | + | `type` INT NOT NULL COMMENT 'this field defines if its ip, account, player, or any else ban', | |
| 240 | + | `value` INT UNSIGNED NOT NULL COMMENT 'ip, player guid, account number', | |
| 241 | + | `param` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'mask', | |
| 242 | + | `active` TINYINT(1) NOT NULL DEFAULT TRUE, | |
| 243 | + | `expires` INT NOT NULL, | |
| 244 | + | `added` INT UNSIGNED NOT NULL, | |
| 245 | + | `admin_id` INT UNSIGNED, | |
| 246 | + | `comment` VARCHAR(1024) NOT NULL DEFAULT '', | |
| 247 | + | `reason` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 248 | + | `action` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 249 | + | `statement` VARCHAR(255) NOT NULL DEFAULT '', | |
| 250 | + | ||
| 251 | + | PRIMARY KEY (`id`), | |
| 252 | + | KEY (`type`, `value`), | |
| 253 | + | KEY (`expires`), | |
| 254 | + | FOREIGN KEY (`admin_id`) REFERENCES `players` (`id`) ON DELETE SET NULL | |
| 255 | + | ) ENGINE = InnoDB; | |
| 256 | + | ||
| 257 | + | CREATE TABLE `tiles` ( | |
| 258 | + | `id` INT UNSIGNED NOT NULL, | |
| 259 | + | `house_id` INT UNSIGNED NOT NULL DEFAULT 0, | |
| 260 | + | `x` INT(5) UNSIGNED NOT NULL, | |
| 261 | + | `y` INT(5) UNSIGNED NOT NULL, | |
| 262 | + | `z` INT(2) UNSIGNED NOT NULL, | |
| 263 | + | ||
| 264 | + | PRIMARY KEY(`id`), | |
| 265 | + | KEY(`x`, `y`, `z`), | |
| 266 | + | FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE NO ACTION | |
| 267 | + | ) ENGINE = InnoDB; | |
| 268 | + | ||
| 269 | + | CREATE TABLE `tile_items` ( | |
| 270 | + | `tile_id` INT UNSIGNED NOT NULL, | |
| 271 | + | `sid` INT NOT NULL, | |
| 272 | + | `pid` INT NOT NULL DEFAULT 0, | |
| 273 | + | `itemtype` INT NOT NULL, | |
| 274 | + | `count` INT NOT NULL DEFAULT 0, | |
| 275 | + | `attributes` BLOB NOT NULL, | |
| 276 | + | ||
| 277 | + | INDEX (`sid`), | |
| 278 | + | FOREIGN KEY (`tile_id`) REFERENCES `tiles` (`id`) ON DELETE CASCADE | |
| 279 | + | ) ENGINE = InnoDB; | |
| 280 | + | ||
| 281 | + | CREATE TABLE `map_store` ( | |
| 282 | + | `house_id` INT UNSIGNED NOT NULL, | |
| 283 | + | `data` LONGBLOB NOT NULL, | |
| 284 | + | ||
| 285 | + | KEY(`house_id`) | |
| 286 | + | ) ENGINE = InnoDB; | |
| 287 | + | ||
| 288 | + | CREATE TABLE `player_deaths` ( | |
| 289 | + | `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 290 | + | `player_id` INT UNSIGNED NOT NULL, | |
| 291 | + | `date` INT UNSIGNED NOT NULL, | |
| 292 | + | `level` INT NOT NULL, | |
| 293 | + | ||
| 294 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE, | |
| 295 | + | PRIMARY KEY(`id`), | |
| 296 | + | INDEX(`date`) | |
| 297 | + | ) ENGINE = InnoDB; | |
| 298 | + | ||
| 299 | + | CREATE TABLE `killers` ( | |
| 300 | + | `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 301 | + | `death_id` INT UNSIGNED NOT NULL, | |
| 302 | + | `final_hit` TINYINT(1) NOT NULL DEFAULT 1, | |
| 303 | + | ||
| 304 | + | PRIMARY KEY(`id`), | |
| 305 | + | FOREIGN KEY (`death_id`) REFERENCES `player_deaths` (`id`) ON DELETE CASCADE | |
| 306 | + | ) ENGINE = InnoDB; | |
| 307 | + | ||
| 308 | + | CREATE TABLE `environment_killers` ( | |
| 309 | + | `kill_id` INT UNSIGNED NOT NULL, | |
| 310 | + | `name` VARCHAR(255) NOT NULL, | |
| 311 | + | ||
| 312 | + | PRIMARY KEY (`kill_id`, `name`), | |
| 313 | + | FOREIGN KEY (`kill_id`) REFERENCES `killers` (`id`) ON DELETE CASCADE | |
| 314 | + | ) ENGINE = InnoDB; | |
| 315 | + | ||
| 316 | + | CREATE TABLE `player_killers` ( | |
| 317 | + | `kill_id` INT UNSIGNED NOT NULL, | |
| 318 | + | `player_id` INT UNSIGNED NOT NULL, | |
| 319 | + | `unjustified` TINYINT(1) NOT NULL DEFAULT 0, | |
| 320 | + | ||
| 321 | + | PRIMARY KEY (`kill_id`, `player_id`), | |
| 322 | + | FOREIGN KEY (`kill_id`) REFERENCES `killers` (`id`) ON DELETE CASCADE, | |
| 323 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE | |
| 324 | + | ) ENGINE = InnoDB; | |
| 325 | + | ||
| 326 | + | CREATE TABLE `player_depotitems` ( | |
| 327 | + | `player_id` INT UNSIGNED NOT NULL, | |
| 328 | + | `sid` INT NOT NULL COMMENT 'any given range eg 0-100 will be reserved for depot lockers and all > 100 will be then normal items inside depots', | |
| 329 | + | `pid` INT NOT NULL DEFAULT 0, | |
| 330 | + | `itemtype` INT NOT NULL, | |
| 331 | + | `count` INT NOT NULL DEFAULT 0, | |
| 332 | + | `attributes` BLOB NOT NULL, | |
| 333 | + | ||
| 334 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE, | |
| 335 | + | UNIQUE (`player_id`, `sid`) | |
| 336 | + | ) ENGINE = InnoDB; | |
| 337 | + | ||
| 338 | + | CREATE TABLE `market_offers` ( | |
| 339 | + | `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 340 | + | `player_id` INT UNSIGNED NOT NULL, | |
| 341 | + | ||
| 342 | + | `sale` TINYINT(1) NOT NULL DEFAULT 0, | |
| 343 | + | `itemtype` INT NOT NULL, | |
| 344 | + | `amount` INT NOT NULL, | |
| 345 | + | ||
| 346 | + | `created` INT NOT NULL, | |
| 347 | + | `anonymous` TINYINT(1) DEFAULT 0, | |
| 348 | + | `price` INT NOT NULL DEFAULT 0, | |
| 349 | + | ||
| 350 | + | PRIMARY KEY (`id`), | |
| 351 | + | KEY (`sale`, `itemtype`), | |
| 352 | + | KEY (`created`), | |
| 353 | + | FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE | |
| 354 | + | ) ENGINE = InnoDB; | |
| 355 | + | ||
| 356 | + | CREATE TABLE `market_statistics` ( | |
| 357 | + | `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 358 | + | ||
| 359 | + | `sale` TINYINT(1) NOT NULL, | |
| 360 | + | `itemtype` INT NOT NULL, | |
| 361 | + | `price` INT NOT NULL, | |
| 362 | + | `amount` INT NOT NULL, | |
| 363 | + | `when` INT NOT NULL, | |
| 364 | + | ||
| 365 | + | PRIMARY KEY(`id`), | |
| 366 | + | KEY(`sale`, `itemtype`, `when`) | |
| 367 | + | ) ENGINE = InnoDB; | |
| 368 | + | ||
| 369 | + | CREATE TABLE `global_storage` ( | |
| 370 | + | `key` INT UNSIGNED NOT NULL, | |
| 371 | + | `value` INT NOT NULL, | |
| 372 | + | ||
| 373 | + | PRIMARY KEY(`key`) | |
| 374 | + | ) ENGINE = InnoDB; | |
| 375 | + | ||
| 376 | + | CREATE TABLE `schema_info` ( | |
| 377 | + | `name` VARCHAR(255) NOT NULL, | |
| 378 | + | `value` VARCHAR(255) NOT NULL, | |
| 379 | + | ||
| 380 | + | PRIMARY KEY (`name`) | |
| 381 | + | ) ENGINE = InnoDB; | |
| 382 | + | ||
| 383 | + | INSERT INTO `schema_info` (`name`, `value`) VALUES ('version', 24); | |
| 384 | + | ||
| 385 | + | DELIMITER | | |
| 386 | + | ||
| 387 | + | CREATE TRIGGER `ondelete_accounts` | |
| 388 | + | BEFORE DELETE | |
| 389 | + | ON `accounts` | |
| 390 | + | FOR EACH ROW | |
| 391 | + | BEGIN | |
| 392 | + | DELETE FROM `bans` WHERE `type` = 3 AND `value` = OLD.`id`; | |
| 393 | + | END| | |
| 394 | + | ||
| 395 | + | CREATE TRIGGER `ondelete_players` | |
| 396 | + | BEFORE DELETE | |
| 397 | + | ON `players` | |
| 398 | + | FOR EACH ROW | |
| 399 | + | BEGIN | |
| 400 | + | DELETE FROM `bans` WHERE `type` = 2 AND `value` = OLD.`id`; | |
| 401 | + | UPDATE `houses` SET `owner` = 0 WHERE `owner` = OLD.`id`; | |
| 402 | + | END| | |
| 403 | + | ||
| 404 | + | CREATE TRIGGER `oncreate_guilds` | |
| 405 | + | AFTER INSERT | |
| 406 | + | ON `guilds` | |
| 407 | + | FOR EACH ROW | |
| 408 | + | BEGIN | |
| 409 | + | INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Leader', 3, NEW.`id`); | |
| 410 | + | INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Vice-Leader', 2, NEW.`id`); | |
| 411 | + | INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Member', 1, NEW.`id`); | |
| 412 | + | END| | |
| 413 | + | ||
| 414 | + | CREATE TRIGGER `oncreate_players` | |
| 415 | + | AFTER INSERT | |
| 416 | + | ON `players` | |
| 417 | + | FOR EACH ROW | |
| 418 | + | BEGIN | |
| 419 | + | INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 0, 10); | |
| 420 | + | INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 1, 10); | |
| 421 | + | INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 2, 10); | |
| 422 | + | INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 3, 10); | |
| 423 | + | INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 4, 10); | |
| 424 | + | INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 5, 10); | |
| 425 | + | INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 6, 10); | |
| 426 | + | END| | |
| 427 | + | ||
| 428 | + | DELIMITER ; | |
| 429 | + | INSERT INTO `players` VALUES (1, 'Administrator', 1, 6, 2, 1, 0, 1, 0, 185, 185, 35, 35, 0, 100, 2, 10, 10, 10, 10, 75, 0, 200, 200, 6, 435, 0, 0, 1, 1, '', 0, 0, 100, 100, 100, 10, 100, 1, 0, 151200000, 0, 0, ''); | |
| 430 | + | INSERT INTO `players` VALUES (2, 'Player', 1, 1, 1, 1, 0, 1, 0, 185, 185, 35, 35, 0, 100, 2, 10, 10, 10, 10, 75, 0, 200, 200, 6, 435, 0, 0, 1, 1, '', 0, 0, 100, 100, 100, 10, 100, 1, 0, 151200000, 0, 0, ''); | |
| 431 | + | ||
| 432 | + | # to add your own privileges for players/gms please use this flag generator http://hem.bredband.net/johannesrosen/playerflags.html |