



CREATE TABLE `admin_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`login` int(11) NOT NULL,
`msg` text CHARACTER SET utf8 NOT NULL,
`time` text CHARACTER SET utf8 NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;





CREATE TABLE IF NOT EXISTS `ares` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `hp` int(11) NOT NULL,
  `hpfull` int(11) NOT NULL,
  `attack` int(11) NOT NULL,
  `def` int(11) NOT NULL,
  `gold` int(11) NOT NULL,
  `silver` int(11) NOT NULL,
  `dead` int(11) NOT NULL,
  `exp` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;



INSERT INTO `ares` (`id`, `hp`, `hpfull`, `attack`, `def`, `gold`, `silver`, `dead`, `exp`) VALUES
(1, 1000000, 1000000, 10000, 10000, 10000, 10000, 1000, 1000);


CREATE TABLE IF NOT EXISTS `ares_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `text` varchar(250) NOT NULL,
  `time` int(11) NOT NULL,
  `user_uron` int(11) NOT NULL,
  `boss_uron` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE IF NOT EXISTS `block` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `usr` int(11) NOT NULL,
  `text` text CHARACTER SET utf8 NOT NULL,
  `nick` varchar(20) CHARACTER SET utf8 NOT NULL,
  `ban_time` int(11) NOT NULL,
  `tip` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;


CREATE TABLE IF NOT EXISTS `campaign` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_user` int(11) NOT NULL,
  `status` int(11) NOT NULL,
  `kol` int(11) NOT NULL DEFAULT '3',
  `grass` int(11) NOT NULL,
  `grass_stat` int(11) NOT NULL,
  `stone` int(11) NOT NULL,
  `stone_stat` int(11) NOT NULL,
  `udar` int(11) NOT NULL DEFAULT '9',
  `boss` int(11) NOT NULL,
  `boss_stat` int(11) NOT NULL,
  `boss_hp` int(11) NOT NULL,
  `agi` int(11) NOT NULL,
  `def` int(11) NOT NULL,
  `time` int(11) NOT NULL,
  `limit` int(11) NOT NULL,
  `user_hp` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE IF NOT EXISTS `campaign_boss` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(25) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=19 ;


INSERT INTO `campaign_boss` (`id`, `name`) VALUES
(1, 'Орки'),
(2, 'Тролль'),
(3, 'Каменный Голум'),
(4, 'Древесный страж'),
(5, 'Летающий Ужас'),
(6, 'Ящерозавр'),
(7, 'Лесной Шаман'),
(8, 'Горный Великан'),
(9, 'Адский Вампир'),
(10, 'Князь Троллей'),
(11, 'Мифический Левиафан'),
(12, 'Владыка Камня'),
(13, 'Смертельный Шторм'),
(14, 'Повелитель Бури'),
(15, 'Каменный Ящер'),
(16, 'Телекинетик'),
(17, 'Земляной Червь'),
(18, 'Император Тьмы');


CREATE TABLE IF NOT EXISTS `campaign_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_user` int(11) NOT NULL,
  `text` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE IF NOT EXISTS `cforum_comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_topic` int(11) NOT NULL,
  `id_user` int(11) NOT NULL,
  `id_clan` int(11) NOT NULL,
  `time` int(11) NOT NULL,
  `text` text CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;




CREATE TABLE IF NOT EXISTS `cforum_sub` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_clan` int(11) NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  `clan_rang` set('1','4','5','') NOT NULL,
  `gb` set('0','1','') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;




CREATE TABLE IF NOT EXISTS `cforum_topic` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_forum` int(11) NOT NULL,
  `id_user` int(11) NOT NULL,
  `id_clan` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `top` set('0','1','','') NOT NULL DEFAULT '0',
  `close` set('0','1','','') NOT NULL DEFAULT '0',
  `text` text NOT NULL,
  `time` int(11) NOT NULL,
  `onlick` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE IF NOT EXISTS `chat` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user` varchar(500) NOT NULL,
  `msg` text NOT NULL,
  `time` int(11) DEFAULT NULL,
  `tyrney` int(11) NOT NULL,
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE IF NOT EXISTS `clans_chat` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `usr` int(11) NOT NULL,
  `banda` int(11) NOT NULL,
  `time` int(11) NOT NULL,
  `msg` text CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE IF NOT EXISTS `clans_invite` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clan` int(11) NOT NULL,
  `usr` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;




CREATE TABLE IF NOT EXISTS `clans_journal` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clan` int(11) NOT NULL,
  `msg` text CHARACTER SET utf8 NOT NULL,
  `time` text CHARACTER SET utf8 NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE IF NOT EXISTS `config` (
  `id` int(11) NOT NULL,
  `rega` enum('on','off') NOT NULL DEFAULT 'on',
  `rega_off_msg` varchar(1000) CHARACTER SET utf8 NOT NULL,
  `cop` varchar(100) CHARACTER SET utf8 NOT NULL,
  `chat_lvl` int(11) NOT NULL,
  `forum_lvl` int(11) NOT NULL,
  `hp` int(11) NOT NULL,
  `hpfull` int(11) NOT NULL,
  `attack` int(11) NOT NULL,
  `def` int(11) NOT NULL,
  `gold` int(11) NOT NULL,
  `silver` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;



INSERT INTO `config` (`id`, `rega`, `rega_off_msg`, `cop`, `chat_lvl`, `forum_lvl`, `hp`, `hpfull`, `attack`, `def`, `gold`, `silver`) VALUES
(1, 'on', 'текст', '© Эпоха сражений 2015-2016', 1, 1, 100, 1000, 100, 100, 1000, 1000);



CREATE TABLE IF NOT EXISTS `contacts` (
  `user` int(11) NOT NULL DEFAULT '0',
  `ho` int(11) NOT NULL DEFAULT '0',
  `time` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `forum` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `access` set('0','1','2','') NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;



INSERT INTO `forum` (`id`, `name`, `access`) VALUES
(1, 'Новости игры', '2'),
(2, 'Общение', '0'),
(3, 'Предложения', '0'),
(4, 'Ошибки и баги', '0'),
(5, 'Помощь по игре', '0'),
(7, 'Кланы Зло', '0'),
(8, 'Кланы Добро', '0');



CREATE TABLE IF NOT EXISTS `inventar` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` text CHARACTER SET utf8 NOT NULL,
  `id_name` int(11) NOT NULL,
  `tip` text CHARACTER SET utf8 NOT NULL,
  `ataka` int(11) NOT NULL,
  `zah` int(11) NOT NULL,
  `mp` int(11) NOT NULL,
  `hp` int(11) NOT NULL,
  `lvl` int(11) NOT NULL,
  `bic` int(11) NOT NULL,
  `klass` text CHARACTER SET utf8 NOT NULL,
  `zoloto` int(11) NOT NULL,
  `image` varchar(5) CHARACTER SET utf8 NOT NULL,
  `tip2` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;





CREATE TABLE IF NOT EXISTS `item` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` text CHARACTER SET utf8 NOT NULL,
  `user` int(11) NOT NULL,
  `tip` text CHARACTER SET utf8 NOT NULL,
  `new` int(11) NOT NULL,
  `quality` int(11) NOT NULL,
  `hone` int(11) NOT NULL,
  `lvl` int(11) NOT NULL,
  `hp` int(11) NOT NULL,
  `attack` int(11) NOT NULL,
  `def` int(11) NOT NULL,
  `wearing` varchar(5) CHARACTER SET utf8 NOT NULL,
  `silver` int(11) NOT NULL,
  `exp` int(11) NOT NULL,
  `images` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE IF NOT EXISTS `mail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user` int(11) DEFAULT NULL,
  `to` int(11) DEFAULT NULL,
  `msg` text CHARACTER SET utf8,
  `read` int(11) DEFAULT NULL,
  `time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE IF NOT EXISTS `shop` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` text CHARACTER SET utf8 NOT NULL,
  `tip` text CHARACTER SET utf8 NOT NULL,
  `set` int(11) NOT NULL,
  `set_name` text CHARACTER SET utf8 NOT NULL,
  `attack` int(11) NOT NULL,
  `def` int(11) NOT NULL,
  `hp` int(11) NOT NULL,
  `lvl` int(11) NOT NULL,
  `gold` int(11) NOT NULL,
  `silver` int(11) NOT NULL,
  `exp` int(11) NOT NULL,
  `images` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;



INSERT INTO `shop` (`id`, `name`, `tip`, `set`, `set_name`, `attack`, `def`, `hp`, `lvl`, `gold`, `silver`, `exp`, `images`) VALUES
(1, 'Адамантитовое Забрало', 'head', 1, 'Адамантитовый Набор', 85, 85, 85, 0, 15, 5, 5, 1),
(2, 'Адамантитовый Наплечник', 'shoulder', 1, 'Адамантитовый Набор', 85, 85, 85, 0, 15, 5, 5, 1),
(3, 'Адамантитовый Панцирь', 'body', 1, 'Адамантитовый Набор', 85, 85, 85, 0, 15, 5, 5, 1),
(4, 'Дух Адамантитовой Горы', 'shield', 1, 'Адамантитовый Набор', 85, 85, 85, 0, 15, 5, 5, 1),
(5, 'Адамантитовый Клинок', 'weapon', 1, 'Адамантитовый Набор', 85, 85, 85, 0, 15, 5, 5, 1),
(6, 'Шлем Импа', 'head', 2, 'Набор Импа', 85, 85, 85, 0, 15, 5, 5, 2),
(7, 'Силы Импа', 'shoulder', 2, 'Набор Импа', 85, 85, 85, 0, 15, 5, 5, 2),
(8, 'Броня Импа', 'body', 2, 'Набор Импа', 85, 85, 85, 0, 15, 5, 5, 2),
(9, 'Щит Импа', 'shield', 2, 'Набор Импа', 85, 85, 85, 0, 15, 5, 5, 2),
(10, 'Секира Импа', 'weapon', 2, 'Набор Импа', 85, 85, 85, 0, 15, 5, 5, 2);



CREATE TABLE IF NOT EXISTS `topic` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_forum` int(11) NOT NULL,
  `id_user` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `top` set('0','1','','') NOT NULL DEFAULT '0',
  `close` set('0','1','','') NOT NULL DEFAULT '0',
  `text` text NOT NULL,
  `time` int(11) NOT NULL,
  `onlick` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `topic_msg` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_topic` int(11) NOT NULL,
  `id_user` int(11) NOT NULL,
  `time` int(11) NOT NULL,
  `text` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE IF NOT EXISTS `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `login` varchar(50) NOT NULL,
  `password` varchar(32) CHARACTER SET cp1251 NOT NULL,
  `secret` varchar(32) CHARACTER SET cp1251 NOT NULL,
  `prava` varchar(5) NOT NULL,
  `clan_prava` enum('leader','deputy','squaddie','rookie','no') NOT NULL DEFAULT 'no',
  `clan` int(11) NOT NULL,
  `clan_exp` int(11) NOT NULL,
  `save` int(11) NOT NULL,
  `sex` varchar(5) CHARACTER SET cp1251 NOT NULL,
  `rasa` varchar(12) CHARACTER SET cp1251 NOT NULL,
  `storona` varchar(12) CHARACTER SET cp1251 NOT NULL,
  `bonus` int(11) NOT NULL,
  `lvl` int(11) NOT NULL,
  `gold` int(11) NOT NULL,
  `silver` int(11) NOT NULL,
  `hp` int(11) NOT NULL,
  `hpfull` int(11) NOT NULL,
  `mp` int(11) NOT NULL,
  `mpfull` int(11) NOT NULL,
  `attack` int(11) NOT NULL,
  `def` int(11) NOT NULL,
  `sum` int(11) NOT NULL,
  `tren_hpfull` int(11) NOT NULL,
  `tren_mpfull` int(11) NOT NULL,
  `tren_attack` int(11) NOT NULL,
  `tren_def` int(11) NOT NULL,
  `exp` int(11) NOT NULL,
  `regenerator` int(11) NOT NULL,
  `online` int(11) NOT NULL,
  `spells` int(11) NOT NULL,
  `spells1` int(11) NOT NULL,
  `spells2` int(11) NOT NULL,
  `spells3` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

