-
Notifications
You must be signed in to change notification settings - Fork 77
/
MySql_Schema.sql
723 lines (600 loc) · 23 KB
/
MySql_Schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
-- phpMyAdmin SQL Dump
-- version 4.0.5
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1:3306
-- Generation Time: Mar 28, 2014 at 10:45 PM
-- Server version: 5.5.33
-- PHP Version: 5.4.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `newotserv`
--
-- --------------------------------------------------------
--
-- Table structure for table `accounts`
--
CREATE TABLE `accounts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`password` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL DEFAULT '',
`premend` int(10) unsigned NOT NULL DEFAULT '0',
`blocked` tinyint(1) NOT NULL DEFAULT '0',
`warnings` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=123457 ;
--
-- Dumping data for table `accounts`
--
INSERT INTO `accounts` (`id`, `password`, `email`, `premend`, `blocked`, `warnings`) VALUES
(123456, '41da8bef22aaef9d7c5821fa0f0de7cccc4dda4d', 'sampleaccount@gmail.com', 0, 0, 0);
--
-- Triggers `accounts`
--
DROP TRIGGER IF EXISTS `ondelete_accounts`;
DELIMITER //
CREATE TRIGGER `ondelete_accounts` BEFORE DELETE ON `accounts`
FOR EACH ROW BEGIN
DELETE FROM `bans` WHERE `type` = 3 AND `value` = OLD.`id`;
END
//
DELIMITER ;
-- --------------------------------------------------------
--
-- Table structure for table `bans`
--
CREATE TABLE `bans` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`type` int(11) NOT NULL COMMENT 'this field defines if its ip, account, player, or any else ban',
`value` int(10) unsigned NOT NULL COMMENT 'ip, player guid, account number',
`param` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'mask',
`active` tinyint(1) NOT NULL DEFAULT '1',
`expires` int(11) NOT NULL,
`added` int(10) unsigned NOT NULL,
`admin_id` int(10) unsigned DEFAULT NULL,
`comment` varchar(1024) NOT NULL DEFAULT '',
`reason` int(10) unsigned NOT NULL DEFAULT '0',
`action` int(10) unsigned NOT NULL DEFAULT '0',
`statement` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `type` (`type`,`value`),
KEY `expires` (`expires`),
KEY `admin_id` (`admin_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `environment_killers`
--
CREATE TABLE `environment_killers` (
`kill_id` int(10) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`kill_id`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `global_storage`
--
CREATE TABLE `global_storage` (
`key` int(10) unsigned NOT NULL,
`value` int(11) NOT NULL,
PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `groups`
--
CREATE TABLE `groups` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL COMMENT 'group name',
`flags` bigint(20) unsigned NOT NULL DEFAULT '0',
`access` int(11) NOT NULL DEFAULT '0',
`violation` int(11) NOT NULL DEFAULT '0',
`maxdepotitems` int(11) NOT NULL,
`maxviplist` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;
--
-- Dumping data for table `groups`
--
INSERT INTO `groups` (`id`, `name`, `flags`, `access`, `violation`, `maxdepotitems`, `maxviplist`) VALUES
(1, 'Player', 0, 0, 0, 2000, 100),
(2, 'Tutor', 16777216, 0, 0, 2000, 100),
(3, 'Senior Tutor', 8796109897728, 0, 0, 2000, 100),
(4, 'Gamemaster', 15811415236879, 2, 0, 1000, 100),
(5, 'God', 18689080401912, 3, 0, 2000, 100);
-- --------------------------------------------------------
--
-- Table structure for table `guilds`
--
CREATE TABLE `guilds` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`owner_id` int(10) unsigned NOT NULL,
`creationdate` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
KEY `owner_id` (`owner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
--
-- Triggers `guilds`
--
DROP TRIGGER IF EXISTS `oncreate_guilds`;
DELIMITER //
CREATE TRIGGER `oncreate_guilds` AFTER INSERT ON `guilds`
FOR EACH ROW BEGIN
INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Leader', 3, NEW.`id`);
INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Vice-Leader', 2, NEW.`id`);
INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('Member', 1, NEW.`id`);
END
//
DELIMITER ;
-- --------------------------------------------------------
--
-- Table structure for table `guild_invites`
--
CREATE TABLE `guild_invites` (
`player_id` int(10) unsigned NOT NULL,
`guild_id` int(10) unsigned NOT NULL COMMENT 'guild',
UNIQUE KEY `player_id` (`player_id`),
KEY `guild_id` (`guild_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `guild_members`
--
CREATE TABLE `guild_members` (
`player_id` int(10) unsigned NOT NULL COMMENT 'if you doesnt use new guild system you are free to delete this table',
`rank_id` int(10) unsigned NOT NULL COMMENT 'a rank which belongs to certain guild',
`nick` varchar(255) NOT NULL DEFAULT '',
UNIQUE KEY `player_id` (`player_id`),
KEY `rank_id` (`rank_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `guild_ranks`
--
CREATE TABLE `guild_ranks` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`guild_id` int(10) unsigned NOT NULL COMMENT 'guild',
`name` varchar(255) NOT NULL COMMENT 'rank name',
`level` int(11) NOT NULL COMMENT 'rank level - leader, vice leader, member, maybe something else',
PRIMARY KEY (`id`),
KEY `guild_id` (`guild_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `guild_wars`
--
CREATE TABLE `guild_wars` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`guild_id` INT UNSIGNED NOT NULL COMMENT 'the guild which declared the war',
`opponent_id` INT UNSIGNED NOT NULL COMMENT 'the enemy guild at war',
`frag_limit` INT UNSIGNED NOT NULL DEFAULT 10 COMMENT 'kills needed to win the war',
`declaration_date` INT UNSIGNED NOT NULL,
`end_date` INT UNSIGNED NOT NULL,
`guild_fee` INT UNSIGNED NOT NULL DEFAULT 1000 COMMENT 'amount of money the guild has to pay if loses the war',
`opponent_fee` INT UNSIGNED NOT NULL DEFAULT 1000 COMMENT 'amount of money the enemy guild has to pay if loses the war',
`guild_frags` INT UNSIGNED NOT NULL DEFAULT 0,
`opponent_frags` INT UNSIGNED NOT NULL DEFAULT 0,
`comment` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'the guild leader can leave a message for the other guild',
`status` INT NOT NULL DEFAULT 0 COMMENT '-1 -> will be ignored (finished or unaccepted) 0 -> to be started 1 -> started/not finished',
PRIMARY KEY (`id`),
FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`opponent_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB;
-- --------------------------------------------------------
--
-- Table structure for table `houses`
--
CREATE TABLE `houses` (
`id` int(10) unsigned NOT NULL,
`townid` int(10) unsigned NOT NULL DEFAULT '0',
`name` varchar(100) NOT NULL,
`rent` int(10) unsigned NOT NULL DEFAULT '0',
`guildhall` tinyint(1) NOT NULL DEFAULT '0',
`tiles` int(10) unsigned NOT NULL DEFAULT '0',
`doors` int(10) unsigned NOT NULL DEFAULT '0',
`beds` int(10) unsigned NOT NULL DEFAULT '0',
`owner` int(11) NOT NULL DEFAULT '0',
`paid` int(10) unsigned NOT NULL DEFAULT '0',
`clear` tinyint(1) NOT NULL DEFAULT '0',
`warnings` int(11) NOT NULL DEFAULT '0',
`lastwarning` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `house_auctions`
--
CREATE TABLE `house_auctions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`house_id` int(10) unsigned NOT NULL,
`player_id` int(10) unsigned NOT NULL,
`bid` int(10) unsigned NOT NULL DEFAULT '0',
`limit` int(10) unsigned NOT NULL DEFAULT '0',
`endtime` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `house_id` (`house_id`),
KEY `player_id` (`player_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `house_lists`
--
CREATE TABLE `house_lists` (
`house_id` int(10) unsigned NOT NULL,
`listid` int(11) NOT NULL,
`list` text NOT NULL,
KEY `house_id` (`house_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `killers`
--
CREATE TABLE `killers` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`death_id` int(10) unsigned NOT NULL,
`final_hit` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
KEY `death_id` (`death_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=20 ;
-- --------------------------------------------------------
--
-- Table structure for table `map_store`
--
CREATE TABLE `map_store` (
`house_id` int(10) unsigned NOT NULL,
`data` longblob NOT NULL,
KEY `house_id` (`house_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `players`
--
CREATE TABLE `players` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`account_id` int(10) unsigned NOT NULL,
`group_id` int(10) unsigned NOT NULL COMMENT 'users group',
`sex` int(10) unsigned NOT NULL DEFAULT '0',
`vocation` int(10) unsigned NOT NULL DEFAULT '0',
`experience` bigint(20) unsigned NOT NULL DEFAULT '0',
`level` int(10) unsigned NOT NULL DEFAULT '1',
`maglevel` int(10) unsigned NOT NULL DEFAULT '0',
`health` int(11) NOT NULL DEFAULT '100',
`healthmax` int(11) NOT NULL DEFAULT '100',
`mana` int(11) NOT NULL DEFAULT '100',
`manamax` int(11) NOT NULL DEFAULT '100',
`manaspent` int(10) unsigned NOT NULL DEFAULT '0',
`soul` int(10) unsigned NOT NULL DEFAULT '0',
`direction` int(10) unsigned NOT NULL DEFAULT '0',
`lookbody` int(10) unsigned NOT NULL DEFAULT '10',
`lookfeet` int(10) unsigned NOT NULL DEFAULT '10',
`lookhead` int(10) unsigned NOT NULL DEFAULT '10',
`looklegs` int(10) unsigned NOT NULL DEFAULT '10',
`looktype` int(10) unsigned NOT NULL DEFAULT '136',
`posx` int(11) NOT NULL DEFAULT '0',
`posy` int(11) NOT NULL DEFAULT '0',
`posz` int(11) NOT NULL DEFAULT '0',
`cap` int(11) NOT NULL DEFAULT '0',
`lastlogin` int(10) unsigned NOT NULL DEFAULT '0',
`lastlogout` int(10) unsigned NOT NULL DEFAULT '0',
`lastip` int(10) unsigned NOT NULL DEFAULT '0',
`save` tinyint(1) NOT NULL DEFAULT '1',
`conditions` blob NOT NULL COMMENT 'drunk, poisoned etc',
`skull_type` int(11) NOT NULL DEFAULT '0',
`skull_time` int(10) unsigned NOT NULL DEFAULT '0',
`loss_experience` int(11) NOT NULL DEFAULT '100',
`loss_mana` int(11) NOT NULL DEFAULT '100',
`loss_skills` int(11) NOT NULL DEFAULT '100',
`loss_items` int(11) NOT NULL DEFAULT '10',
`loss_containers` int(11) NOT NULL DEFAULT '100',
`town_id` int(11) NOT NULL COMMENT 'old masterpos, temple spawn point position',
`balance` int(11) NOT NULL DEFAULT '0' COMMENT 'money balance of the player for houses paying',
`online` tinyint(1) NOT NULL DEFAULT '0',
`rank_id` int(11) NOT NULL COMMENT 'only if you use __OLD_GUILD_SYSTEM__',
`guildnick` varchar(255) NOT NULL COMMENT 'only if you use __OLD_GUILD_SYSTEM__',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
KEY `online` (`online`),
KEY `account_id` (`account_id`),
KEY `group_id` (`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;
--
-- Dumping data for table `players`
--
INSERT INTO `players` (`id`, `name`, `account_id`, `group_id`, `sex`, `vocation`, `experience`, `level`, `maglevel`, `health`, `healthmax`, `mana`, `manamax`, `manaspent`, `soul`, `direction`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `posx`, `posy`, `posz`, `cap`, `lastlogin`, `lastlogout`, `lastip`, `save`, `conditions`, `skull_type`, `skull_time`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_items`, `loss_containers`, `town_id`, `balance`, `online`, `rank_id`, `guildnick`) VALUES
(1, 'GM Sample', 123456, 5, 1, 0, 100, 2, 4, 100, 100, 100, 100, 70775, 0, 2, 10, 10, 10, 10, 75, 32368, 32215, 7, 10000, 1396046551, 1396045859, 400558280, 1, '', 0, 0, 100, 100, 100, 10, 100, 1, 0, 1, 0, '');
--
-- Triggers `players`
--
DROP TRIGGER IF EXISTS `oncreate_players`;
DELIMITER //
CREATE TRIGGER `oncreate_players` AFTER INSERT ON `players`
FOR EACH ROW BEGIN
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 0, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 1, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 2, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 3, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 4, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 5, 10);
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 6, 10);
END
//
DELIMITER ;
DROP TRIGGER IF EXISTS `ondelete_players`;
DELIMITER //
CREATE TRIGGER `ondelete_players` BEFORE DELETE ON `players`
FOR EACH ROW BEGIN
DELETE FROM `bans` WHERE `type` = 2 AND `value` = OLD.`id`;
UPDATE `houses` SET `owner` = 0 WHERE `owner` = OLD.`id`;
END
//
DELIMITER ;
-- --------------------------------------------------------
--
-- Table structure for table `player_deaths`
--
CREATE TABLE `player_deaths` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`player_id` int(10) unsigned NOT NULL,
`date` int(10) unsigned NOT NULL,
`level` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `player_id` (`player_id`),
KEY `date` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ;
-- --------------------------------------------------------
--
-- Table structure for table `player_depotitems`
--
CREATE TABLE `player_depotitems` (
`player_id` int(10) unsigned NOT NULL,
`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',
`pid` int(11) NOT NULL DEFAULT '0',
`itemtype` int(11) NOT NULL,
`count` int(11) NOT NULL DEFAULT '0',
`attributes` blob NOT NULL,
UNIQUE KEY `player_id` (`player_id`,`sid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `player_items`
--
CREATE TABLE `player_items` (
`player_id` int(10) unsigned NOT NULL,
`sid` int(11) NOT NULL,
`pid` int(11) NOT NULL DEFAULT '0',
`itemtype` int(11) NOT NULL,
`count` int(11) NOT NULL DEFAULT '0',
`attributes` blob COMMENT 'replaces unique_id, action_id, text, special_desc',
UNIQUE KEY `player_id` (`player_id`,`sid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `player_items`
--
INSERT INTO `player_items` (`player_id`, `sid`, `pid`, `itemtype`, `count`, `attributes`) VALUES
(1, 101, 5, 2152, 98, 0x0f62),
(1, 102, 6, 2183, 1, ''),
(1, 103, 8, 2643, 1, '');
-- --------------------------------------------------------
--
-- Table structure for table `player_killers`
--
CREATE TABLE `player_killers` (
`kill_id` int(10) unsigned NOT NULL,
`player_id` int(10) unsigned NOT NULL,
`unjustified` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`kill_id`,`player_id`),
KEY `player_id` (`player_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `player_skills`
--
CREATE TABLE `player_skills` (
`player_id` int(10) unsigned NOT NULL,
`skillid` int(10) unsigned NOT NULL,
`value` int(10) unsigned NOT NULL DEFAULT '0',
`count` int(10) unsigned NOT NULL DEFAULT '0',
KEY `player_id` (`player_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `player_skills`
--
INSERT INTO `player_skills` (`player_id`, `skillid`, `value`, `count`) VALUES
(1, 0, 10, 0),
(1, 1, 10, 0),
(1, 2, 10, 0),
(1, 3, 10, 0),
(1, 4, 10, 0),
(1, 5, 10, 0),
(1, 6, 10, 0);
-- --------------------------------------------------------
--
-- Table structure for table `player_spells`
--
CREATE TABLE `player_spells` (
`player_id` int(10) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
KEY `player_id` (`player_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `player_storage`
--
CREATE TABLE `player_storage` (
`player_id` int(10) unsigned NOT NULL,
`key` int(11) NOT NULL,
`value` int(11) NOT NULL,
KEY `player_id` (`player_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `player_viplist`
--
CREATE TABLE `player_viplist` (
`player_id` int(10) unsigned NOT NULL COMMENT 'id of player whose viplist entry it is',
`vip_id` int(10) unsigned NOT NULL COMMENT 'id of target player of viplist entry',
KEY `player_id` (`player_id`),
KEY `vip_id` (`vip_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `schema_info`
--
CREATE TABLE `schema_info` (
`name` varchar(255) NOT NULL,
`value` varchar(255) NOT NULL,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `schema_info`
--
INSERT INTO `schema_info` (`name`, `value`) VALUES
('version', '24');
-- --------------------------------------------------------
--
-- Table structure for table `tiles`
--
CREATE TABLE `tiles` (
`id` int(10) unsigned NOT NULL,
`house_id` int(10) unsigned NOT NULL DEFAULT '0',
`x` int(5) unsigned NOT NULL,
`y` int(5) unsigned NOT NULL,
`z` int(2) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `x` (`x`,`y`,`z`),
KEY `house_id` (`house_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `tile_items`
--
CREATE TABLE `tile_items` (
`tile_id` int(10) unsigned NOT NULL,
`sid` int(11) NOT NULL,
`pid` int(11) NOT NULL DEFAULT '0',
`itemtype` int(11) NOT NULL,
`count` int(11) NOT NULL DEFAULT '0',
`attributes` blob NOT NULL,
KEY `sid` (`sid`),
KEY `tile_id` (`tile_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `bans`
--
ALTER TABLE `bans`
ADD CONSTRAINT `bans_ibfk_1` FOREIGN KEY (`admin_id`) REFERENCES `players` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `environment_killers`
--
ALTER TABLE `environment_killers`
ADD CONSTRAINT `environment_killers_ibfk_1` FOREIGN KEY (`kill_id`) REFERENCES `killers` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `guilds`
--
ALTER TABLE `guilds`
ADD CONSTRAINT `guilds_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `guild_invites`
--
ALTER TABLE `guild_invites`
ADD CONSTRAINT `guild_invites_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `guild_invites_ibfk_2` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `guild_members`
--
ALTER TABLE `guild_members`
ADD CONSTRAINT `guild_members_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `guild_members_ibfk_2` FOREIGN KEY (`rank_id`) REFERENCES `guild_ranks` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `guild_ranks`
--
ALTER TABLE `guild_ranks`
ADD CONSTRAINT `guild_ranks_ibfk_1` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `house_auctions`
--
ALTER TABLE `house_auctions`
ADD CONSTRAINT `house_auctions_ibfk_1` FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `house_auctions_ibfk_2` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `house_lists`
--
ALTER TABLE `house_lists`
ADD CONSTRAINT `house_lists_ibfk_1` FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `killers`
--
ALTER TABLE `killers`
ADD CONSTRAINT `killers_ibfk_1` FOREIGN KEY (`death_id`) REFERENCES `player_deaths` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `players`
--
ALTER TABLE `players`
ADD CONSTRAINT `players_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `players_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`);
--
-- Constraints for table `player_deaths`
--
ALTER TABLE `player_deaths`
ADD CONSTRAINT `player_deaths_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `player_depotitems`
--
ALTER TABLE `player_depotitems`
ADD CONSTRAINT `player_depotitems_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `player_items`
--
ALTER TABLE `player_items`
ADD CONSTRAINT `player_items_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `player_killers`
--
ALTER TABLE `player_killers`
ADD CONSTRAINT `player_killers_ibfk_1` FOREIGN KEY (`kill_id`) REFERENCES `killers` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `player_killers_ibfk_2` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `player_skills`
--
ALTER TABLE `player_skills`
ADD CONSTRAINT `player_skills_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `player_spells`
--
ALTER TABLE `player_spells`
ADD CONSTRAINT `player_spells_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `player_storage`
--
ALTER TABLE `player_storage`
ADD CONSTRAINT `player_storage_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `player_viplist`
--
ALTER TABLE `player_viplist`
ADD CONSTRAINT `player_viplist_ibfk_1` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `player_viplist_ibfk_2` FOREIGN KEY (`vip_id`) REFERENCES `players` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `tiles`
--
ALTER TABLE `tiles`
ADD CONSTRAINT `tiles_ibfk_1` FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE NO ACTION;
--
-- Constraints for table `tile_items`
--
ALTER TABLE `tile_items`
ADD CONSTRAINT `tile_items_ibfk_1` FOREIGN KEY (`tile_id`) REFERENCES `tiles` (`id`) ON DELETE CASCADE;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;