added installation instructions
Krzysztof Sikorski

Krzysztof Sikorski commited on 2010-11-24 01:32:04
Showing 3 changed files, with 626 additions and 0 deletions.

... ...
@@ -0,0 +1,62 @@
1
+INTRODUCTION:
2
+The game was never planned to be released in public,
3
+so it's designed for the LAMP stack it was originally hosted on.
4
+Basically the code assumes some software versions and settings,
5
+and will propably break on different configuration.
6
+
7
+REQUIRED SOFTWARE:
8
+Apache 2.x, with enabled mod_rewrite and .htaccess files.
9
+PHP 5.2.x with settings like in attached php.ini file.
10
+MySQL 5.1, may also work on other 5.x versions.
11
+PHPTAL 1.2.1 - newer releases are propably also safe.
12
+The hosting MUST also offer crontab or other similar services.
13
+
14
+INSTALLATION:
15
+
16
+1) Prepare database tables using attached SQL file.
17
+
18
+2) Configure PHP using attached INI file.
19
+
20
+3) Upload game code into server.
21
+
22
+4) Download PHPTAL library and upload it into lib subdirectory,
23
+you should now have "lib/PHPTAL.php", "lib/PHPTAL/Context.php" etc.
24
+
25
+5) Enter your hosting's configuration panel and set the public subdir
26
+as a domain root, so other files won't be accessible from the Net.
27
+
28
+6) Configure crontab: set the "cron.php" file to be executed every day.
29
+
30
+7) And now the tricky part: create a config file (or files) and upload
31
+it into cfg subdirectory. It's a long and weird topic, details below.
32
+
33
+CONFIGURATION:
34
+
35
+The game configuration is handled by the Daemon_Config class
36
+(lib/daemon/config.php file), which uses it to overwrite its public
37
+properties. Consult the class' constructor for details.
38
+
39
+The file's content is simple, it should do nothing more than to return
40
+an associative array of settings. Here's an example of minimal config:
41
+
42
+<?php
43
+return array(
44
+	'applicationUrl' => 'http://example.com/foo/bar/baz/',
45
+	'applicationMail' => 'daemon@example.com',
46
+	'dbHost' => 'localhost',
47
+	'dbSchema' => 'daemon_db',
48
+	'dbUser' => 'username',
49
+	'dbPassword' => 'some_password',
50
+);
51
+
52
+The tricky part is the config's filename. As you can see in the class'
53
+constructor, it _must_ be exactly the same as the domain on which
54
+the game is hosted, plus the ".php" extension.
55
+For example, if the game is hosted on "example.com", then the filename
56
+is "example.com.php". This is designed to prevent accidental overwrites
57
+with config for other machines...
58
+
59
+There is also another tricky part: if you execute a script from the
60
+command line instead of URL, then the script uses a special "_cron.php"
61
+file instead of normal config. So you should create that file too.
62
+Or change the Daemon_Config's constructor ;)
... ...
@@ -0,0 +1,525 @@
1
+CREATE TABLE battles (
2
+  battle_id int NOT NULL AUTO_INCREMENT,
3
+  rollover_id smallint NOT NULL,
4
+  location_id varchar(32) NOT NULL,
5
+  "type" enum('caern','boss') NOT NULL,
6
+  combat_log text NOT NULL,
7
+  PRIMARY KEY (battle_id),
8
+  KEY rollover_id (rollover_id,battle_id)
9
+);
10
+
11
+
12
+CREATE TABLE characters (
13
+  character_id int NOT NULL AUTO_INCREMENT,
14
+  player_id int DEFAULT NULL,
15
+  "name" varchar(255) NOT NULL,
16
+  gender enum('f','m','n') NOT NULL,
17
+  date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
18
+  last_action datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
19
+  show_player tinyint(1) NOT NULL DEFAULT 0,
20
+  last_mail_id int NOT NULL DEFAULT 0,
21
+  clan_id varchar(8) DEFAULT NULL,
22
+  avatar_url tinytext,
23
+  quote text,
24
+  description text,
25
+  PRIMARY KEY (character_id),
26
+  UNIQUE KEY "name" ("name"),
27
+  KEY clan (clan_id,character_id),
28
+  KEY date_created (date_created,character_id),
29
+  KEY player_id (player_id,character_id),
30
+  KEY last_action (last_action)
31
+);
32
+
33
+
34
+CREATE TABLE character_data (
35
+  character_id int NOT NULL,
36
+  location_id varchar(32) DEFAULT NULL COMMENT 'current location',
37
+  faction_id varchar(32) DEFAULT NULL,
38
+  faction_points smallint NOT NULL DEFAULT 0,
39
+  rank_id tinyint DEFAULT NULL,
40
+  turns smallint NOT NULL DEFAULT 30,
41
+  gold_purse int NOT NULL DEFAULT 0,
42
+  gold_bank int NOT NULL DEFAULT 0,
43
+  "level" smallint NOT NULL DEFAULT 0,
44
+  xp_free int NOT NULL DEFAULT 29,
45
+  xp_used int NOT NULL DEFAULT 0,
46
+  deaths int NOT NULL DEFAULT 0,
47
+  health smallint NOT NULL DEFAULT 0,
48
+  health_max smallint NOT NULL DEFAULT 70,
49
+  mana smallint NOT NULL DEFAULT 0,
50
+  mana_max smallint NOT NULL DEFAULT 35,
51
+  mana_regen smallint NOT NULL DEFAULT 1,
52
+  a_str smallint NOT NULL DEFAULT 7,
53
+  a_dex smallint NOT NULL DEFAULT 7,
54
+  a_vit smallint NOT NULL DEFAULT 7,
55
+  a_pwr smallint NOT NULL DEFAULT 7,
56
+  a_wil smallint NOT NULL DEFAULT 7,
57
+  s_pstr smallint NOT NULL DEFAULT 0,
58
+  s_patk smallint NOT NULL DEFAULT 0,
59
+  s_pdef smallint NOT NULL DEFAULT 0,
60
+  s_pres smallint NOT NULL DEFAULT 0,
61
+  s_preg smallint NOT NULL DEFAULT 0,
62
+  s_mstr smallint NOT NULL DEFAULT 0,
63
+  s_matk smallint NOT NULL DEFAULT 0,
64
+  s_mdef smallint NOT NULL DEFAULT 0,
65
+  s_mres smallint NOT NULL DEFAULT 0,
66
+  s_mreg smallint NOT NULL DEFAULT 0,
67
+  sp_scout tinyint NOT NULL DEFAULT 0,
68
+  sp_identify tinyint NOT NULL DEFAULT 0,
69
+  sp_vchar tinyint NOT NULL DEFAULT 0,
70
+  sp_vmonster tinyint NOT NULL DEFAULT 0,
71
+  sp_vitem tinyint NOT NULL DEFAULT 0,
72
+  combat_unit_id varchar(32) DEFAULT NULL,
73
+  location_event text COMMENT 'event parameters',
74
+  PRIMARY KEY (character_id),
75
+  KEY "level" ("level",character_id),
76
+  KEY xp_used (xp_used,character_id),
77
+  KEY faction_id (faction_id,character_id),
78
+  KEY location_id (location_id,character_id)
79
+);
80
+
81
+
82
+CREATE TABLE character_missions (
83
+  character_id int NOT NULL,
84
+  rollover_id int NOT NULL,
85
+  service_id varchar(32) NOT NULL,
86
+  "type" enum('monster','item') NOT NULL,
87
+  params varchar(32) NOT NULL,
88
+  progress enum('active','completed','rewarded') NOT NULL DEFAULT 'active',
89
+  PRIMARY KEY (character_id,rollover_id)
90
+);
91
+
92
+
93
+CREATE TABLE character_regions (
94
+  character_id int NOT NULL,
95
+  region_id varchar(32) NOT NULL,
96
+  PRIMARY KEY (character_id,region_id)
97
+);
98
+
99
+
100
+CREATE TABLE character_statistics (
101
+  character_id int NOT NULL,
102
+  missions smallint NOT NULL DEFAULT 0,
103
+  duel_wins smallint NOT NULL DEFAULT 0,
104
+  duel_losses smallint NOT NULL DEFAULT 0,
105
+  kills_mob1 smallint NOT NULL DEFAULT 0,
106
+  kills_mob2 smallint NOT NULL DEFAULT 0,
107
+  kills_mob3 smallint NOT NULL DEFAULT 0,
108
+  kills_mob4 smallint NOT NULL DEFAULT 0,
109
+  PRIMARY KEY (character_id),
110
+  KEY duel_wins (duel_wins,character_id),
111
+  KEY duel_losses (duel_losses,character_id)
112
+);
113
+
114
+
115
+CREATE TABLE character_titles (
116
+  character_id int NOT NULL,
117
+  title_id varchar(32) NOT NULL,
118
+  PRIMARY KEY (character_id,title_id)
119
+);
120
+
121
+
122
+CREATE TABLE chat (
123
+  message_id int NOT NULL AUTO_INCREMENT,
124
+  date_added timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
125
+  channel_id varchar(255) NOT NULL,
126
+  sender_id int DEFAULT NULL,
127
+  content text NOT NULL,
128
+  PRIMARY KEY (message_id),
129
+  KEY sort (channel_id,message_id)
130
+);
131
+
132
+
133
+CREATE TABLE clans (
134
+  clan_id varchar(8) NOT NULL,
135
+  "name" varchar(255) NOT NULL,
136
+  date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
137
+  leader_id int DEFAULT NULL,
138
+  description text,
139
+  PRIMARY KEY (clan_id),
140
+  UNIQUE KEY "name" ("name")
141
+);
142
+
143
+
144
+CREATE TABLE clan_invitations (
145
+  clan_id varchar(32) NOT NULL,
146
+  character_id int NOT NULL,
147
+  date_added timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
148
+  description text,
149
+  PRIMARY KEY (clan_id,character_id),
150
+  KEY search (character_id,clan_id)
151
+);
152
+
153
+
154
+CREATE TABLE combat_units (
155
+  combat_unit_id varchar(32) NOT NULL,
156
+  "name" varchar(255) NOT NULL,
157
+  faction_id varchar(32) DEFAULT NULL,
158
+  health int NOT NULL DEFAULT 70,
159
+  health_max int NOT NULL DEFAULT 70,
160
+  str1 smallint NOT NULL DEFAULT 7,
161
+  atk1 smallint NOT NULL DEFAULT 7,
162
+  type1 enum('p','m') DEFAULT 'p',
163
+  count1 smallint NOT NULL DEFAULT 1,
164
+  sp1_type varchar(32) DEFAULT NULL,
165
+  sp1_param smallint DEFAULT NULL,
166
+  str2 smallint NOT NULL DEFAULT 7,
167
+  atk2 smallint NOT NULL DEFAULT 7,
168
+  type2 enum('p','m') DEFAULT NULL,
169
+  count2 smallint NOT NULL DEFAULT 0,
170
+  sp2_type varchar(32) DEFAULT NULL,
171
+  sp2_param smallint DEFAULT NULL,
172
+  pdef smallint NOT NULL DEFAULT 7,
173
+  pres smallint NOT NULL DEFAULT 7,
174
+  mdef smallint NOT NULL DEFAULT 7,
175
+  mres smallint NOT NULL DEFAULT 7,
176
+  speed smallint NOT NULL DEFAULT 7,
177
+  armor smallint NOT NULL DEFAULT 0,
178
+  armor_sp_type varchar(32) DEFAULT NULL,
179
+  armor_sp_param smallint DEFAULT NULL,
180
+  regen float NOT NULL DEFAULT 0,
181
+  PRIMARY KEY (combat_unit_id)
182
+);
183
+
184
+
185
+CREATE TABLE duels (
186
+  duel_id int NOT NULL AUTO_INCREMENT,
187
+  date_added timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
188
+  rollover_id smallint DEFAULT NULL,
189
+  attacker_id int NOT NULL,
190
+  defender_id int NOT NULL,
191
+  "type" enum('normal','arena') NOT NULL,
192
+  winner enum('a','b') DEFAULT NULL,
193
+  combat_log text,
194
+  PRIMARY KEY (duel_id)
195
+);
196
+
197
+
198
+CREATE TABLE "events" (
199
+  event_id varchar(32) NOT NULL,
200
+  "name" varchar(255) NOT NULL,
201
+  handle varchar(255) DEFAULT NULL,
202
+  description text,
203
+  PRIMARY KEY (event_id)
204
+);
205
+
206
+
207
+CREATE TABLE factions (
208
+  faction_id varchar(32) NOT NULL,
209
+  "name" varchar(255) NOT NULL,
210
+  power smallint NOT NULL DEFAULT 0,
211
+  PRIMARY KEY (faction_id)
212
+);
213
+
214
+
215
+CREATE TABLE faction_ranks (
216
+  faction_id varchar(32) NOT NULL,
217
+  rank_id tinyint NOT NULL,
218
+  min_points smallint NOT NULL DEFAULT 1,
219
+  title_id varchar(32) DEFAULT NULL,
220
+  PRIMARY KEY (faction_id,rank_id)
221
+);
222
+
223
+
224
+CREATE TABLE inventory (
225
+  inventory_id int NOT NULL AUTO_INCREMENT,
226
+  character_id int NOT NULL,
227
+  item_id varchar(32) NOT NULL,
228
+  "status" enum('inventory','storage') NOT NULL DEFAULT 'inventory',
229
+  flags set('bound','identified') NOT NULL,
230
+  equipped enum('hand_a','hand_b','armor','helmet','gloves','boots','pendant','accesory_a','accesory_b') DEFAULT NULL,
231
+  PRIMARY KEY (inventory_id),
232
+  KEY sort (character_id,"status")
233
+);
234
+
235
+
236
+CREATE TABLE items (
237
+  item_id varchar(32) NOT NULL,
238
+  "name" varchar(255) NOT NULL,
239
+  "type" enum('weapon1h','weapon2h','armor','helmet','gloves','boots','pendant','accesory','item') NOT NULL DEFAULT 'item',
240
+  "value" int NOT NULL DEFAULT 0,
241
+  suggested_value float NOT NULL DEFAULT 0,
242
+  damage_type enum('p','m') DEFAULT NULL,
243
+  special_type varchar(32) DEFAULT NULL,
244
+  special_param varchar(255) DEFAULT NULL,
245
+  pstr_p smallint NOT NULL DEFAULT 0,
246
+  pstr_c smallint NOT NULL DEFAULT 0,
247
+  patk_p smallint NOT NULL DEFAULT 0,
248
+  patk_c smallint NOT NULL DEFAULT 0,
249
+  pdef_p smallint NOT NULL DEFAULT 0,
250
+  pdef_c smallint NOT NULL DEFAULT 0,
251
+  pres_p smallint NOT NULL DEFAULT 0,
252
+  pres_c smallint NOT NULL DEFAULT 0,
253
+  mstr_p smallint NOT NULL DEFAULT 0,
254
+  mstr_c smallint NOT NULL DEFAULT 0,
255
+  matk_p smallint NOT NULL DEFAULT 0,
256
+  matk_c smallint NOT NULL DEFAULT 0,
257
+  mdef_p smallint NOT NULL DEFAULT 0,
258
+  mdef_c smallint NOT NULL DEFAULT 0,
259
+  mres_p smallint NOT NULL DEFAULT 0,
260
+  mres_c smallint NOT NULL DEFAULT 0,
261
+  armor smallint NOT NULL DEFAULT 0,
262
+  speed smallint NOT NULL DEFAULT 0,
263
+  regen smallint NOT NULL DEFAULT 0,
264
+  description text,
265
+  PRIMARY KEY (item_id)
266
+);
267
+
268
+
269
+CREATE TABLE item_specials (
270
+  special_id varchar(32) NOT NULL,
271
+  "name" varchar(255) NOT NULL,
272
+  handle varchar(255) DEFAULT NULL,
273
+  description text,
274
+  PRIMARY KEY (special_id)
275
+);
276
+
277
+
278
+CREATE TABLE item_templates (
279
+  id varchar(32) NOT NULL,
280
+  "name" varchar(255) NOT NULL,
281
+  pstr_p_p smallint NOT NULL DEFAULT 1,
282
+  pstr_p_m smallint NOT NULL DEFAULT 1,
283
+  pstr_c_p smallint NOT NULL DEFAULT 1,
284
+  pstr_c_m smallint NOT NULL DEFAULT 1,
285
+  patk_p_p smallint NOT NULL DEFAULT 1,
286
+  patk_p_m smallint NOT NULL DEFAULT 1,
287
+  patk_c_p smallint NOT NULL DEFAULT 1,
288
+  patk_c_m smallint NOT NULL DEFAULT 1,
289
+  pdef_p_p smallint NOT NULL DEFAULT 1,
290
+  pdef_p_m smallint NOT NULL DEFAULT 1,
291
+  pdef_c_p smallint NOT NULL DEFAULT 1,
292
+  pdef_c_m smallint NOT NULL DEFAULT 1,
293
+  pres_p_p smallint NOT NULL DEFAULT 1,
294
+  pres_p_m smallint NOT NULL DEFAULT 1,
295
+  pres_c_p smallint NOT NULL DEFAULT 1,
296
+  pres_c_m smallint NOT NULL DEFAULT 1,
297
+  mstr_p_p smallint NOT NULL DEFAULT 1,
298
+  mstr_p_m smallint NOT NULL DEFAULT 1,
299
+  mstr_c_p smallint NOT NULL DEFAULT 1,
300
+  mstr_c_m smallint NOT NULL DEFAULT 1,
301
+  matk_p_p smallint NOT NULL DEFAULT 1,
302
+  matk_p_m smallint NOT NULL DEFAULT 1,
303
+  matk_c_p smallint NOT NULL DEFAULT 1,
304
+  matk_c_m smallint NOT NULL DEFAULT 1,
305
+  mdef_p_p smallint NOT NULL DEFAULT 1,
306
+  mdef_p_m smallint NOT NULL DEFAULT 1,
307
+  mdef_c_p smallint NOT NULL DEFAULT 1,
308
+  mdef_c_m smallint NOT NULL DEFAULT 1,
309
+  mres_p_p smallint NOT NULL DEFAULT 1,
310
+  mres_p_m smallint NOT NULL DEFAULT 1,
311
+  mres_c_p smallint NOT NULL DEFAULT 1,
312
+  mres_c_m smallint NOT NULL DEFAULT 1,
313
+  armor_p smallint NOT NULL DEFAULT 1,
314
+  armor_m smallint NOT NULL DEFAULT 1,
315
+  speed_p smallint NOT NULL DEFAULT 1,
316
+  speed_m smallint NOT NULL DEFAULT 1,
317
+  regen_p smallint NOT NULL DEFAULT 1,
318
+  regen_m smallint NOT NULL DEFAULT 1,
319
+  PRIMARY KEY (id)
320
+);
321
+
322
+
323
+CREATE TABLE locations (
324
+  location_id varchar(32) NOT NULL,
325
+  "name" varchar(255) NOT NULL,
326
+  "type" enum('normal','arena','caern','boss') NOT NULL DEFAULT 'normal',
327
+  chance1 smallint NOT NULL DEFAULT 1,
328
+  chance2 smallint NOT NULL DEFAULT 1,
329
+  region_id varchar(32) DEFAULT NULL,
330
+  faction_id varchar(32) DEFAULT NULL,
331
+  faction_value tinyint NOT NULL DEFAULT 1,
332
+  description text,
333
+  picture_url tinytext,
334
+  boss_id varchar(32) DEFAULT NULL,
335
+  boss_status enum('hidden','active','defeated') DEFAULT NULL,
336
+  PRIMARY KEY (location_id),
337
+  KEY region_id (region_id,location_id),
338
+  KEY faction_id (faction_id,location_id),
339
+  KEY "type" ("type",location_id)
340
+);
341
+
342
+
343
+CREATE TABLE location_events (
344
+  location_id varchar(32) NOT NULL,
345
+  event_id varchar(32) NOT NULL,
346
+  chance smallint NOT NULL DEFAULT 1,
347
+  params varchar(255) NOT NULL DEFAULT '',
348
+  PRIMARY KEY (location_id,event_id),
349
+  KEY event_id (event_id,location_id)
350
+);
351
+
352
+
353
+CREATE TABLE location_monsters (
354
+  location_id varchar(32) NOT NULL,
355
+  monster_id varchar(32) NOT NULL,
356
+  chance smallint NOT NULL DEFAULT 1,
357
+  PRIMARY KEY (location_id,monster_id),
358
+  KEY monster_id (monster_id,location_id)
359
+);
360
+
361
+
362
+CREATE TABLE location_paths (
363
+  location_id varchar(32) NOT NULL,
364
+  destination_id varchar(32) NOT NULL,
365
+  "name" varchar(255) DEFAULT NULL,
366
+  cost_gold int NOT NULL DEFAULT 0,
367
+  cost_mana smallint NOT NULL DEFAULT 0,
368
+  PRIMARY KEY (location_id,destination_id),
369
+  KEY destination_id (destination_id,location_id)
370
+);
371
+
372
+
373
+CREATE TABLE location_services (
374
+  location_id varchar(32) NOT NULL,
375
+  service_id varchar(32) NOT NULL,
376
+  PRIMARY KEY (location_id,service_id)
377
+);
378
+
379
+
380
+CREATE TABLE mail (
381
+  message_id int NOT NULL AUTO_INCREMENT,
382
+  date_added timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
383
+  sender_id int DEFAULT NULL,
384
+  recipient_id int NOT NULL,
385
+  content text NOT NULL,
386
+  PRIMARY KEY (message_id),
387
+  KEY sort (recipient_id,message_id)
388
+);
389
+
390
+
391
+CREATE TABLE maps (
392
+  map_id varchar(32) NOT NULL,
393
+  "name" varchar(255) NOT NULL,
394
+  url varchar(255) NOT NULL,
395
+  sort smallint NOT NULL DEFAULT 0,
396
+  PRIMARY KEY (map_id)
397
+);
398
+
399
+
400
+CREATE TABLE monsters (
401
+  monster_id varchar(32) NOT NULL,
402
+  "name" varchar(255) NOT NULL,
403
+  class smallint NOT NULL DEFAULT 1,
404
+  "level" smallint NOT NULL DEFAULT 1,
405
+  gold int NOT NULL DEFAULT 0,
406
+  chance1 smallint NOT NULL DEFAULT 1,
407
+  chance2 smallint NOT NULL DEFAULT 1,
408
+  title_id varchar(255) DEFAULT NULL,
409
+  combat_unit_id varchar(32) DEFAULT NULL,
410
+  PRIMARY KEY (monster_id)
411
+);
412
+
413
+
414
+CREATE TABLE monster_drops (
415
+  monster_id varchar(32) NOT NULL,
416
+  item_id varchar(32) NOT NULL,
417
+  chance smallint NOT NULL DEFAULT 1,
418
+  PRIMARY KEY (monster_id,item_id)
419
+);
420
+
421
+
422
+CREATE TABLE newsfeed (
423
+  id varchar(255) NOT NULL,
424
+  updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
425
+  published timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
426
+  title varchar(255) DEFAULT NULL,
427
+  author varchar(255) DEFAULT NULL,
428
+  content text,
429
+  PRIMARY KEY (id),
430
+  KEY published (published)
431
+);
432
+
433
+
434
+CREATE TABLE parameters (
435
+  "name" varchar(255) NOT NULL,
436
+  "value" text NOT NULL,
437
+  PRIMARY KEY ("name")
438
+);
439
+
440
+
441
+CREATE TABLE players (
442
+  player_id int NOT NULL AUTO_INCREMENT,
443
+  "name" varchar(255) DEFAULT NULL,
444
+  login varchar(255) NOT NULL,
445
+  "password" varchar(255) NOT NULL,
446
+  date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
447
+  last_login datetime DEFAULT NULL,
448
+  roles set('chat','login') NOT NULL DEFAULT 'chat,login',
449
+  skin varchar(255) DEFAULT NULL,
450
+  email varchar(255) DEFAULT NULL,
451
+  reset_key varchar(255) DEFAULT NULL,
452
+  reset_until date DEFAULT NULL,
453
+  reset_password varchar(255) DEFAULT NULL,
454
+  PRIMARY KEY (player_id),
455
+  UNIQUE KEY login (login),
456
+  KEY reset_key (reset_key)
457
+);
458
+
459
+
460
+CREATE TABLE regions (
461
+  region_id varchar(32) NOT NULL,
462
+  "name" varchar(255) NOT NULL,
463
+  respawn_id varchar(32) DEFAULT NULL,
464
+  picture_url tinytext,
465
+  PRIMARY KEY (region_id)
466
+);
467
+
468
+
469
+CREATE TABLE rollovers (
470
+  rollover_id smallint NOT NULL AUTO_INCREMENT,
471
+  date_added timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
472
+  players_total smallint NOT NULL DEFAULT 0,
473
+  characters_total smallint NOT NULL DEFAULT 0,
474
+  clans_total smallint DEFAULT NULL,
475
+  PRIMARY KEY (rollover_id)
476
+);
477
+
478
+
479
+CREATE TABLE services (
480
+  service_id varchar(32) NOT NULL,
481
+  "type" enum('bank','healer','npc','shop','temple') NOT NULL,
482
+  "name" varchar(255) NOT NULL,
483
+  faction_id varchar(32) DEFAULT NULL,
484
+  rank_id tinyint DEFAULT NULL,
485
+  description text,
486
+  PRIMARY KEY (service_id)
487
+);
488
+
489
+
490
+CREATE TABLE service_items (
491
+  service_id varchar(32) NOT NULL,
492
+  item_id varchar(32) NOT NULL,
493
+  "type" enum('normal','drop') NOT NULL DEFAULT 'normal',
494
+  quantity smallint DEFAULT NULL,
495
+  PRIMARY KEY (service_id,item_id),
496
+  KEY item_id (item_id,service_id)
497
+);
498
+
499
+
500
+CREATE TABLE spells (
501
+  spell_id varchar(32) NOT NULL,
502
+  "name" varchar(255) NOT NULL,
503
+  max_level tinyint NOT NULL DEFAULT 7,
504
+  max_cost smallint NOT NULL DEFAULT 10,
505
+  min_cost smallint NOT NULL DEFAULT 1,
506
+  handle varchar(255) DEFAULT NULL,
507
+  PRIMARY KEY (spell_id)
508
+);
509
+
510
+INSERT INTO spells (spell_id, `name`, max_level, max_cost, min_cost, handle) VALUES
511
+('identify', 'Identyfikacja', 6, 45, 25, 'Identify'),
512
+('scout', 'Badanie Terenu', 4, 35, 20, 'Scout'),
513
+('vchar', 'Poznanie Postaci', 7, 60, 30, 'ScanCharacter'),
514
+('vitem', 'Poznanie Przedmiotu', 6, 40, 20, 'ScanItem'),
515
+('vmonster', 'Poznanie Potwora', 5, 40, 20, 'ScanMonster');
516
+
517
+CREATE TABLE titles (
518
+  title_id varchar(32) NOT NULL,
519
+  name_f varchar(255) NOT NULL DEFAULT '',
520
+  name_m varchar(255) NOT NULL DEFAULT '',
521
+  name_n varchar(255) NOT NULL DEFAULT '',
522
+  "type" enum('normal','special') NOT NULL DEFAULT 'normal',
523
+  PRIMARY KEY (title_id),
524
+  KEY "type" ("type",title_id)
525
+);
... ...
@@ -0,0 +1,39 @@
1
+[PHP]
2
+; language options
3
+short_open_tag = Off
4
+asp_tags = Off
5
+
6
+; error handling and logging
7
+error_reporting = E_ALL | E_STRICT
8
+display_errors = On
9
+display_startup_errors = Off
10
+log_errors = On
11
+log_errors_max_len = 0
12
+html_errors = Off
13
+error_log = "path/to/error.log"
14
+
15
+; data handling
16
+register_globals = Off
17
+register_long_arrays = Off
18
+register_argc_argv = Off
19
+auto_globals_jit = On
20
+magic_quotes_gpc = Off
21
+magic_quotes_runtime = Off
22
+magic_quotes_sybase = Off
23
+default_mimetype = "text/plain"
24
+default_charset = "UTF-8"
25
+always_populate_raw_post_data = Off
26
+
27
+
28
+[Date]
29
+date.timezone = "Europe/Warsaw"
30
+
31
+[iconv]
32
+iconv.input_encoding = "UTF-8"
33
+iconv.internal_encoding = "UTF-8"
34
+iconv.output_encoding = "UTF-8"
35
+
36
+[Session]
37
+session.use_cookies = 1
38
+session.use_only_cookies = 1
39
+session.auto_start = 0
0 40