-- ----------------------------------------------------------------------
-- MySQL Migration Toolkit
-- SQL Create Script
-- ----------------------------------------------------------------------

SET FOREIGN_KEY_CHECKS = 0;

CREATE DATABASE IF NOT EXISTS `Mir2`
  CHARACTER SET latin1 COLLATE latin1_swedish_ci;
-- -------------------------------------
-- Tables

DROP TABLE IF EXISTS `Mir2`.`TBL_ADMIN`;
CREATE TABLE `Mir2`.`TBL_ADMIN` (
  `FLD_ADMINLEVEL` TINYINT(3) UNSIGNED NULL,
  `FLD_PLAYERNAME` VARCHAR(50) NULL,
  `FLD_IP` VARCHAR(15) NULL,
  PRIMARY KEY (`FLD_PLAYERNAME`)
)
ENGINE = INNODB;

DROP TABLE IF EXISTS `Mir2`.`TBL_AUCTION`;
CREATE TABLE `Mir2`.`TBL_AUCTION` (
  `FLD_AUCTIONID` INT(10) AUTO_INCREMENT NOT NULL,
  `FLD_START` INT(10) NULL,
  `FLD_END` INT(10) NULL,
  `FLD_SELLER` VARCHAR(20) NULL,
  `FLD_ITEMNAME` VARCHAR(20) NULL,
  `FLD_COST` INT(10) NULL,
  `FLD_MAKEINDEX` INT(10) NULL,
  `FLD_WINDEX` INT(10) NULL,
  `FLD_STDMODE` TINYINT(3) UNSIGNED NULL,
  `FLD_AMOUNT` INT(10) NULL,
  `FLD_DURA` INT(10) NULL,
  `FLD_MAXDURA` INT(10) NULL,
  `FLD_ADDITIONAL_0` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_1` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_2` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_3` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_4` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_5` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_6` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_7` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_8` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_9` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_10` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_11` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_12` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_13` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_14` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_15` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_16` TINYINT(3) UNSIGNED NULL,
  `FLD_ADDITIONAL_17` TINYINT(3) UNSIGNED NULL,
  `FLD_SOLD` TINYINT(1) NOT NULL,
  PRIMARY KEY (`FLD_AUCTIONID`),
  INDEX `FLD_AUCTIONID` (`FLD_AUCTIONID`)
)
ENGINE = INNODB;

DROP TABLE IF EXISTS `Mir2`.`TBL_BLOCKLIST`;
CREATE TABLE `Mir2`.`TBL_BLOCKLIST` (
  `FLD_ID` INT(10) AUTO_INCREMENT NOT NULL,
  `FLD_OWNER` VARCHAR(50) NULL,
  `FLD_NAME` VARCHAR(50) NULL,
  PRIMARY KEY (`FLD_ID`),
  INDEX `FLD_ID` (`FLD_ID`)
)
ENGINE = INNODB;

DROP TABLE IF EXISTS `Mir2`.`TBL_FRIEND`;
CREATE TABLE `Mir2`.`TBL_FRIEND` (
  `FLD_ID` INT(10) AUTO_INCREMENT NOT NULL,
  `FLD_CHAR` VARCHAR(50) NULL,
  `FLD_PERSON` VARCHAR(50) NULL,
  `FLD_BAD` TINYINT(1) NOT NULL,
  `FLD_TIME` VARCHAR(50) NULL,
  `FLD_MEMO` LONGTEXT NULL,
  PRIMARY KEY (`FLD_ID`),
  INDEX `FLD_ID` (`FLD_ID`)
)
ENGINE = INNODB;

DROP TABLE IF EXISTS `Mir2`.`TBL_GUARD`;
CREATE TABLE `Mir2`.`TBL_GUARD` (
  `FLD_GUARDNAME` VARCHAR(50) NULL,
  `FLD_MAPNAME` VARCHAR(50) NULL,
  `FLD_X` INT(10) NULL,
  `FLD_Y` INT(10) NULL,
  `FLD_DIRECTION` INT(10) NULL
)
ENGINE = INNODB;

DROP TABLE IF EXISTS `Mir2`.`TBL_KEEPALIVE`;
CREATE TABLE `Mir2`.`TBL_KEEPALIVE` (
  `FLD_ID` INT(10) NOT NULL,
  `FLD_TIME` VARCHAR(50) NULL,
  PRIMARY KEY (`FLD_ID`),
  INDEX `FLD_ID` (`FLD_ID`)
)
ENGINE = INNODB;

DROP TABLE IF EXISTS `Mir2`.`TBL_MAGIC`;
CREATE TABLE `Mir2`.`TBL_MAGIC` (
  `FLD_ID` INT(10) NULL,
  `FLD_MIMICID` INT(10) NULL,
  `FLD_NAME` VARCHAR(20) NULL,
  `FLD_EFFECTTYPE` SMALLINT(5) NULL,
  `FLD_EFFECT` SMALLINT(5) NULL,
  `FLD_SPELL` SMALLINT(5) NULL,
  `FLD_POWER` SMALLINT(5) NULL,
  `FLD_MAXPOWER` SMALLINT(5) NULL,
  `FLD_DEFSPELL` SMALLINT(5) NULL,
  `FLD_DEFPOWER` SMALLINT(5) NULL,
  `FLD_DEFMAXPOWER` SMALLINT(5) NULL,
  `FLD_JOB` SMALLINT(5) NULL,
  `FLD_NEEDL1` SMALLINT(5) NULL,
  `FLD_L1TRAIN` INT(10) NULL,
  `FLD_NEEDL2` SMALLINT(5) NULL,
  `FLD_L2TRAIN` INT(10) NULL,
  `FLD_NEEDL3` SMALLINT(5) NULL,
  `FLD_L3TRAIN` INT(10) NULL,
  `FLD_DELAY` SMALLINT(5) NULL,
  `FLD_DESCR` VARCHAR(8) NULL,
  INDEX `FLD_MIMICID` (`FLD_MIMICID`),
  INDEX `MagID` (`FLD_ID`)
)
ENGINE = INNODB;

DROP TABLE IF EXISTS `Mir2`.`TBL_MAIL`;
CREATE TABLE `Mir2`.`TBL_MAIL` (
  `FLD_ID` INT(10) AUTO_INCREMENT NOT NULL,
  `FLD_SENDER` VARCHAR(20) NULL,
  `FLD_RECIPIENT` VARCHAR(20) NULL,
  `FLD_CONTENT` LONGTEXT NULL,
  `FLD_READ` TINYINT(1) NOT NULL,
  `FLD_STATUS` INT(10) NULL,
  `FLD_TIME` VARCHAR(50) NULL,
  PRIMARY KEY (`FLD_ID`),
  INDEX `FLD_ID` (`FLD_ID`)
)
ENGINE = INNODB;

DROP TABLE IF EXISTS `Mir2`.`TBL_MAPINFO`;
CREATE TABLE `Mir2`.`TBL_MAPINFO` (
  `FLD_MAPFILENAME` VARCHAR(50) NULL,
  `FLD_MAPNAME` VARCHAR(50) NULL,
  `FLD_SERVERINDEX` INT(10) NULL,
  `FLD_MINIMAP` INT(10) NULL,
  `FLD_FLAGS` VARCHAR(100) NULL,
  PRIMARY KEY (`FLD_MAPFILENAME`)
)
ENGINE = INNODB;

DROP TABLE IF EXISTS `Mir2`.`TBL_MERCHANT`;
CREATE TABLE `Mir2`.`TBL_MERCHANT` (
  `FLD_INDEX` INT(10) NOT NULL,
  `FLD_SCRIPTFILE` VARCHAR(255) NULL,
  `FLD_MAPNAME` VARCHAR(255) NULL,
  `FLD_X` INT(10) NULL,
  `FLD_Y` INT(10) NULL,
  `FLD_NAME` VARCHAR(255) NULL,
  `FLD_FLAG` INT(10) NULL,
  `FLD_APPEARANCE` INT(10) NULL,
  `FLD_ISCASTLE` TINYINT(1) NOT NULL,
  `FLD_CANMOVE` TINYINT(1) NOT NULL,
  `FLD_MOVETIME` INT(10) NULL,
  `FLD_ENABLED` TINYINT(1) NOT NULL,
  PRIMARY KEY (`FLD_INDEX`)
)
ENGINE = INNODB;

DROP TABLE IF EXISTS `Mir2`.`TBL_MONGEN`;
CREATE TABLE `Mir2`.`TBL_MONGEN` (
  `FLD_MAPNAME` VARCHAR(128) NULL,
  `FLD_X` INT(10) NULL,
  `FLD_Y` INT(10) NULL,
  `FLD_MONNAME` VARCHAR(14) NULL,
  `FLD_RANGE` SMALLINT(5) NULL,
  `FLD_COUNT` SMALLINT(5) NULL,
  `FLD_GENTIME` INT(10) NULL,
  `FLD_SMALLGENRATE` INT(10) NULL,
  `FLD_LOAD` TINYINT(1) NOT NULL,
  `FLD_DESCRIPTION` VARCHAR(100) NULL,
  INDEX `FLD_MapID` (`FLD_MAPNAME`)
)
ENGINE = INNODB;

DROP TABLE IF EXISTS `Mir2`.`TBL_MONSTER`;
CREATE TABLE `Mir2`.`TBL_MONSTER` (
  `FLD_ID` INT(10) NOT NULL,
  `FLD_NAME` VARCHAR(14) NULL,
  `FLD_RACE` SMALLINT(5) NULL,
  `FLD_RACEIMG` SMALLINT(5) NULL,
  `FLD_IMGINDEX` SMALLINT(5) NULL,
  `FLD_LV` SMALLINT(5) NULL,
  `FLD_UNDEAD` SMALLINT(5) NULL,
  `FLD_COOLEYE` SMALLINT(5) NULL,
  `FLD_EXP` SMALLINT(5) NULL,
  `FLD_HP` SMALLINT(5) NULL,
  `FLD_MP` SMALLINT(5) NULL,
  `FLD_AC` SMALLINT(5) NULL,
  `FLD_MAC` SMALLINT(5) NULL,
  `FLD_DC` SMALLINT(5) NULL,
  `FLD_DCMAX` SMALLINT(5) NULL,
  `FLD_MC` SMALLINT(5) NULL,
  `FLD_SC` SMALLINT(5) NULL,
  `FLD_AGILITY` SMALLINT(5) NULL,
  `FLD_ACCURATE` SMALLINT(5) NULL,
  `FLD_WALK_SPD` SMALLINT(5) NULL,
  `FLD_WALKSTEP` SMALLINT(5) NULL,
  `FLD_WALKWAIT` SMALLINT(5) NULL,
  `FLD_ATTACK_SPD` SMALLINT(5) NULL,
  `FLD_TAME` TINYINT(1) NOT NULL,
  `FLD_ANTIPUSH` INT(10) NULL,
  `FLD_ANTIUNDEAD` INT(10) NULL,
  `FLD_SIZERATE` INT(10) NULL,
  `FLD_ANTISTOP` INT(10) NULL,
  `FLD_AGGRO` TINYINT(1) NOT NULL,
  `FLD_NOREV` TINYINT(1) NOT NULL,
  PRIMARY KEY (`FLD_ID`),
  INDEX `FLD_ID` (`FLD_ID`)
)
ENGINE = INNODB;

DROP TABLE IF EXISTS `Mir2`.`TBL_MOVEMAPEVENT`;
CREATE TABLE `Mir2`.`TBL_MOVEMAPEVENT` (
  `FLD_INDEX` INT(10) NULL,
  `FLD_SMAPFILENAME` VARCHAR(128) NULL,
  `FLD_SX` INT(10) NULL,
  `FLD_SY` INT(10) NULL,
  `FLD_DMAPFILENAME` VARCHAR(128) NULL,
  `FLD_DX` INT(10) NULL,
  `FLD_DY` INT(10) NULL,
  `FLD_DESCRIPTION` VARCHAR(100) NULL,
  PRIMARY KEY (`FLD_INDEX`),
  UNIQUE INDEX `FLD_INDEX` (`FLD_INDEX`)
)
ENGINE = INNODB;

DROP TABLE IF EXISTS `Mir2`.`TBL_NPC`;
CREATE TABLE `Mir2`.`TBL_NPC` (
  `ID` INT(10) NOT NULL,
  `FLD_NAME` VARCHAR(255) NULL,
  `FLD_TYPE` INT(10) NULL,
  `FLD_MAPNAME` VARCHAR(255) NULL,
  `FLD_X` INT(10) NULL,
  `FLD_Y` INT(10) NULL,
  `FLD_FLAG` INT(10) NULL,
  `FLD_APPEARANCE` INT(10) NULL,
  `FLD_ENABLED` TINYINT(1) NOT NULL,
  PRIMARY KEY (`ID`)
)
ENGINE = INNODB;

DROP TABLE IF EXISTS `Mir2`.`TBL_STARTPOINT`;
CREATE TABLE `Mir2`.`TBL_STARTPOINT` (
  `FLD_MAPNAME` VARCHAR(50) NULL,
  `FLD_X` INT(10) NULL,
  `FLD_Y` INT(10) NULL,
  INDEX `MapID` (`FLD_MAPNAME`)
)
ENGINE = INNODB;

DROP TABLE IF EXISTS `Mir2`.`TBL_STDITEMS`;
CREATE TABLE `Mir2`.`TBL_STDITEMS` (
  `FLD_ID` INT(10) NOT NULL,
  `FLD_NAME` VARCHAR(20) NULL,
  `FLD_STDMode` SMALLINT(5) NULL,
  `FLD_SHAPE` SMALLINT(5) NULL,
  `FLD_WEIGHT` SMALLINT(5) NULL,
  `FLD_ANICOUNT` SMALLINT(5) NULL,
  `FLD_SOURCE` SMALLINT(5) NULL,
  `FLD_RESERVED` SMALLINT(5) NULL,
  `FLD_IMGINDEX` INT(10) NULL,
  `FLD_DURAMAX` INT(10) NULL,
  `FLD_AC` SMALLINT(5) NULL,
  `FLD_ACMAX` SMALLINT(5) NULL,
  `FLD_MAC` SMALLINT(5) NULL,
  `FLD_MACMAX` SMALLINT(5) NULL,
  `FLD_DC` SMALLINT(5) NULL,
  `FLD_DCMAX` SMALLINT(5) NULL,
  `FLD_MC` SMALLINT(5) NULL,
  `FLD_MCMAX` SMALLINT(5) NULL,
  `FLD_SC` SMALLINT(5) NULL,
  `FLD_SCMAX` SMALLINT(5) NULL,
  `FLD_NEED` SMALLINT(5) NULL,
  `FLD_NEEDLEVEL` SMALLINT(5) NULL,
  `FLD_PRICE` INT(10) NULL,
  `FLD_STOCK` INT(10) NULL,
  `FLD_ATKSPD` INT(10) NULL,
  `FLD_AGILITY` INT(10) NULL,
  `FLD_ACCURATE` INT(10) NULL,
  `FLD_MGAVOID` INT(10) NULL,
  `FLD_STRONG` INT(10) NULL,
  `FLD_UNDEAD` INT(10) NULL,
  `FLD_HPADD` INT(10) NULL,
  `FLD_MPADD` INT(10) NULL,
  `FLD_EXPADD` INT(10) NULL,
  `FLD_EFFTYPE1` INT(10) NULL,
  `FLD_EFFRATE1` INT(10) NULL,
  `FLD_EFFVALUE1` INT(10) NULL,
  `FLD_EFFTYPE2` INT(10) NULL,
  `FLD_EFFRATE2` INT(10) NULL,
  `FLD_EFFVALUE2` INT(10) NULL,
  `FLD_SLOWDOWN` INT(10) NULL,
  `FLD_TOX` INT(10) NULL,
  `FLD_TOXAVOID` INT(10) NULL,
  `FLD_UNIQUEITEM` TINYINT(1) NOT NULL,
  `FLD_OVERLAPITEM` INT(10) NULL,
  `FLD_LIGHT` TINYINT(1) NOT NULL,
  `FLD_ITEMTYPE` INT(10) NULL,
  `FLD_ITEMSET` INT(10) NULL,
  `FLD_REFERENCE` VARCHAR(100) NULL,
  `FLD_Description` VARCHAR(50) NULL,
  PRIMARY KEY (`FLD_ID`),
  INDEX `FLD_ID` (`FLD_ID`),
  INDEX `MGAVOID` (`FLD_MGAVOID`),
  INDEX `TOXAVOID` (`FLD_TOXAVOID`)
)
ENGINE = INNODB;



SET FOREIGN_KEY_CHECKS = 1;

-- ----------------------------------------------------------------------
-- EOF

