summaryrefslogtreecommitdiff
path: root/sql-files
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-09 11:00:49 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-09 11:00:49 -0300
commit8a4bf716002a017de77fe7df301ef8e4aaf00a2e (patch)
tree4947d0b015baad639fa07133369e9a09c8a468bc /sql-files
downloadserverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.tar.gz
serverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.tar.bz2
serverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.tar.xz
serverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.zip
Initial commit
Diffstat (limited to 'sql-files')
-rw-r--r--sql-files/init.sql4
-rw-r--r--sql-files/initremote.sql4
-rw-r--r--sql-files/logs.sql186
-rw-r--r--sql-files/main.sql1093
-rw-r--r--sql-files/tools/convert_engine_innodb.sql56
-rw-r--r--sql-files/tools/convert_engine_myisam.sql56
-rw-r--r--sql-files/tools/convert_passwords.sql3
-rw-r--r--sql-files/upgrades/2013-02-14--16-15.sql7
-rw-r--r--sql-files/upgrades/2013-02-15--18-06.sql3
-rw-r--r--sql-files/upgrades/2013-03-05--01-05.sql3
-rw-r--r--sql-files/upgrades/2013-03-06--00-00.sql9
-rw-r--r--sql-files/upgrades/2013-03-09--01-56.sql4
-rw-r--r--sql-files/upgrades/2013-03-27--18-35.sql3
-rw-r--r--sql-files/upgrades/2013-04-16--01-24.sql3
-rw-r--r--sql-files/upgrades/2013-04-16--02-15.sql4
-rw-r--r--sql-files/upgrades/2013-10-09--21-38.sql3
-rw-r--r--sql-files/upgrades/2013-10-10--16-36.sql7
-rw-r--r--sql-files/upgrades/2013-10-27--16-47.sql6
-rw-r--r--sql-files/upgrades/2013-10-30--19-53.sql5
-rw-r--r--sql-files/upgrades/2013-10-30--21-12.sql3
-rw-r--r--sql-files/upgrades/2013-10-31--07-49.sql6
-rw-r--r--sql-files/upgrades/2013-11-09--00-03.sql5
-rw-r--r--sql-files/upgrades/2013-11-15--00-06.sql105
-rw-r--r--sql-files/upgrades/2013-11-15--19-57.sql5
-rw-r--r--sql-files/upgrades/2013-11-16--07-49.sql3
-rw-r--r--sql-files/upgrades/2013-11-18--08-23.sql65
-rw-r--r--sql-files/upgrades/2013-12-24--00-15.sql8
-rw-r--r--sql-files/upgrades/2014-01-04--16-47.sql61
-rw-r--r--sql-files/upgrades/2014-01-06--17-22.sql16
-rw-r--r--sql-files/upgrades/2014-02-19--17-57.sql4
-rw-r--r--sql-files/upgrades/2014-03-25--23-57.sql3
-rw-r--r--sql-files/upgrades/2014-04-07--22-04.sql3
-rw-r--r--sql-files/upgrades/2014-04-26--10-00.sql3
-rw-r--r--sql-files/upgrades/2014-05-17--00-06.sql3
-rw-r--r--sql-files/upgrades/2014-09-01--16-53.sql5
-rw-r--r--sql-files/upgrades/2014-11-03--00-45.sql3
-rw-r--r--sql-files/upgrades/2015-07-02--18-14.sql74
-rw-r--r--sql-files/upgrades/2015-07-08--13-08.sql6
-rw-r--r--sql-files/upgrades/2015-08-27--20-42.sql3
-rw-r--r--sql-files/upgrades/2015-12-16--12-57.sql26
-rw-r--r--sql-files/upgrades/2015-12-17--15-58.sql22
-rw-r--r--sql-files/upgrades/2016-03-10--22-18.sql22
-rw-r--r--sql-files/upgrades/2016-07-08--02-42.sql35
-rw-r--r--sql-files/upgrades/2016-07-08--02-51.sql30
-rw-r--r--sql-files/upgrades/2016-10-03--20-27.sql23
-rw-r--r--sql-files/upgrades/2016-10-26--10-29.sql23
-rw-r--r--sql-files/upgrades/2017-03-02--11-40.sql93
-rw-r--r--sql-files/upgrades/2017-03-05--08-09.sql15
-rw-r--r--sql-files/upgrades/2017-03-15--14-29.sql74
-rw-r--r--sql-files/upgrades/2017-06-04--15-04.sql24
-rw-r--r--sql-files/upgrades/2017-06-04--15-05.sql23
-rw-r--r--sql-files/upgrades/2017-11-04--10-39.sql6
-rw-r--r--sql-files/upgrades/2018-02-26--15-57.sql6
-rw-r--r--sql-files/upgrades/2018-03-10--04-06.sql24
-rw-r--r--sql-files/upgrades/2018-06-03--00-10.sql40
-rw-r--r--sql-files/upgrades/2018-06-03--17-16.sql24
-rw-r--r--sql-files/upgrades/2018-06-05--12-02.sql24
-rw-r--r--sql-files/upgrades/2018-07-24--03-23.sql22
-rw-r--r--sql-files/upgrades/2018-09-01--05-22.sql63
-rw-r--r--sql-files/upgrades/2018-12-14--01-02.sql24
-rw-r--r--sql-files/upgrades/2018-12-29--07-51.sql29
-rw-r--r--sql-files/upgrades/2019-04-08--21-52.sql29
-rw-r--r--sql-files/upgrades/2019-04-25--02-12.sql24
-rw-r--r--sql-files/upgrades/2019-05-09--18-07.sql22
-rw-r--r--sql-files/upgrades/2019-08-08--19-43.sql95
-rw-r--r--sql-files/upgrades/2019-10-05--19-01.sql28
-rw-r--r--sql-files/upgrades/2019-10-12--14-21.sql23
-rw-r--r--sql-files/upgrades/2019-11-22--23-58.sql23
-rw-r--r--sql-files/upgrades/2020-01-24--01-09.sql63
-rw-r--r--sql-files/upgrades/2020-03-22--01-56.sql23
-rw-r--r--sql-files/upgrades/2020-03-22--03-09.sql24
-rw-r--r--sql-files/upgrades/2020-05-01--04-44.sql25
-rw-r--r--sql-files/upgrades/2020-05-10--23-11.sql43
-rw-r--r--sql-files/upgrades/index.txt66
74 files changed, 3003 insertions, 0 deletions
diff --git a/sql-files/init.sql b/sql-files/init.sql
new file mode 100644
index 00000000..060245a0
--- /dev/null
+++ b/sql-files/init.sql
@@ -0,0 +1,4 @@
+CREATE DATABASE evol;
+CREATE USER 'evol'@'localhost' IDENTIFIED BY 'evol';
+GRANT ALTER,CREATE,SELECT,INSERT,UPDATE,DELETE,DROP,INDEX ON `evol`.* TO 'evol'@'localhost';
+FLUSH PRIVILEGES;
diff --git a/sql-files/initremote.sql b/sql-files/initremote.sql
new file mode 100644
index 00000000..fa87edb1
--- /dev/null
+++ b/sql-files/initremote.sql
@@ -0,0 +1,4 @@
+CREATE DATABASE evol;
+CREATE USER 'evol'@'%' IDENTIFIED BY 'evol';
+GRANT ALTER,CREATE,SELECT,INSERT,UPDATE,DELETE,DROP,INDEX ON `evol`.* TO 'evol'@'%';
+FLUSH PRIVILEGES;
diff --git a/sql-files/logs.sql b/sql-files/logs.sql
new file mode 100644
index 00000000..499afcfd
--- /dev/null
+++ b/sql-files/logs.sql
@@ -0,0 +1,186 @@
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2012-2020 Hercules Dev Team
+-- Copyright (C) Athena Dev Teams
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+-- PickLog Types
+-- (M)onsters Drop
+-- (P)layers Drop/Take
+-- Mobs Drop (L)oot Drop/Take
+-- Players (T)rade Give/Take
+-- Players (V)ending Sell/Take
+-- (S)hop Sell/Take
+-- (N)PC Give/Take
+-- (C)onsumable Items
+-- (A)dministrators Create/Delete
+-- Sto(R)age
+-- (G)uild Storage
+-- (E)mail attachment
+-- (B)uying Store
+-- Pr(O)duced Items/Ingredients
+-- Auct(I)oned Items
+-- (X) Other
+-- (D) Stolen from mobs
+-- (U) MVP Prizes
+
+--
+-- Table structure for table `atcommandlog`
+--
+
+CREATE TABLE IF NOT EXISTS `atcommandlog` (
+ `atcommand_id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `atcommand_date` DATETIME NULL,
+ `account_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `char_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `char_name` VARCHAR(25) NOT NULL DEFAULT '',
+ `map` VARCHAR(11) NOT NULL DEFAULT '',
+ `command` VARCHAR(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (`atcommand_id`),
+ INDEX (`account_id`),
+ INDEX (`char_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=1 ;
+
+--
+-- Table structure for table `branchlog`
+--
+
+CREATE TABLE IF NOT EXISTS `branchlog` (
+ `branch_id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `branch_date` DATETIME NULL,
+ `account_id` INT NOT NULL DEFAULT '0',
+ `char_id` INT NOT NULL DEFAULT '0',
+ `char_name` VARCHAR(25) NOT NULL DEFAULT '',
+ `map` VARCHAR(11) NOT NULL DEFAULT '',
+ PRIMARY KEY(`branch_id`),
+ INDEX (`account_id`),
+ INDEX (`char_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=1;
+
+--
+-- Table structure for table `chatlog`
+--
+
+CREATE TABLE IF NOT EXISTS `chatlog` (
+ `id` BIGINT NOT NULL AUTO_INCREMENT,
+ `time` DATETIME NULL,
+ `type` ENUM('O','W','P','G','M','C') NOT NULL DEFAULT 'O',
+ `type_id` INT NOT NULL DEFAULT '0',
+ `src_charid` INT NOT NULL DEFAULT '0',
+ `src_accountid` INT NOT NULL DEFAULT '0',
+ `src_map` VARCHAR(11) NOT NULL DEFAULT '',
+ `src_map_x` SMALLINT NOT NULL DEFAULT '0',
+ `src_map_y` SMALLINT NOT NULL DEFAULT '0',
+ `dst_charname` VARCHAR(25) NOT NULL DEFAULT '',
+ `message` VARCHAR(150) NOT NULL DEFAULT '',
+ PRIMARY KEY (`id`),
+ INDEX (`src_accountid`),
+ INDEX (`src_charid`)
+) ENGINE=MyISAM AUTO_INCREMENT=1;
+
+--
+-- Table structure for table `loginlog`
+--
+
+CREATE TABLE IF NOT EXISTS `loginlog` (
+ `time` DATETIME NULL,
+ `ip` VARCHAR(15) NOT NULL DEFAULT '',
+ `user` VARCHAR(23) NOT NULL DEFAULT '',
+ `rcode` TINYINT NOT NULL DEFAULT '0',
+ `log` VARCHAR(255) NOT NULL DEFAULT '',
+ INDEX (`ip`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `mvplog`
+--
+
+CREATE TABLE IF NOT EXISTS `mvplog` (
+ `mvp_id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `mvp_date` DATETIME NULL,
+ `kill_char_id` INT NOT NULL DEFAULT '0',
+ `monster_id` SMALLINT NOT NULL DEFAULT '0',
+ `prize` INT NOT NULL DEFAULT '0',
+ `mvpexp` MEDIUMINT NOT NULL DEFAULT '0',
+ `map` VARCHAR(11) NOT NULL DEFAULT '',
+ PRIMARY KEY (`mvp_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=1;
+
+--
+-- Table structure for table `npclog`
+--
+
+CREATE TABLE IF NOT EXISTS `npclog` (
+ `npc_id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `npc_date` DATETIME NULL,
+ `account_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `char_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `char_name` VARCHAR(25) NOT NULL DEFAULT '',
+ `map` VARCHAR(11) NOT NULL DEFAULT '',
+ `mes` VARCHAR(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (`npc_id`),
+ INDEX (`account_id`),
+ INDEX (`char_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=1;
+
+--
+-- Table structure for table `picklog`
+--
+
+CREATE TABLE IF NOT EXISTS `picklog` (
+ `id` INT NOT NULL AUTO_INCREMENT,
+ `time` DATETIME NULL,
+ `char_id` INT NOT NULL DEFAULT '0',
+ `type` ENUM('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U','K','Y','Z','W','Q','J','H','@','0','1','2','3') NOT NULL DEFAULT 'P',
+ `nameid` INT NOT NULL DEFAULT '0',
+ `amount` INT NOT NULL DEFAULT '1',
+ `refine` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `card0` INT NOT NULL DEFAULT '0',
+ `card1` INT NOT NULL DEFAULT '0',
+ `card2` INT NOT NULL DEFAULT '0',
+ `card3` INT NOT NULL DEFAULT '0',
+ `opt_idx0` SMALLINT unsigned NOT NULL default '0',
+ `opt_val0` SMALLINT unsigned NOT NULL default '0',
+ `opt_idx1` SMALLINT unsigned NOT NULL default '0',
+ `opt_val1` SMALLINT unsigned NOT NULL default '0',
+ `opt_idx2` SMALLINT unsigned NOT NULL default '0',
+ `opt_val2` SMALLINT unsigned NOT NULL default '0',
+ `opt_idx3` SMALLINT unsigned NOT NULL default '0',
+ `opt_val3` SMALLINT unsigned NOT NULL default '0',
+ `opt_idx4` SMALLINT unsigned NOT NULL default '0',
+ `opt_val4` SMALLINT unsigned NOT NULL default '0',
+ `unique_id` BIGINT UNSIGNED NOT NULL DEFAULT '0',
+ `map` VARCHAR(11) NOT NULL DEFAULT '',
+ PRIMARY KEY (`id`),
+ INDEX (`type`)
+) ENGINE=MyISAM AUTO_INCREMENT=1;
+
+--
+-- Table structure for table `zenylog`
+--
+
+CREATE TABLE IF NOT EXISTS `zenylog` (
+ `id` INT NOT NULL AUTO_INCREMENT,
+ `time` DATETIME NULL,
+ `char_id` INT NOT NULL DEFAULT '0',
+ `src_id` INT NOT NULL DEFAULT '0',
+ `type` ENUM('T','V','P','M','S','N','D','C','A','E','I','B','K') NOT NULL DEFAULT 'S',
+ `amount` INT NOT NULL DEFAULT '0',
+ `map` VARCHAR(11) NOT NULL DEFAULT '',
+ PRIMARY KEY (`id`),
+ INDEX (`type`)
+) ENGINE=MyISAM AUTO_INCREMENT=1;
+
diff --git a/sql-files/main.sql b/sql-files/main.sql
new file mode 100644
index 00000000..271c5c7a
--- /dev/null
+++ b/sql-files/main.sql
@@ -0,0 +1,1093 @@
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2012-2020 Hercules Dev Team
+-- Copyright (C) Athena Dev Teams
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+--
+-- Table structure for table `account_data`
+--
+
+CREATE TABLE IF NOT EXISTS `account_data` (
+ `account_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `bank_vault` INT UNSIGNED NOT NULL DEFAULT '0',
+ `base_exp` SMALLINT UNSIGNED NOT NULL DEFAULT '100',
+ `base_drop` SMALLINT UNSIGNED NOT NULL DEFAULT '100',
+ `base_death` SMALLINT UNSIGNED NOT NULL DEFAULT '100',
+ PRIMARY KEY (`account_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `acc_reg_num_db`
+--
+
+CREATE TABLE IF NOT EXISTS `acc_reg_num_db` (
+ `account_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT UNSIGNED NOT NULL DEFAULT '0',
+ `value` INT NOT NULL DEFAULT '0',
+ PRIMARY KEY (`account_id`,`key`,`index`),
+ KEY `account_id` (`account_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `acc_reg_str_db`
+--
+
+CREATE TABLE IF NOT EXISTS `acc_reg_str_db` (
+ `account_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT UNSIGNED NOT NULL DEFAULT '0',
+ `value` VARCHAR(255) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`account_id`,`key`,`index`),
+ KEY `account_id` (`account_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `auction`
+--
+
+CREATE TABLE IF NOT EXISTS `auction` (
+ `auction_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `seller_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `seller_name` VARCHAR(30) NOT NULL DEFAULT '',
+ `buyer_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `buyer_name` VARCHAR(30) NOT NULL DEFAULT '',
+ `price` INT UNSIGNED NOT NULL DEFAULT '0',
+ `buynow` INT UNSIGNED NOT NULL DEFAULT '0',
+ `hours` SMALLINT NOT NULL DEFAULT '0',
+ `timestamp` INT UNSIGNED NOT NULL DEFAULT '0',
+ `nameid` INT UNSIGNED NOT NULL DEFAULT '0',
+ `item_name` VARCHAR(50) NOT NULL DEFAULT '',
+ `type` SMALLINT NOT NULL DEFAULT '0',
+ `refine` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `attribute` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `card0` INT NOT NULL DEFAULT '0',
+ `card1` INT NOT NULL DEFAULT '0',
+ `card2` INT NOT NULL DEFAULT '0',
+ `card3` INT NOT NULL DEFAULT '0',
+ `opt_idx0` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val0` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx1` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val1` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx2` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val2` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx3` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val3` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx4` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val4` SMALLINT NOT NULL DEFAULT '0',
+ `unique_id` BIGINT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`auction_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `autotrade_data`
+--
+
+CREATE TABLE IF NOT EXISTS `autotrade_data` (
+ `char_id` INT NOT NULL DEFAULT '0',
+ `itemkey` INT NOT NULL DEFAULT '0',
+ `amount` INT NOT NULL DEFAULT '0',
+ `price` INT NOT NULL DEFAULT '0',
+ PRIMARY KEY (`char_id`,`itemkey`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `autotrade_merchants`
+--
+
+CREATE TABLE IF NOT EXISTS `autotrade_merchants` (
+ `account_id` INT NOT NULL DEFAULT '0',
+ `char_id` INT NOT NULL DEFAULT '0',
+ `sex` TINYINT NOT NULL DEFAULT '0',
+ `title` VARCHAR(80) NOT NULL DEFAULT 'Buy From Me!',
+ PRIMARY KEY (`account_id`,`char_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `char_achievements`
+--
+
+CREATE TABLE IF NOT EXISTS `char_achievements` (
+ `char_id` INT UNSIGNED NOT NULL,
+ `ach_id` INT UNSIGNED NOT NULL,
+ `completed_at` INT UNSIGNED NOT NULL DEFAULT '0',
+ `rewarded_at` INT UNSIGNED NOT NULL DEFAULT '0',
+ `obj_0` INT UNSIGNED NOT NULL DEFAULT '0',
+ `obj_1` INT UNSIGNED NOT NULL DEFAULT '0',
+ `obj_2` INT UNSIGNED NOT NULL DEFAULT '0',
+ `obj_3` INT UNSIGNED NOT NULL DEFAULT '0',
+ `obj_4` INT UNSIGNED NOT NULL DEFAULT '0',
+ `obj_5` INT UNSIGNED NOT NULL DEFAULT '0',
+ `obj_6` INT UNSIGNED NOT NULL DEFAULT '0',
+ `obj_7` INT UNSIGNED NOT NULL DEFAULT '0',
+ `obj_8` INT UNSIGNED NOT NULL DEFAULT '0',
+ `obj_9` INT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`char_id`, `ach_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `cart_inventory`
+--
+
+CREATE TABLE IF NOT EXISTS `cart_inventory` (
+ `id` INT NOT NULL AUTO_INCREMENT,
+ `char_id` INT NOT NULL DEFAULT '0',
+ `nameid` INT NOT NULL DEFAULT '0',
+ `amount` INT NOT NULL DEFAULT '0',
+ `equip` INT UNSIGNED NOT NULL DEFAULT '0',
+ `identify` SMALLINT NOT NULL DEFAULT '0',
+ `refine` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `attribute` TINYINT NOT NULL DEFAULT '0',
+ `card0` INT NOT NULL DEFAULT '0',
+ `card1` INT NOT NULL DEFAULT '0',
+ `card2` INT NOT NULL DEFAULT '0',
+ `card3` INT NOT NULL DEFAULT '0',
+ `opt_idx0` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val0` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx1` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val1` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx2` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val2` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx3` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val3` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx4` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val4` SMALLINT NOT NULL DEFAULT '0',
+ `expire_time` INT UNSIGNED NOT NULL DEFAULT '0',
+ `bound` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `unique_id` BIGINT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ KEY `char_id` (`char_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `char`
+--
+
+CREATE TABLE IF NOT EXISTS `char` (
+ `char_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `account_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `char_num` TINYINT NOT NULL DEFAULT '0',
+ `name` VARCHAR(30) NOT NULL DEFAULT '',
+ `class` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `base_level` SMALLINT UNSIGNED NOT NULL DEFAULT '1',
+ `job_level` SMALLINT UNSIGNED NOT NULL DEFAULT '1',
+ `base_exp` BIGINT UNSIGNED NOT NULL DEFAULT '0',
+ `job_exp` BIGINT UNSIGNED NOT NULL DEFAULT '0',
+ `zeny` INT UNSIGNED NOT NULL DEFAULT '0',
+ `str` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `agi` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `vit` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `int` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `dex` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `luk` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `max_hp` INT UNSIGNED NOT NULL DEFAULT '0',
+ `hp` INT UNSIGNED NOT NULL DEFAULT '0',
+ `max_sp` INT UNSIGNED NOT NULL DEFAULT '0',
+ `sp` INT UNSIGNED NOT NULL DEFAULT '0',
+ `status_point` INT UNSIGNED NOT NULL DEFAULT '0',
+ `skill_point` INT UNSIGNED NOT NULL DEFAULT '0',
+ `option` INT NOT NULL DEFAULT '0',
+ `karma` TINYINT NOT NULL DEFAULT '0',
+ `manner` SMALLINT NOT NULL DEFAULT '0',
+ `party_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `guild_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `clan_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `pet_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `homun_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `elemental_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `hair` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `hair_color` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `clothes_color` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `body` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `weapon` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `shield` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `head_top` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `head_mid` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `head_bottom` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `robe` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `last_login` BIGINT NULL DEFAULT '0',
+ `last_map` VARCHAR(11) NOT NULL DEFAULT '',
+ `last_x` SMALLINT UNSIGNED NOT NULL DEFAULT '53',
+ `last_y` SMALLINT UNSIGNED NOT NULL DEFAULT '111',
+ `save_map` VARCHAR(11) NOT NULL DEFAULT '',
+ `save_x` SMALLINT UNSIGNED NOT NULL DEFAULT '53',
+ `save_y` SMALLINT UNSIGNED NOT NULL DEFAULT '111',
+ `partner_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `online` TINYINT NOT NULL DEFAULT '0',
+ `father` INT UNSIGNED NOT NULL DEFAULT '0',
+ `mother` INT UNSIGNED NOT NULL DEFAULT '0',
+ `child` INT UNSIGNED NOT NULL DEFAULT '0',
+ `fame` INT UNSIGNED NOT NULL DEFAULT '0',
+ `rename` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `delete_date` INT UNSIGNED NOT NULL DEFAULT '0',
+ `slotchange` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `char_opt` INT UNSIGNED NOT NULL DEFAULT '0',
+ `font` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `unban_time` INT UNSIGNED NOT NULL DEFAULT '0',
+ `uniqueitem_counter` BIGINT UNSIGNED NOT NULL DEFAULT '0',
+ `sex` ENUM('M','F','U') NOT NULL DEFAULT 'U',
+ `hotkey_rowshift` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `hotkey_rowshift2` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `attendance_count` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `attendance_timer` BIGINT NULL DEFAULT '0',
+ `title_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `inventory_size` INT UNSIGNED NOT NULL DEFAULT '100',
+ PRIMARY KEY (`char_id`),
+ UNIQUE KEY `name_key` (`name`),
+ KEY `account_id` (`account_id`),
+ KEY `party_id` (`party_id`),
+ KEY `guild_id` (`guild_id`),
+ KEY `online` (`online`)
+) ENGINE=MyISAM AUTO_INCREMENT=150000;
+
+--
+-- Table structure for table `char_reg_num_db`
+--
+
+CREATE TABLE IF NOT EXISTS `char_reg_num_db` (
+ `char_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT UNSIGNED NOT NULL DEFAULT '0',
+ `value` INT NOT NULL DEFAULT '0',
+ PRIMARY KEY (`char_id`,`key`,`index`),
+ KEY `char_id` (`char_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `char_reg_str_db`
+--
+
+CREATE TABLE IF NOT EXISTS `char_reg_str_db` (
+ `char_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT UNSIGNED NOT NULL DEFAULT '0',
+ `value` VARCHAR(255) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`char_id`,`key`,`index`),
+ KEY `char_id` (`char_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `charlog`
+--
+
+CREATE TABLE IF NOT EXISTS `charlog` (
+ `time` DATETIME NULL,
+ `char_msg` VARCHAR(255) NOT NULL DEFAULT 'char select',
+ `account_id` INT NOT NULL DEFAULT '0',
+ `char_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `char_num` TINYINT NOT NULL DEFAULT '0',
+ `class` MEDIUMINT NOT NULL DEFAULT '0',
+ `name` VARCHAR(23) NOT NULL DEFAULT '',
+ `str` INT UNSIGNED NOT NULL DEFAULT '0',
+ `agi` INT UNSIGNED NOT NULL DEFAULT '0',
+ `vit` INT UNSIGNED NOT NULL DEFAULT '0',
+ `int` INT UNSIGNED NOT NULL DEFAULT '0',
+ `dex` INT UNSIGNED NOT NULL DEFAULT '0',
+ `luk` INT UNSIGNED NOT NULL DEFAULT '0',
+ `hair` TINYINT NOT NULL DEFAULT '0',
+ `hair_color` INT NOT NULL DEFAULT '0'
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `elemental`
+--
+
+CREATE TABLE IF NOT EXISTS `elemental` (
+ `ele_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `char_id` INT NOT NULL,
+ `class` MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
+ `mode` INT UNSIGNED NOT NULL DEFAULT '1',
+ `hp` INT NOT NULL DEFAULT '1',
+ `sp` INT NOT NULL DEFAULT '1',
+ `max_hp` MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
+ `max_sp` MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
+ `atk1` MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
+ `atk2` MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
+ `matk` MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
+ `aspd` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `def` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `mdef` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `flee` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `hit` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `life_time` INT NOT NULL DEFAULT '0',
+ PRIMARY KEY (`ele_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `friends`
+--
+
+CREATE TABLE IF NOT EXISTS `friends` (
+ `char_id` INT NOT NULL DEFAULT '0',
+ `friend_account` INT NOT NULL DEFAULT '0',
+ `friend_id` INT NOT NULL DEFAULT '0',
+ KEY `char_id` (`char_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `hotkey`
+--
+
+CREATE TABLE IF NOT EXISTS `hotkey` (
+ `char_id` INT NOT NULL,
+ `hotkey` TINYINT UNSIGNED NOT NULL,
+ `type` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `itemskill_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `skill_lvl` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`char_id`,`hotkey`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `global_acc_reg_num_db`
+--
+
+CREATE TABLE IF NOT EXISTS `global_acc_reg_num_db` (
+ `account_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT UNSIGNED NOT NULL DEFAULT '0',
+ `value` INT NOT NULL DEFAULT '0',
+ PRIMARY KEY (`account_id`,`key`,`index`),
+ KEY `account_id` (`account_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `global_acc_reg_str_db`
+--
+
+CREATE TABLE IF NOT EXISTS `global_acc_reg_str_db` (
+ `account_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT UNSIGNED NOT NULL DEFAULT '0',
+ `value` VARCHAR(255) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`account_id`,`key`,`index`),
+ KEY `account_id` (`account_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `guild`
+--
+
+CREATE TABLE IF NOT EXISTS `guild` (
+ `guild_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `name` VARCHAR(24) NOT NULL DEFAULT '',
+ `char_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `master` VARCHAR(24) NOT NULL DEFAULT '',
+ `guild_lv` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `connect_member` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `max_member` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `average_lv` SMALLINT UNSIGNED NOT NULL DEFAULT '1',
+ `exp` BIGINT UNSIGNED NOT NULL DEFAULT '0',
+ `next_exp` INT UNSIGNED NOT NULL DEFAULT '0',
+ `skill_point` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `mes1` VARCHAR(60) NOT NULL DEFAULT '',
+ `mes2` VARCHAR(120) NOT NULL DEFAULT '',
+ `emblem_len` INT UNSIGNED NOT NULL DEFAULT '0',
+ `emblem_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `emblem_data` blob,
+ PRIMARY KEY (`guild_id`,`char_id`),
+ UNIQUE KEY `guild_id` (`guild_id`),
+ KEY `char_id` (`char_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `guild_alliance`
+--
+
+CREATE TABLE IF NOT EXISTS `guild_alliance` (
+ `guild_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `opposition` INT UNSIGNED NOT NULL DEFAULT '0',
+ `alliance_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `name` VARCHAR(24) NOT NULL DEFAULT '',
+ PRIMARY KEY (`guild_id`,`alliance_id`),
+ KEY `alliance_id` (`alliance_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `guild_castle`
+--
+
+CREATE TABLE IF NOT EXISTS `guild_castle` (
+ `castle_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `guild_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `economy` INT UNSIGNED NOT NULL DEFAULT '0',
+ `defense` INT UNSIGNED NOT NULL DEFAULT '0',
+ `triggerE` INT UNSIGNED NOT NULL DEFAULT '0',
+ `triggerD` INT UNSIGNED NOT NULL DEFAULT '0',
+ `nextTime` INT UNSIGNED NOT NULL DEFAULT '0',
+ `payTime` INT UNSIGNED NOT NULL DEFAULT '0',
+ `createTime` INT UNSIGNED NOT NULL DEFAULT '0',
+ `visibleC` INT UNSIGNED NOT NULL DEFAULT '0',
+ `visibleG0` INT UNSIGNED NOT NULL DEFAULT '0',
+ `visibleG1` INT UNSIGNED NOT NULL DEFAULT '0',
+ `visibleG2` INT UNSIGNED NOT NULL DEFAULT '0',
+ `visibleG3` INT UNSIGNED NOT NULL DEFAULT '0',
+ `visibleG4` INT UNSIGNED NOT NULL DEFAULT '0',
+ `visibleG5` INT UNSIGNED NOT NULL DEFAULT '0',
+ `visibleG6` INT UNSIGNED NOT NULL DEFAULT '0',
+ `visibleG7` INT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`castle_id`),
+ KEY `guild_id` (`guild_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `guild_expulsion`
+--
+
+CREATE TABLE IF NOT EXISTS `guild_expulsion` (
+ `guild_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `account_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `char_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `name` VARCHAR(24) NOT NULL DEFAULT '',
+ `mes` VARCHAR(40) NOT NULL DEFAULT '',
+ PRIMARY KEY (`guild_id`,`name`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `guild_member`
+--
+
+CREATE TABLE IF NOT EXISTS `guild_member` (
+ `guild_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `account_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `char_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `hair` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `hair_color` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `gender` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `class` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `lv` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `exp` BIGINT UNSIGNED NOT NULL DEFAULT '0',
+ `exp_payper` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `online` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `position` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `name` VARCHAR(24) NOT NULL DEFAULT '',
+ PRIMARY KEY (`guild_id`,`char_id`),
+ KEY `char_id` (`char_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `guild_position`
+--
+
+CREATE TABLE IF NOT EXISTS `guild_position` (
+ `guild_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `position` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `name` VARCHAR(24) NOT NULL DEFAULT '',
+ `mode` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `exp_mode` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`guild_id`,`position`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `guild_skill`
+--
+
+CREATE TABLE IF NOT EXISTS `guild_skill` (
+ `guild_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `id` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `lv` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`guild_id`,`id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `guild_storage`
+--
+
+CREATE TABLE IF NOT EXISTS `guild_storage` (
+ `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `guild_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `nameid` INT UNSIGNED NOT NULL DEFAULT '0',
+ `amount` INT UNSIGNED NOT NULL DEFAULT '0',
+ `equip` INT UNSIGNED NOT NULL DEFAULT '0',
+ `identify` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `refine` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `attribute` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `card0` INT NOT NULL DEFAULT '0',
+ `card1` INT NOT NULL DEFAULT '0',
+ `card2` INT NOT NULL DEFAULT '0',
+ `card3` INT NOT NULL DEFAULT '0',
+ `opt_idx0` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val0` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx1` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val1` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx2` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val2` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx3` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val3` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx4` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val4` SMALLINT NOT NULL DEFAULT '0',
+ `expire_time` INT UNSIGNED NOT NULL DEFAULT '0',
+ `bound` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `unique_id` BIGINT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ KEY `guild_id` (`guild_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `homunculus`
+--
+
+CREATE TABLE IF NOT EXISTS `homunculus` (
+ `homun_id` INT NOT NULL AUTO_INCREMENT,
+ `char_id` INT NOT NULL,
+ `class` MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
+ `prev_class` MEDIUMINT NOT NULL DEFAULT '0',
+ `name` VARCHAR(24) NOT NULL DEFAULT '',
+ `level` SMALLINT NOT NULL DEFAULT '0',
+ `exp` INT NOT NULL DEFAULT '0',
+ `intimacy` INT NOT NULL DEFAULT '0',
+ `hunger` SMALLINT NOT NULL DEFAULT '0',
+ `str` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `agi` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `vit` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `INT` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `dex` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `luk` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `hp` INT NOT NULL DEFAULT '1',
+ `max_hp` INT NOT NULL DEFAULT '1',
+ `sp` INT NOT NULL DEFAULT '1',
+ `max_sp` INT NOT NULL DEFAULT '1',
+ `skill_point` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `alive` TINYINT NOT NULL DEFAULT '1',
+ `rename_flag` TINYINT NOT NULL DEFAULT '0',
+ `vaporize` TINYINT NOT NULL DEFAULT '0',
+ `autofeed` TINYINT NOT NULL DEFAULT '0',
+ PRIMARY KEY (`homun_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `interlog`
+--
+
+CREATE TABLE IF NOT EXISTS `interlog` (
+ `time` DATETIME NULL,
+ `log` VARCHAR(255) NOT NULL DEFAULT ''
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `inventory`
+--
+
+CREATE TABLE IF NOT EXISTS `inventory` (
+ `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `char_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `nameid` INT UNSIGNED NOT NULL DEFAULT '0',
+ `amount` INT UNSIGNED NOT NULL DEFAULT '0',
+ `equip` INT UNSIGNED NOT NULL DEFAULT '0',
+ `identify` SMALLINT NOT NULL DEFAULT '0',
+ `refine` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `attribute` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `card0` INT NOT NULL DEFAULT '0',
+ `card1` INT NOT NULL DEFAULT '0',
+ `card2` INT NOT NULL DEFAULT '0',
+ `card3` INT NOT NULL DEFAULT '0',
+ `opt_idx0` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val0` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx1` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val1` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx2` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val2` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx3` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val3` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx4` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val4` SMALLINT NOT NULL DEFAULT '0',
+ `expire_time` INT UNSIGNED NOT NULL DEFAULT '0',
+ `favorite` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `bound` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `unique_id` BIGINT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ KEY `char_id` (`char_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `ipbanlist`
+--
+
+CREATE TABLE IF NOT EXISTS `ipbanlist` (
+ `list` VARCHAR(39) NOT NULL DEFAULT '',
+ `btime` DATETIME NULL,
+ `rtime` DATETIME NULL,
+ `reason` VARCHAR(255) NOT NULL DEFAULT '',
+ KEY (`list`)
+) ENGINE=InnoDB;
+
+--
+-- Table structure for table `login`
+--
+
+CREATE TABLE IF NOT EXISTS `login` (
+ `account_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `userid` VARCHAR(23) NOT NULL,
+ `user_pass` VARCHAR(32) NOT NULL DEFAULT '',
+ `sex` ENUM('M','F','S') NOT NULL DEFAULT 'M',
+ `email` VARCHAR(39) NOT NULL DEFAULT '',
+ `group_id` TINYINT NOT NULL DEFAULT '0',
+ `state` INT UNSIGNED NOT NULL DEFAULT '0',
+ `unban_time` INT UNSIGNED NOT NULL DEFAULT '0',
+ `expiration_time` INT UNSIGNED NOT NULL DEFAULT '0',
+ `logincount` MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
+ `lastlogin` DATETIME NULL,
+ `last_ip` VARCHAR(100) NOT NULL DEFAULT '',
+ `birthdate` DATE NULL,
+ `character_slots` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `pincode` VARCHAR(4) NOT NULL DEFAULT '',
+ `pincode_change` INT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`account_id`),
+ UNIQUE KEY `name` (`userid`)
+) ENGINE=MyISAM AUTO_INCREMENT=2000000;
+
+-- added standard accounts for servers, VERY INSECURE!!!
+-- inserted into the table called login which is above
+
+INSERT IGNORE INTO `login` (`account_id`, `userid`, `user_pass`, `sex`, `email`) VALUES ('1', 's1', 'p1', 'S','athena@athena.com');
+
+--
+-- Table structure for table `map_reg_num_db`
+--
+
+CREATE TABLE IF NOT EXISTS `map_reg_num_db` (
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT UNSIGNED NOT NULL DEFAULT '0',
+ `value` INT NOT NULL DEFAULT '0',
+ PRIMARY KEY (`key`, `index`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `map_reg_str_db`
+--
+
+CREATE TABLE IF NOT EXISTS `map_reg_str_db` (
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT UNSIGNED NOT NULL DEFAULT '0',
+ `value` VARCHAR(255) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`key`, `index`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `npc_market_data`
+--
+
+CREATE TABLE IF NOT EXISTS `npc_market_data` (
+ `name` VARCHAR(24) NOT NULL DEFAULT '',
+ `itemid` INT UNSIGNED NOT NULL DEFAULT '0',
+ `amount` INT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`name`,`itemid`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `sc_data`
+--
+
+CREATE TABLE IF NOT EXISTS `sc_data` (
+ `account_id` INT UNSIGNED NOT NULL,
+ `char_id` INT UNSIGNED NOT NULL,
+ `type` SMALLINT UNSIGNED NOT NULL,
+ `tick` INT NOT NULL,
+ `total_tick` INT NOT NULL,
+ `val1` INT NOT NULL DEFAULT '0',
+ `val2` INT NOT NULL DEFAULT '0',
+ `val3` INT NOT NULL DEFAULT '0',
+ `val4` INT NOT NULL DEFAULT '0',
+ KEY (`account_id`),
+ KEY (`char_id`),
+ PRIMARY KEY (`account_id`,`char_id`,`type`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `mail`
+--
+
+CREATE TABLE IF NOT EXISTS `mail` (
+ `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `send_name` VARCHAR(30) NOT NULL DEFAULT '',
+ `send_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `dest_name` VARCHAR(30) NOT NULL DEFAULT '',
+ `dest_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `title` VARCHAR(45) NOT NULL DEFAULT '',
+ `message` VARCHAR(255) NOT NULL DEFAULT '',
+ `time` INT UNSIGNED NOT NULL DEFAULT '0',
+ `status` TINYINT NOT NULL DEFAULT '0',
+ `zeny` INT UNSIGNED NOT NULL DEFAULT '0',
+ `nameid` INT UNSIGNED NOT NULL DEFAULT '0',
+ `amount` INT UNSIGNED NOT NULL DEFAULT '0',
+ `refine` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `attribute` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `identify` SMALLINT NOT NULL DEFAULT '0',
+ `card0` INT NOT NULL DEFAULT '0',
+ `card1` INT NOT NULL DEFAULT '0',
+ `card2` INT NOT NULL DEFAULT '0',
+ `card3` INT NOT NULL DEFAULT '0',
+ `opt_idx0` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val0` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx1` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val1` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx2` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val2` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx3` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val3` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx4` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val4` SMALLINT NOT NULL DEFAULT '0',
+ `unique_id` BIGINT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `memo`
+--
+
+CREATE TABLE IF NOT EXISTS `memo` (
+ `memo_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `char_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `map` VARCHAR(11) NOT NULL DEFAULT '',
+ `x` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `y` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`memo_id`),
+ KEY `char_id` (`char_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `mercenary`
+--
+
+CREATE TABLE IF NOT EXISTS `mercenary` (
+ `mer_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `char_id` INT NOT NULL,
+ `class` MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
+ `hp` INT NOT NULL DEFAULT '1',
+ `sp` INT NOT NULL DEFAULT '1',
+ `kill_counter` INT NOT NULL,
+ `life_time` INT NOT NULL DEFAULT '0',
+ PRIMARY KEY (`mer_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `mercenary_owner`
+--
+
+CREATE TABLE IF NOT EXISTS `mercenary_owner` (
+ `char_id` INT NOT NULL,
+ `merc_id` INT NOT NULL DEFAULT '0',
+ `arch_calls` INT NOT NULL DEFAULT '0',
+ `arch_faith` INT NOT NULL DEFAULT '0',
+ `spear_calls` INT NOT NULL DEFAULT '0',
+ `spear_faith` INT NOT NULL DEFAULT '0',
+ `sword_calls` INT NOT NULL DEFAULT '0',
+ `sword_faith` INT NOT NULL DEFAULT '0',
+ PRIMARY KEY (`char_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `party`
+--
+
+CREATE TABLE IF NOT EXISTS `party` (
+ `party_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `name` VARCHAR(24) NOT NULL DEFAULT '',
+ `exp` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `item` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `leader_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `leader_char` INT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`party_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `pet`
+--
+
+CREATE TABLE IF NOT EXISTS `pet` (
+ `pet_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `class` MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
+ `name` VARCHAR(24) NOT NULL DEFAULT '',
+ `account_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `char_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `level` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `egg_id` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `equip` MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
+ `intimate` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `hungry` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `rename_flag` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `incubate` INT UNSIGNED NOT NULL DEFAULT '0',
+ `autofeed` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`pet_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `quest`
+--
+
+CREATE TABLE IF NOT EXISTS `quest` (
+ `char_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `quest_id` INT UNSIGNED NOT NULL,
+ `state` ENUM('0','1','2') NOT NULL DEFAULT '0',
+ `time` INT UNSIGNED NOT NULL DEFAULT '0',
+ `count1` MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
+ `count2` INT SIGNED NOT NULL DEFAULT '0',
+ `count3` INT SIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`char_id`,`quest_id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `ragsrvinfo`
+--
+
+CREATE TABLE IF NOT EXISTS `ragsrvinfo` (
+ `index` INT NOT NULL DEFAULT '0',
+ `name` VARCHAR(255) NOT NULL DEFAULT '',
+ `exp` INT UNSIGNED NOT NULL DEFAULT '0',
+ `jexp` INT UNSIGNED NOT NULL DEFAULT '0',
+ `drop` INT UNSIGNED NOT NULL DEFAULT '0'
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `skill`
+--
+
+CREATE TABLE IF NOT EXISTS `skill` (
+ `char_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `id` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `lv` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `flag` TINYINT UNSIGNED NOT NULL DEFAULT 0,
+ PRIMARY KEY (`char_id`,`id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `skill_homunculus`
+--
+
+CREATE TABLE IF NOT EXISTS `skill_homunculus` (
+ `homun_id` INT NOT NULL,
+ `id` INT NOT NULL,
+ `lv` SMALLINT NOT NULL,
+ PRIMARY KEY (`homun_id`,`id`)
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `sql_updates`
+--
+
+CREATE TABLE IF NOT EXISTS `sql_updates` (
+ `timestamp` INT UNSIGNED NOT NULL,
+ `ignored` ENUM('Yes','No') NOT NULL DEFAULT 'No',
+ PRIMARY KEY (`timestamp`)
+) ENGINE=MyISAM;
+
+-- Existent updates to enter
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1360858500); -- 2013-02-14--16-15.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1360951560); -- 2013-02-15--18-06.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1362445531); -- 2013-03-05--01-05.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1362528000); -- 2013-03-06--00-00.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1362794218); -- 2013-03-09--01-56.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1364409316); -- 2013-03-27--18-35.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1366075474); -- 2013-04-16--01-24.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1366078541); -- 2013-04-16--02-15.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1381354728); -- 2013-10-09--21-38.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1381423003); -- 2013-10-10--16-36.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1382892428); -- 2013-10-27--16-47.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1383162785); -- 2013-10-30--19-53.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1383167577); -- 2013-10-30--21-12.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1383205740); -- 2013-10-31--07-49.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1383955424); -- 2013-11-09--00-03.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1384473995); -- 2013-11-15--00-06.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1384545461); -- 2013-11-15--19-57.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1384588175); -- 2013-11-16--07-49.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1384763034); -- 2013-11-18--08-23.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1387844126); -- 2013-12-24--00-15.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1388854043); -- 2014-01-04--16-47.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1389028967); -- 2014-01-06--17-22.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1392832626); -- 2014-02-19--17-57.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1395789302); -- 2014-03-25--23-57.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1396893866); -- 2014-04-07--22-04.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1398477600); -- 2014-04-26--10-00.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1400256139); -- 2014-05-17--00-06.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1409590380); -- 2014-09-01--16-53.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1414975503); -- 2014-11-03--00-45.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1435860840); -- 2015-07-02--18-14.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1436360978); -- 2015-07-08--13-08.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1440688342); -- 2015-08-27--20-42.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1450241859); -- 2015-12-16--12-57.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1450367880); -- 2015-12-17--15-58.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1457638175); -- 2016-03-10--22-18.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1467934919); -- 2016-07-08--02-42.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1467935469); -- 2016-07-08--02-51.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1475526420); -- 2016-10-03--20-27.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1477434595); -- 2016-10-26--10-29.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1488454834); -- 2017-03-02--11-40.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1488744559); -- 2017-03-05--08-09.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1489588190); -- 2017-03-15--14-29.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1496588640); -- 2017-06-04--15-04.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1496588700); -- 2017-06-04--15-05.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1509835214); -- 2017-11-04--10-39.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1519671456); -- 2018-02-26--15-57.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1520654809); -- 2018-03-10--04-06.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1527964800); -- 2018-06-03--00-10.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1528026381); -- 2018-06-03--17-16.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1528180320); -- 2018-06-05--12-02.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1532403228); -- 2018-07-24--03-23.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1535865732); -- 2018-09-01--05-22.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1544738447); -- 2018-12-14--01-02.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1546059075); -- 2018-12-29--07-51.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1554760320); -- 2019-04-08--21-52.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1556147483); -- 2019-04-25--02-12.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1557414445); -- 2019-05-09--18-07.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1565293394); -- 2019-08-08--19-43.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1570309293); -- 2019-10-05--19-01.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1570870260); -- 2019-10-21--14-21.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1574463539); -- 2019-11-22--23-58.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1579817630); -- 2020-01-24--01-09.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1584838560); -- 2020-03-22--01-56.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1584842940); -- 2020-03-22--03-09.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1588301040); -- 2020-05-01--04-44.sql
+INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1589145060); -- 2020-05-10--23-11.sql
+
+--
+-- Table structure for table `storage`
+--
+
+CREATE TABLE IF NOT EXISTS `storage` (
+ `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `account_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `nameid` INT UNSIGNED NOT NULL DEFAULT '0',
+ `amount` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `equip` INT UNSIGNED NOT NULL DEFAULT '0',
+ `identify` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `refine` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `attribute` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `card0` INT NOT NULL DEFAULT '0',
+ `card1` INT NOT NULL DEFAULT '0',
+ `card2` INT NOT NULL DEFAULT '0',
+ `card3` INT NOT NULL DEFAULT '0',
+ `opt_idx0` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val0` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx1` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val1` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx2` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val2` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx3` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val3` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx4` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val4` SMALLINT NOT NULL DEFAULT '0',
+ `expire_time` INT UNSIGNED NOT NULL DEFAULT '0',
+ `bound` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `unique_id` BIGINT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ KEY `account_id` (`account_id`)
+) ENGINE=MyISAM;
+
+CREATE TABLE IF NOT EXISTS `rodex_items` (
+ `id` INT NOT NULL AUTO_INCREMENT,
+ `mail_id` BIGINT NOT NULL DEFAULT '0',
+ `nameid` INT NOT NULL DEFAULT '0',
+ `amount` INT NOT NULL DEFAULT '0',
+ `equip` INT UNSIGNED NOT NULL DEFAULT '0',
+ `identify` SMALLINT NOT NULL DEFAULT '0',
+ `refine` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `attribute` TINYINT NOT NULL DEFAULT '0',
+ `card0` INT NOT NULL DEFAULT '0',
+ `card1` INT NOT NULL DEFAULT '0',
+ `card2` INT NOT NULL DEFAULT '0',
+ `card3` INT NOT NULL DEFAULT '0',
+ `opt_idx0` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val0` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx1` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val1` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx2` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val2` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx3` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val3` SMALLINT NOT NULL DEFAULT '0',
+ `opt_idx4` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val4` SMALLINT NOT NULL DEFAULT '0',
+ `expire_time` INT UNSIGNED NOT NULL DEFAULT '0',
+ `bound` TINYINT UNSIGNED NOT NULL DEFAULT '0',
+ `unique_id` BIGINT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ KEY `mail_id` (`mail_id`)
+) ENGINE=InnoDB;
+
+CREATE TABLE IF NOT EXISTS `rodex_mail` (
+ `mail_id` BIGINT NOT NULL AUTO_INCREMENT,
+ `sender_name` VARCHAR(30) NOT NULL,
+ `sender_id` INT NOT NULL,
+ `receiver_name` VARCHAR(30) NOT NULL,
+ `receiver_id` INT NOT NULL,
+ `receiver_accountid` INT NOT NULL,
+ `title` VARCHAR(50) NOT NULL,
+ `body` VARCHAR(510) NOT NULL,
+ `zeny` BIGINT NOT NULL,
+ `type` TINYINT UNSIGNED NOT NULL,
+ `is_read` TINYINT NOT NULL,
+ `sender_read` TINYINT NOT NULL,
+ `send_date` INT NOT NULL,
+ `expire_date` INT NOT NULL,
+ `weight` INT NOT NULL,
+ PRIMARY KEY (`mail_id`),
+ KEY `sender_id` (`sender_id`),
+ KEY `receiver_id` (`receiver_id`),
+ KEY `receiver_accountid` (`receiver_accountid`),
+ KEY `send_date` (`send_date`),
+ KEY `expire_date` (`expire_date`)
+) ENGINE=MyISAM;
+
+CREATE TABLE IF NOT EXISTS `npc_barter_data` (
+ `name` VARCHAR(24) NOT NULL DEFAULT '',
+ `itemId` INT UNSIGNED NOT NULL DEFAULT '0',
+ `amount` INT UNSIGNED NOT NULL DEFAULT '0',
+ `priceId` INT UNSIGNED NOT NULL DEFAULT '0',
+ `priceAmount` INT UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`name`, `itemid`, `priceId`, `priceAmount`)
+) ENGINE=MyISAM;
+
+CREATE TABLE IF NOT EXISTS `npc_expanded_barter_data` (
+ `name` VARCHAR(24) NOT NULL DEFAULT '',
+ `itemId` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `amount` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `zeny` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyId1` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount1` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine1` INT(11) NOT NULL DEFAULT '0',
+ `currencyId2` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount2` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine2` INT(11) NOT NULL DEFAULT '0',
+ `currencyId3` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount3` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine3` INT(11) NOT NULL DEFAULT '0',
+ `currencyId4` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount4` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine4` INT(11) NOT NULL DEFAULT '0',
+ `currencyId5` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount5` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine5` INT(11) NOT NULL DEFAULT '0',
+ `currencyId6` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount6` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine6` INT(11) NOT NULL DEFAULT '0',
+ `currencyId7` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount7` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine7` INT(11) NOT NULL DEFAULT '0',
+ `currencyId8` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount8` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine8` INT(11) NOT NULL DEFAULT '0',
+ `currencyId9` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount9` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine9` INT(11) NOT NULL DEFAULT '0',
+ `currencyId10` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount10` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine10` INT(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`name`, `itemid`, `zeny`,
+ `currencyId1`, `currencyAmount1`, `currencyRefine1`,
+ `currencyId2`, `currencyAmount2`, `currencyRefine2`,
+ `currencyId3`, `currencyAmount3`, `currencyRefine3`,
+ `currencyId4`, `currencyAmount4`, `currencyRefine4`
+)
+) ENGINE=MyISAM;
diff --git a/sql-files/tools/convert_engine_innodb.sql b/sql-files/tools/convert_engine_innodb.sql
new file mode 100644
index 00000000..0b727017
--- /dev/null
+++ b/sql-files/tools/convert_engine_innodb.sql
@@ -0,0 +1,56 @@
+--
+-- Hercules Database Converter
+-- MyISAM Engine -> InnoDB Engine
+--
+
+ALTER TABLE `account_data` ENGINE = InnoDB;
+ALTER TABLE `acc_reg_num_db` ENGINE = InnoDB;
+ALTER TABLE `acc_reg_str_db` ENGINE = InnoDB;
+ALTER TABLE `auction` ENGINE = InnoDB;
+ALTER TABLE `autotrade_data` ENGINE = InnoDB;
+ALTER TABLE `autotrade_merchants` ENGINE = InnoDB;
+ALTER TABLE `cart_inventory` ENGINE = InnoDB;
+ALTER TABLE `char` ENGINE = InnoDB;
+ALTER TABLE `char_reg_num_db` ENGINE = InnoDB;
+ALTER TABLE `char_reg_str_db` ENGINE = InnoDB;
+ALTER TABLE `charlog` ENGINE = InnoDB;
+ALTER TABLE `elemental` ENGINE = InnoDB;
+ALTER TABLE `friends` ENGINE = InnoDB;
+ALTER TABLE `hotkey` ENGINE = InnoDB;
+ALTER TABLE `global_acc_reg_num_db` ENGINE = InnoDB;
+ALTER TABLE `global_acc_reg_str_db` ENGINE = InnoDB;
+ALTER TABLE `guild` ENGINE = InnoDB;
+ALTER TABLE `guild_alliance` ENGINE = InnoDB;
+ALTER TABLE `guild_castle` ENGINE = InnoDB;
+ALTER TABLE `guild_expulsion` ENGINE = InnoDB;
+ALTER TABLE `guild_member` ENGINE = InnoDB;
+ALTER TABLE `guild_position` ENGINE = InnoDB;
+ALTER TABLE `guild_skill` ENGINE = InnoDB;
+ALTER TABLE `guild_storage` ENGINE = InnoDB;
+ALTER TABLE `homunculus` ENGINE = InnoDB;
+ALTER TABLE `interlog` ENGINE = InnoDB;
+ALTER TABLE `inventory` ENGINE = InnoDB;
+ALTER TABLE `ipbanlist` ENGINE = InnoDB;
+-- ALTER TABLE `item_db` ENGINE = InnoDB;
+-- ALTER TABLE `item_db2` ENGINE = InnoDB;
+ALTER TABLE `login` ENGINE = InnoDB;
+ALTER TABLE `mapreg` ENGINE = InnoDB;
+ALTER TABLE `sc_data` ENGINE = InnoDB;
+ALTER TABLE `mail` ENGINE = InnoDB;
+ALTER TABLE `memo` ENGINE = InnoDB;
+ALTER TABLE `mercenary` ENGINE = InnoDB;
+ALTER TABLE `mercenary_owner` ENGINE = InnoDB;
+-- ALTER TABLE `mob_db` ENGINE = InnoDB;
+-- ALTER TABLE `mob_db2` ENGINE = InnoDB;
+ALTER TABLE `npc_market_data` ENGINE = InnoDB;
+ALTER TABLE `party` ENGINE = InnoDB;
+ALTER TABLE `pet` ENGINE = InnoDB;
+ALTER TABLE `quest` ENGINE = InnoDB;
+ALTER TABLE `ragsrvinfo` ENGINE = InnoDB;
+ALTER TABLE `skill` ENGINE = InnoDB;
+ALTER TABLE `skill_homunculus` ENGINE = InnoDB;
+ALTER TABLE `sql_updates` ENGINE = InnoDB;
+ALTER TABLE `sstatus` ENGINE = InnoDB;
+ALTER TABLE `storage` ENGINE = InnoDB;
+ALTER TABLE `interreg` ENGINE = InnoDB;
+
diff --git a/sql-files/tools/convert_engine_myisam.sql b/sql-files/tools/convert_engine_myisam.sql
new file mode 100644
index 00000000..e8703713
--- /dev/null
+++ b/sql-files/tools/convert_engine_myisam.sql
@@ -0,0 +1,56 @@
+--
+-- Hercules Database Converter
+-- InnoDB Engine -> MyISAM Engine
+--
+
+ALTER TABLE `account_data` ENGINE = MyISAM;
+ALTER TABLE `acc_reg_num_db` ENGINE = MyISAM;
+ALTER TABLE `acc_reg_str_db` ENGINE = MyISAM;
+ALTER TABLE `auction` ENGINE = MyISAM;
+ALTER TABLE `autotrade_data` ENGINE = MyISAM;
+ALTER TABLE `autotrade_merchants` ENGINE = MyISAM;
+ALTER TABLE `cart_inventory` ENGINE = MyISAM;
+ALTER TABLE `char` ENGINE = MyISAM;
+ALTER TABLE `char_reg_num_db` ENGINE = MyISAM;
+ALTER TABLE `char_reg_str_db` ENGINE = MyISAM;
+ALTER TABLE `charlog` ENGINE = MyISAM;
+ALTER TABLE `elemental` ENGINE = MyISAM;
+ALTER TABLE `friends` ENGINE = MyISAM;
+ALTER TABLE `hotkey` ENGINE = MyISAM;
+ALTER TABLE `global_acc_reg_num_db` ENGINE = MyISAM;
+ALTER TABLE `global_acc_reg_str_db` ENGINE = MyISAM;
+ALTER TABLE `guild` ENGINE = MyISAM;
+ALTER TABLE `guild_alliance` ENGINE = MyISAM;
+ALTER TABLE `guild_castle` ENGINE = MyISAM;
+ALTER TABLE `guild_expulsion` ENGINE = MyISAM;
+ALTER TABLE `guild_member` ENGINE = MyISAM;
+ALTER TABLE `guild_position` ENGINE = MyISAM;
+ALTER TABLE `guild_skill` ENGINE = MyISAM;
+ALTER TABLE `guild_storage` ENGINE = MyISAM;
+ALTER TABLE `homunculus` ENGINE = MyISAM;
+ALTER TABLE `interlog` ENGINE = MyISAM;
+ALTER TABLE `inventory` ENGINE = MyISAM;
+ALTER TABLE `ipbanlist` ENGINE = MyISAM;
+-- ALTER TABLE `item_db` ENGINE = MyISAM;
+-- ALTER TABLE `item_db2` ENGINE = MyISAM;
+ALTER TABLE `login` ENGINE = MyISAM;
+ALTER TABLE `mapreg` ENGINE = MyISAM;
+ALTER TABLE `sc_data` ENGINE = MyISAM;
+ALTER TABLE `mail` ENGINE = MyISAM;
+ALTER TABLE `memo` ENGINE = MyISAM;
+ALTER TABLE `mercenary` ENGINE = MyISAM;
+ALTER TABLE `mercenary_owner` ENGINE = MyISAM;
+-- ALTER TABLE `mob_db` ENGINE = MyISAM;
+-- ALTER TABLE `mob_db2` ENGINE = MyISAM;
+ALTER TABLE `npc_market_data` ENGINE = MyISAM;
+ALTER TABLE `party` ENGINE = MyISAM;
+ALTER TABLE `pet` ENGINE = MyISAM;
+ALTER TABLE `quest` ENGINE = MyISAM;
+ALTER TABLE `ragsrvinfo` ENGINE = MyISAM;
+ALTER TABLE `skill` ENGINE = MyISAM;
+ALTER TABLE `skill_homunculus` ENGINE = MyISAM;
+ALTER TABLE `sql_updates` ENGINE = MyISAM;
+ALTER TABLE `sstatus` ENGINE = MyISAM;
+ALTER TABLE `storage` ENGINE = MyISAM;
+ALTER TABLE `interreg` ENGINE = MyISAM;
+
diff --git a/sql-files/tools/convert_passwords.sql b/sql-files/tools/convert_passwords.sql
new file mode 100644
index 00000000..9ee35e13
--- /dev/null
+++ b/sql-files/tools/convert_passwords.sql
@@ -0,0 +1,3 @@
+-- Convert passwords to MD5 Hash
+
+UPDATE `login` SET `user_pass`=MD5(`user_pass`);
diff --git a/sql-files/upgrades/2013-02-14--16-15.sql b/sql-files/upgrades/2013-02-14--16-15.sql
new file mode 100644
index 00000000..b7db70d4
--- /dev/null
+++ b/sql-files/upgrades/2013-02-14--16-15.sql
@@ -0,0 +1,7 @@
+#1360858500
+CREATE TABLE IF NOT EXISTS `sql_updates` (
+ `timestamp` INT(11) UNSIGNED NOT NULL,
+ `ignored` ENUM('Yes','No') NOT NULL DEFAULT 'No'
+) ENGINE=MyISAM;
+ALTER TABLE `skill` ADD COLUMN `flag` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1360858500);
diff --git a/sql-files/upgrades/2013-02-15--18-06.sql b/sql-files/upgrades/2013-02-15--18-06.sql
new file mode 100644
index 00000000..efb0b2ad
--- /dev/null
+++ b/sql-files/upgrades/2013-02-15--18-06.sql
@@ -0,0 +1,3 @@
+#1360951560
+ALTER TABLE `sql_updates` ADD PRIMARY KEY (`timestamp`);
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1360951560);
diff --git a/sql-files/upgrades/2013-03-05--01-05.sql b/sql-files/upgrades/2013-03-05--01-05.sql
new file mode 100644
index 00000000..b1a0e402
--- /dev/null
+++ b/sql-files/upgrades/2013-03-05--01-05.sql
@@ -0,0 +1,3 @@
+#1362445531
+ALTER TABLE `login` ADD `character_slots` TINYINT(3) UNSIGNED NOT NULL;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1362445531);
diff --git a/sql-files/upgrades/2013-03-06--00-00.sql b/sql-files/upgrades/2013-03-06--00-00.sql
new file mode 100644
index 00000000..8d46be76
--- /dev/null
+++ b/sql-files/upgrades/2013-03-06--00-00.sql
@@ -0,0 +1,9 @@
+#1362528000
+-- This script resets all dewata quests that were done by your users before this revision
+-- Author: Euphy
+DELETE FROM `quest` WHERE `quest_id` > 5034 AND `quest_id` < 5055;
+DELETE FROM `quest` WHERE `quest_id` > 9154 AND `quest_id` < 9166;
+DELETE FROM `global_reg_value` WHERE `str` = 'dewata_gatti';
+DELETE FROM `global_reg_value` WHERE `str` = 'dewata_legend';
+DELETE FROM `global_reg_value` WHERE `str` = 'dewata_oldman';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1362528000);
diff --git a/sql-files/upgrades/2013-03-09--01-56.sql b/sql-files/upgrades/2013-03-09--01-56.sql
new file mode 100644
index 00000000..6edfa79c
--- /dev/null
+++ b/sql-files/upgrades/2013-03-09--01-56.sql
@@ -0,0 +1,4 @@
+#1362794218
+ALTER TABLE `login` ADD COLUMN `pincode` VARCHAR(4) NOT NULL DEFAULT '';
+ALTER TABLE `login` ADD COLUMN `pincode_change` INT(11) unsigned NOT NULL DEFAULT '0';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1362794218);
diff --git a/sql-files/upgrades/2013-03-27--18-35.sql b/sql-files/upgrades/2013-03-27--18-35.sql
new file mode 100644
index 00000000..323aa2ac
--- /dev/null
+++ b/sql-files/upgrades/2013-03-27--18-35.sql
@@ -0,0 +1,3 @@
+#1364409316
+ALTER TABLE `char` ADD COLUMN `slotchange` SMALLINT(3) unsigned NOT NULL default '0';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1364409316);
diff --git a/sql-files/upgrades/2013-04-16--01-24.sql b/sql-files/upgrades/2013-04-16--01-24.sql
new file mode 100644
index 00000000..951ca8cd
--- /dev/null
+++ b/sql-files/upgrades/2013-04-16--01-24.sql
@@ -0,0 +1,3 @@
+#1366075474
+-- Info http://herc.ws/board/topic/410-skill-script-command-updatefix/
+UPDATE `skill` SET `flag` = 0 WHERE `flag` = 4 AND `id` != 2535 AND `id` != 681;
diff --git a/sql-files/upgrades/2013-04-16--02-15.sql b/sql-files/upgrades/2013-04-16--02-15.sql
new file mode 100644
index 00000000..458d1dc3
--- /dev/null
+++ b/sql-files/upgrades/2013-04-16--02-15.sql
@@ -0,0 +1,4 @@
+#1366078541
+ALTER TABLE `char` ADD `char_opt` INT(11) UNSIGNED NOT NULL DEFAULT '0';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1366075474); -- for the previous that missed it..
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1366078541);
diff --git a/sql-files/upgrades/2013-10-09--21-38.sql b/sql-files/upgrades/2013-10-09--21-38.sql
new file mode 100644
index 00000000..d8854bcd
--- /dev/null
+++ b/sql-files/upgrades/2013-10-09--21-38.sql
@@ -0,0 +1,3 @@
+#1381354728
+ALTER TABLE `zenylog` MODIFY `type` ENUM('T','V','P','M','S','N','D','C','A','E','I','B','K') NOT NULL DEFAULT 'S';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1381354728);
diff --git a/sql-files/upgrades/2013-10-10--16-36.sql b/sql-files/upgrades/2013-10-10--16-36.sql
new file mode 100644
index 00000000..88db7609
--- /dev/null
+++ b/sql-files/upgrades/2013-10-10--16-36.sql
@@ -0,0 +1,7 @@
+#1381423003
+CREATE TABLE IF NOT EXISTS `account_data` (
+ `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `bank_vault` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`account_id`)
+) ENGINE=MyISAM;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1381423003);
diff --git a/sql-files/upgrades/2013-10-27--16-47.sql b/sql-files/upgrades/2013-10-27--16-47.sql
new file mode 100644
index 00000000..2a9a73f3
--- /dev/null
+++ b/sql-files/upgrades/2013-10-27--16-47.sql
@@ -0,0 +1,6 @@
+#1382892428
+ALTER TABLE `inventory` MODIFY `equip` INT(11) UNSIGNED NOT NULL DEFAULT '0';
+ALTER TABLE `storage` MODIFY `equip` INT(11) UNSIGNED NOT NULL DEFAULT '0';
+ALTER TABLE `cart_inventory` MODIFY `equip` INT(11) UNSIGNED NOT NULL DEFAULT '0';
+ALTER TABLE `guild_storage` MODIFY `equip` INT(11) UNSIGNED NOT NULL DEFAULT '0';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1382892428);
diff --git a/sql-files/upgrades/2013-10-30--19-53.sql b/sql-files/upgrades/2013-10-30--19-53.sql
new file mode 100644
index 00000000..6e89015e
--- /dev/null
+++ b/sql-files/upgrades/2013-10-30--19-53.sql
@@ -0,0 +1,5 @@
+#1383162785
+ALTER TABLE `account_data` ADD `base_exp` TINYINT(4) UNSIGNED NOT NULL DEFAULT '100';
+ALTER TABLE `account_data` ADD `base_drop` TINYINT(4) UNSIGNED NOT NULL DEFAULT '100';
+ALTER TABLE `account_data` ADD `base_death` TINYINT(4) UNSIGNED NOT NULL DEFAULT '100';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1383162785);
diff --git a/sql-files/upgrades/2013-10-30--21-12.sql b/sql-files/upgrades/2013-10-30--21-12.sql
new file mode 100644
index 00000000..e0fbda87
--- /dev/null
+++ b/sql-files/upgrades/2013-10-30--21-12.sql
@@ -0,0 +1,3 @@
+#1383167577
+ALTER TABLE `char` ADD `font` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1383167577);
diff --git a/sql-files/upgrades/2013-10-31--07-49.sql b/sql-files/upgrades/2013-10-31--07-49.sql
new file mode 100644
index 00000000..25f489f5
--- /dev/null
+++ b/sql-files/upgrades/2013-10-31--07-49.sql
@@ -0,0 +1,6 @@
+#1383205740
+ALTER TABLE `inventory` ADD COLUMN `bound` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `favorite`;
+ALTER TABLE `cart_inventory` ADD COLUMN `bound` TINYINT(1) UNSIGNED NOT NULL default '0' AFTER `expire_time`;
+ALTER TABLE `storage` ADD COLUMN `bound` TINYINT(1) UNSIGNED NOT NULL default '0' AFTER `expire_time`;
+ALTER TABLE `guild_storage` ADD COLUMN `bound` TINYINT(1) UNSIGNED NOT NULL default '0' AFTER `expire_time`;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1383205740);
diff --git a/sql-files/upgrades/2013-11-09--00-03.sql b/sql-files/upgrades/2013-11-09--00-03.sql
new file mode 100644
index 00000000..92fe1b76
--- /dev/null
+++ b/sql-files/upgrades/2013-11-09--00-03.sql
@@ -0,0 +1,5 @@
+#1383955424
+ALTER TABLE `account_data` MODIFY `base_exp` TINYINT(4) UNSIGNED NOT NULL DEFAULT '100';
+ALTER TABLE `account_data` MODIFY `base_drop` TINYINT(4) UNSIGNED NOT NULL DEFAULT '100';
+ALTER TABLE `account_data` MODIFY `base_death` TINYINT(4) UNSIGNED NOT NULL DEFAULT '100';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1383955424);
diff --git a/sql-files/upgrades/2013-11-15--00-06.sql b/sql-files/upgrades/2013-11-15--00-06.sql
new file mode 100644
index 00000000..dafc5615
--- /dev/null
+++ b/sql-files/upgrades/2013-11-15--00-06.sql
@@ -0,0 +1,105 @@
+#1384473995
+
+-- Note: If you're running a MySQL version earlier than 5.0 (or if this scripts fails for you for any reason)
+-- you'll need to run the following queries manually:
+--
+-- [ Pre-Renewal only ]
+-- ALTER TABLE item_db2 ADD COLUMN `matk` SMALLINT(5) UNSIGNED DEFAULT NULL AFTER atk;
+-- ALTER TABLE item_db2 CHANGE COLUMN `equip_level` `equip_level_min` SMALLINT(5) UNSIGNED DEFAULT NULL;
+-- ALTER TABLE item_db2 ADD COLUMN `equip_level_max` SMALLINT(5) UNSIGNED DEFAULT NULL AFTER equip_level_min;
+-- [ Both Pre-Renewal and Renewal ]
+-- ALTER TABLE item_db2 MODIFY COLUMN `price_buy` MEDIUMINT(10) DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `price_sell` MEDIUMINT(10) DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `weight` SMALLINT(5) UNSIGNED DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `atk` SMALLINT(5) UNSIGNED DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `matk` SMALLINT(5) UNSIGNED DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `defence` SMALLINT(5) UNSIGNED DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `range` TINYINT(2) UNSIGNED DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `slots` TINYINT(2) UNSIGNED DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `equip_jobs` INT(12) UNSIGNED DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `equip_upper` TINYINT(8) UNSIGNED DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `equip_genders` TINYINT(2) UNSIGNED DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `equip_locations` SMALLINT(4) UNSIGNED DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `weapon_level` TINYINT(2) UNSIGNED DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `equip_level_min` SMALLINT(5) UNSIGNED DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `equip_level_max` SMALLINT(5) UNSIGNED DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `refineable` TINYINT(1) UNSIGNED DEFAULT NULL;
+-- ALTER TABLE item_db2 MODIFY COLUMN `view` SMALLINT(3) UNSIGNED DEFAULT NULL;
+-- INSERT INTO `sql_updates` (`timestamp`) VALUES (1384473995);
+--
+-- [ End ]
+-- What follows is the automated script that does all of the above.
+
+DELIMITER $$
+
+DROP PROCEDURE IF EXISTS alter_if_not_exists $$
+DROP PROCEDURE IF EXISTS alter_if_exists $$
+
+CREATE PROCEDURE alter_if_not_exists(my_table TINYTEXT, my_column TINYTEXT, my_command TINYTEXT, my_predicate TEXT)
+BEGIN
+ set @dbname = DATABASE();
+ IF EXISTS (
+ SELECT * FROM information_schema.TABLES
+ WHERE TABLE_SCHEMA = @dbname
+ AND TABLE_NAME = my_table
+ ) AND NOT EXISTS (
+ SELECT * FROM information_schema.COLUMNS
+ WHERE TABLE_SCHEMA = @dbname
+ AND TABLE_NAME = my_table
+ AND COLUMN_NAME = my_column
+ )
+ THEN
+ SET @q = CONCAT('ALTER TABLE ', @dbname, '.', my_table, ' ',
+ my_command, ' `', my_column, '` ', my_predicate);
+ PREPARE STMT FROM @q;
+ EXECUTE STMT;
+ END IF;
+
+END $$
+
+CREATE PROCEDURE alter_if_exists(my_table TINYTEXT, my_column TINYTEXT, my_command TINYTEXT, my_predicate TEXT)
+BEGIN
+ set @dbname = DATABASE();
+ IF EXISTS (
+ SELECT * FROM information_schema.COLUMNS
+ WHERE TABLE_SCHEMA = @dbname
+ AND TABLE_NAME = my_table
+ AND COLUMN_NAME = my_column
+ )
+ THEN
+ SET @q = CONCAT('ALTER TABLE ', @dbname, '.', my_table, ' ',
+ my_command, ' `', my_column, '` ', my_predicate);
+ PREPARE STMT FROM @q;
+ EXECUTE STMT;
+ END IF;
+
+END $$
+
+CALL alter_if_not_exists('item_db2', 'matk', 'ADD COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL AFTER atk') $$
+CALL alter_if_exists('item_db2', 'equip_level', 'CHANGE COLUMN', 'equip_level_min SMALLINT(5) UNSIGNED DEFAULT NULL') $$
+CALL alter_if_not_exists('item_db2', 'equip_level_max', 'ADD COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL AFTER equip_level_min') $$
+
+CALL alter_if_exists('item_db2', 'price_buy', 'MODIFY COLUMN', 'MEDIUMINT(10) DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'price_sell', 'MODIFY COLUMN', 'MEDIUMINT(10) DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'weight', 'MODIFY COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'atk', 'MODIFY COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'matk', 'MODIFY COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'defence', 'MODIFY COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'range', 'MODIFY COLUMN', 'TINYINT(2) UNSIGNED DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'slots', 'MODIFY COLUMN', 'TINYINT(2) UNSIGNED DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'equip_jobs', 'MODIFY COLUMN', 'INT(12) UNSIGNED DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'equip_upper', 'MODIFY COLUMN', 'TINYINT(8) UNSIGNED DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'equip_genders', 'MODIFY COLUMN', 'TINYINT(2) UNSIGNED DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'equip_locations', 'MODIFY COLUMN', 'SMALLINT(4) UNSIGNED DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'weapon_level', 'MODIFY COLUMN', 'TINYINT(2) UNSIGNED DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'equip_level_min', 'MODIFY COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'equip_level_max', 'MODIFY COLUMN', 'SMALLINT(5) UNSIGNED DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'refineable', 'MODIFY COLUMN', 'TINYINT(1) UNSIGNED DEFAULT NULL') $$
+CALL alter_if_exists('item_db2', 'view', 'MODIFY COLUMN', 'SMALLINT(3) UNSIGNED DEFAULT NULL') $$
+
+DROP PROCEDURE IF EXISTS alter_if_not_exists $$
+DROP PROCEDURE IF EXISTS alter_if_exists $$
+
+DELIMITER ';'
+
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1384473995);
diff --git a/sql-files/upgrades/2013-11-15--19-57.sql b/sql-files/upgrades/2013-11-15--19-57.sql
new file mode 100644
index 00000000..d4d8ec50
--- /dev/null
+++ b/sql-files/upgrades/2013-11-15--19-57.sql
@@ -0,0 +1,5 @@
+#1384545461
+UPDATE `account_data` SET `base_exp` = '100' WHERE `base_exp` = '0';
+UPDATE `account_data` SET `base_drop` = '100' WHERE `base_drop` = '0';
+UPDATE `account_data` SET `base_death` = '100' WHERE `base_death` = '0';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1384545461);
diff --git a/sql-files/upgrades/2013-11-16--07-49.sql b/sql-files/upgrades/2013-11-16--07-49.sql
new file mode 100644
index 00000000..fce74aab
--- /dev/null
+++ b/sql-files/upgrades/2013-11-16--07-49.sql
@@ -0,0 +1,3 @@
+#1384588175
+ALTER TABLE `char` ADD COLUMN `unban_time` INT(11) UNSIGNED NOT NULL DEFAULT '0';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1384588175);
diff --git a/sql-files/upgrades/2013-11-18--08-23.sql b/sql-files/upgrades/2013-11-18--08-23.sql
new file mode 100644
index 00000000..d7100d78
--- /dev/null
+++ b/sql-files/upgrades/2013-11-18--08-23.sql
@@ -0,0 +1,65 @@
+#1384763034
+
+-- Note: If you're running a MySQL version earlier than 5.0 (or if this scripts fails for you for any reason)
+-- you'll need to run the following queries manually:
+--
+-- [ Both Pre-Renewal and Renewal ]
+-- ALTER TABLE item_db2 ADD COLUMN `bindonequip` TINYINT(1) UNSIGNED DEFAULT NULL AFTER `view`;
+-- INSERT INTO `sql_updates` (`timestamp`) VALUES (1384763034);
+--
+-- [ End ]
+-- What follows is the automated script that does all of the above.
+
+DELIMITER $$
+
+DROP PROCEDURE IF EXISTS alter_if_not_exists $$
+DROP PROCEDURE IF EXISTS alter_if_exists $$
+
+CREATE PROCEDURE alter_if_not_exists(my_table TINYTEXT, my_column TINYTEXT, my_command TINYTEXT, my_predicate TEXT)
+BEGIN
+ set @dbname = DATABASE();
+ IF EXISTS (
+ SELECT * FROM information_schema.TABLES
+ WHERE TABLE_SCHEMA = @dbname
+ AND TABLE_NAME = my_table
+ ) AND NOT EXISTS (
+ SELECT * FROM information_schema.COLUMNS
+ WHERE TABLE_SCHEMA = @dbname
+ AND TABLE_NAME = my_table
+ AND COLUMN_NAME = my_column
+ )
+ THEN
+ SET @q = CONCAT('ALTER TABLE ', @dbname, '.', my_table, ' ',
+ my_command, ' `', my_column, '` ', my_predicate);
+ PREPARE STMT FROM @q;
+ EXECUTE STMT;
+ END IF;
+
+END $$
+
+CREATE PROCEDURE alter_if_exists(my_table TINYTEXT, my_column TINYTEXT, my_command TINYTEXT, my_predicate TEXT)
+BEGIN
+ set @dbname = DATABASE();
+ IF EXISTS (
+ SELECT * FROM information_schema.COLUMNS
+ WHERE TABLE_SCHEMA = @dbname
+ AND TABLE_NAME = my_table
+ AND COLUMN_NAME = my_column
+ )
+ THEN
+ SET @q = CONCAT('ALTER TABLE ', @dbname, '.', my_table, ' ',
+ my_command, ' `', my_column, '` ', my_predicate);
+ PREPARE STMT FROM @q;
+ EXECUTE STMT;
+ END IF;
+
+END $$
+
+CALL alter_if_not_exists('item_db2', 'bindonequip', 'ADD COLUMN', 'TINYINT(1) UNSIGNED DEFAULT NULL AFTER `view`') $$
+
+DROP PROCEDURE IF EXISTS alter_if_not_exists $$
+DROP PROCEDURE IF EXISTS alter_if_exists $$
+
+DELIMITER ';'
+
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1384763034);
diff --git a/sql-files/upgrades/2013-12-24--00-15.sql b/sql-files/upgrades/2013-12-24--00-15.sql
new file mode 100644
index 00000000..2de4771a
--- /dev/null
+++ b/sql-files/upgrades/2013-12-24--00-15.sql
@@ -0,0 +1,8 @@
+#1387844126
+CREATE TABLE IF NOT EXISTS `npc_market_data` (
+ `name` VARCHAR(24) NOT NULL DEFAULT '',
+ `itemid` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `amount` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`name`,`itemid`)
+) ENGINE=MyISAM;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1387844126);
diff --git a/sql-files/upgrades/2014-01-04--16-47.sql b/sql-files/upgrades/2014-01-04--16-47.sql
new file mode 100644
index 00000000..40be437d
--- /dev/null
+++ b/sql-files/upgrades/2014-01-04--16-47.sql
@@ -0,0 +1,61 @@
+#1388854043
+ALTER TABLE `mapreg` ADD PRIMARY KEY (`varname`, `index`);
+ALTER TABLE `mapreg` DROP INDEX `varname`;
+ALTER TABLE `mapreg` DROP INDEX `index`;
+ALTER TABLE `mapreg` MODIFY `varname` VARCHAR(32) BINARY NOT NULL;
+CREATE TABLE IF NOT EXISTS `acc_reg_num_db` (
+ `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `value` INT(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`account_id`,`key`,`index`),
+ KEY `account_id` (`account_id`)
+) ENGINE=MyISAM;
+CREATE TABLE IF NOT EXISTS `acc_reg_str_db` (
+ `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `value` VARCHAR(254) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`account_id`,`key`,`index`),
+ KEY `account_id` (`account_id`)
+) ENGINE=MyISAM;
+CREATE TABLE IF NOT EXISTS `char_reg_num_db` (
+ `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `value` INT(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`char_id`,`key`,`index`),
+ KEY `char_id` (`char_id`)
+) ENGINE=MyISAM;
+CREATE TABLE IF NOT EXISTS `char_reg_str_db` (
+ `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `value` VARCHAR(254) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`char_id`,`key`,`index`),
+ KEY `char_id` (`char_id`)
+) ENGINE=MyISAM;
+CREATE TABLE IF NOT EXISTS `global_acc_reg_num_db` (
+ `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `value` INT(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`account_id`,`key`,`index`),
+ KEY `account_id` (`account_id`)
+) ENGINE=MyISAM;
+CREATE TABLE IF NOT EXISTS `global_acc_reg_str_db` (
+ `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `value` VARCHAR(254) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`account_id`,`key`,`index`),
+ KEY `account_id` (`account_id`)
+) ENGINE=MyISAM;
+INSERT INTO `acc_reg_num_db` (`account_id`, `key`, `index`, `value`) SELECT `account_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 2 AND `str` NOT LIKE '%$';
+INSERT INTO `acc_reg_str_db` (`account_id`, `key`, `index`, `value`) SELECT `account_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 2 AND `str` LIKE '%$';
+INSERT INTO `char_reg_num_db` (`char_id`, `key`, `index`, `value`) SELECT `char_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 3 AND `str` NOT LIKE '%$';
+INSERT INTO `char_reg_str_db` (`char_id`, `key`, `index`, `value`) SELECT `char_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 3 AND `str` LIKE '%$';
+INSERT INTO `global_acc_reg_num_db` (`account_id`, `key`, `index`, `value`) SELECT `account_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 1 AND `str` NOT LIKE '%$';
+INSERT INTO `global_acc_reg_str_db` (`account_id`, `key`, `index`, `value`) SELECT `account_id`, `str`, 0, `value` FROM `global_reg_value` WHERE `type` = 1 AND `str` LIKE '%$';
+# DROP TABLE `global_reg_value`;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1388854043);
diff --git a/sql-files/upgrades/2014-01-06--17-22.sql b/sql-files/upgrades/2014-01-06--17-22.sql
new file mode 100644
index 00000000..e3ca8935
--- /dev/null
+++ b/sql-files/upgrades/2014-01-06--17-22.sql
@@ -0,0 +1,16 @@
+#1389028967
+CREATE TABLE IF NOT EXISTS `autotrade_merchants` (
+ `account_id` INT(11) NOT NULL DEFAULT '0',
+ `char_id` INT(11) NOT NULL DEFAULT '0',
+ `sex` TINYINT(2) NOT NULL DEFAULT '0',
+ `title` varchar(80) NOT NULL DEFAULT 'Buy From Me!',
+ PRIMARY KEY (`account_id`,`char_id`)
+) ENGINE=MyISAM;
+CREATE TABLE IF NOT EXISTS `autotrade_data` (
+ `char_id` INT(11) NOT NULL DEFAULT '0',
+ `itemkey` INT(11) NOT NULL DEFAULT '0',
+ `amount` INT(11) NOT NULL DEFAULT '0',
+ `price` INT(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`char_id`,`itemkey`)
+) ENGINE=MyISAM;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1389028967);
diff --git a/sql-files/upgrades/2014-02-19--17-57.sql b/sql-files/upgrades/2014-02-19--17-57.sql
new file mode 100644
index 00000000..63abc335
--- /dev/null
+++ b/sql-files/upgrades/2014-02-19--17-57.sql
@@ -0,0 +1,4 @@
+#1392832626
+DELETE FROM `sc_data` WHERE `tick` = '-1';
+ALTER TABLE `sc_data` ADD PRIMARY KEY (`account_id`,`char_id`,`type`);
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1392832626);
diff --git a/sql-files/upgrades/2014-03-25--23-57.sql b/sql-files/upgrades/2014-03-25--23-57.sql
new file mode 100644
index 00000000..40d3fb2f
--- /dev/null
+++ b/sql-files/upgrades/2014-03-25--23-57.sql
@@ -0,0 +1,3 @@
+#1395789302
+ALTER TABLE `charlog` ADD COLUMN `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `account_id`;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1395789302);
diff --git a/sql-files/upgrades/2014-04-07--22-04.sql b/sql-files/upgrades/2014-04-07--22-04.sql
new file mode 100644
index 00000000..56c54eac
--- /dev/null
+++ b/sql-files/upgrades/2014-04-07--22-04.sql
@@ -0,0 +1,3 @@
+#1396893866
+ALTER TABLE `char` ADD COLUMN `uniqueitem_counter` BIGINT(20) NOT NULL AFTER `unban_time`;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1396893866);
diff --git a/sql-files/upgrades/2014-04-26--10-00.sql b/sql-files/upgrades/2014-04-26--10-00.sql
new file mode 100644
index 00000000..0c0b571e
--- /dev/null
+++ b/sql-files/upgrades/2014-04-26--10-00.sql
@@ -0,0 +1,3 @@
+#1398477600
+ALTER TABLE `char` CHANGE COLUMN `uniqueitem_counter` `uniqueitem_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1398477600);
diff --git a/sql-files/upgrades/2014-05-17--00-06.sql b/sql-files/upgrades/2014-05-17--00-06.sql
new file mode 100644
index 00000000..4e5d0d32
--- /dev/null
+++ b/sql-files/upgrades/2014-05-17--00-06.sql
@@ -0,0 +1,3 @@
+#1400256139
+ALTER TABLE `pet` CHANGE `incuvate` `incubate` int(11) unsigned NOT NULL default '0';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1400256139);
diff --git a/sql-files/upgrades/2014-09-01--16-53.sql b/sql-files/upgrades/2014-09-01--16-53.sql
new file mode 100644
index 00000000..9827c002
--- /dev/null
+++ b/sql-files/upgrades/2014-09-01--16-53.sql
@@ -0,0 +1,5 @@
+#1409590380
+ALTER TABLE `account_data` CHANGE `base_exp` `base_exp` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '100',
+CHANGE `base_drop` `base_drop` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '100',
+CHANGE `base_death` `base_death` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '100';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1409590380);
diff --git a/sql-files/upgrades/2014-11-03--00-45.sql b/sql-files/upgrades/2014-11-03--00-45.sql
new file mode 100644
index 00000000..19d0a8ff
--- /dev/null
+++ b/sql-files/upgrades/2014-11-03--00-45.sql
@@ -0,0 +1,3 @@
+#1414975503
+ALTER TABLE `char` ADD COLUMN `sex` ENUM('M','F','U') NOT NULL DEFAULT 'U';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1414975503);
diff --git a/sql-files/upgrades/2015-07-02--18-14.sql b/sql-files/upgrades/2015-07-02--18-14.sql
new file mode 100644
index 00000000..68a02e30
--- /dev/null
+++ b/sql-files/upgrades/2015-07-02--18-14.sql
@@ -0,0 +1,74 @@
+#1435860840
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2015-2020 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+DELIMITER $$
+
+DROP PROCEDURE IF EXISTS alter_if_not_exists $$
+DROP PROCEDURE IF EXISTS alter_if_exists $$
+
+CREATE PROCEDURE alter_if_not_exists(my_table TINYTEXT, my_column TINYTEXT, my_command TINYTEXT, my_predicate TEXT)
+BEGIN
+ set @dbname = DATABASE();
+ IF EXISTS (
+ SELECT * FROM information_schema.TABLES
+ WHERE TABLE_SCHEMA = @dbname
+ AND TABLE_NAME = my_table
+ ) AND NOT EXISTS (
+ SELECT * FROM information_schema.COLUMNS
+ WHERE TABLE_SCHEMA = @dbname
+ AND TABLE_NAME = my_table
+ AND COLUMN_NAME = my_column
+ )
+ THEN
+ SET @q = CONCAT('ALTER TABLE ', @dbname, '.', my_table, ' ',
+ my_command, ' `', my_column, '` ', my_predicate);
+ PREPARE STMT FROM @q;
+ EXECUTE STMT;
+ END IF;
+
+END $$
+
+CREATE PROCEDURE alter_if_exists(my_table TINYTEXT, my_column TINYTEXT, my_command TINYTEXT, my_predicate TEXT)
+BEGIN
+ set @dbname = DATABASE();
+ IF EXISTS (
+ SELECT * FROM information_schema.COLUMNS
+ WHERE TABLE_SCHEMA = @dbname
+ AND TABLE_NAME = my_table
+ AND COLUMN_NAME = my_column
+ )
+ THEN
+ SET @q = CONCAT('ALTER TABLE ', @dbname, '.', my_table, ' ',
+ my_command, ' `', my_column, '` ', my_predicate);
+ PREPARE STMT FROM @q;
+ EXECUTE STMT;
+ END IF;
+
+END $$
+
+CALL alter_if_not_exists('item_db', 'forceserial', 'ADD COLUMN', 'TINYINT(1) UNSIGNED DEFAULT NULL AFTER `bindonequip`') $$
+CALL alter_if_not_exists('item_db2', 'forceserial', 'ADD COLUMN', 'TINYINT(1) UNSIGNED DEFAULT NULL AFTER `bindonequip`') $$
+
+DROP PROCEDURE IF EXISTS alter_if_not_exists $$
+DROP PROCEDURE IF EXISTS alter_if_exists $$
+
+DELIMITER ';'
+
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1435860840);
diff --git a/sql-files/upgrades/2015-07-08--13-08.sql b/sql-files/upgrades/2015-07-08--13-08.sql
new file mode 100644
index 00000000..4d720858
--- /dev/null
+++ b/sql-files/upgrades/2015-07-08--13-08.sql
@@ -0,0 +1,6 @@
+#1436360978
+
+DROP TABLE IF EXISTS interreg;
+DROP TABLE IF EXISTS sstatus;
+
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1436360978);
diff --git a/sql-files/upgrades/2015-08-27--20-42.sql b/sql-files/upgrades/2015-08-27--20-42.sql
new file mode 100644
index 00000000..e95e1836
--- /dev/null
+++ b/sql-files/upgrades/2015-08-27--20-42.sql
@@ -0,0 +1,3 @@
+#1440688342
+ALTER TABLE `char` ADD COLUMN `hotkey_rowshift` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1440688342);
diff --git a/sql-files/upgrades/2015-12-16--12-57.sql b/sql-files/upgrades/2015-12-16--12-57.sql
new file mode 100644
index 00000000..cc9ce799
--- /dev/null
+++ b/sql-files/upgrades/2015-12-16--12-57.sql
@@ -0,0 +1,26 @@
+#1450241859
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2015-2016 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `char` MODIFY COLUMN `max_hp` INT(9) NOT NULL DEFAULT '0';
+ALTER TABLE `char` MODIFY COLUMN `max_sp` INT(9) NOT NULL DEFAULT '0';
+ALTER TABLE `char` MODIFY COLUMN `hp` INT(9) NOT NULL DEFAULT '0';
+ALTER TABLE `char` MODIFY COLUMN `sp` INT(9) NOT NULL DEFAULT '0';
+
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1450241859);
diff --git a/sql-files/upgrades/2015-12-17--15-58.sql b/sql-files/upgrades/2015-12-17--15-58.sql
new file mode 100644
index 00000000..8d3dc51a
--- /dev/null
+++ b/sql-files/upgrades/2015-12-17--15-58.sql
@@ -0,0 +1,22 @@
+#1450367880
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2015 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `char` ADD `body` smallint(5) unsigned NOT NULL default '0' AFTER `clothes_color`;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1450367880);
diff --git a/sql-files/upgrades/2016-03-10--22-18.sql b/sql-files/upgrades/2016-03-10--22-18.sql
new file mode 100644
index 00000000..80266bcc
--- /dev/null
+++ b/sql-files/upgrades/2016-03-10--22-18.sql
@@ -0,0 +1,22 @@
+#1457638175
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2015-2016 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `picklog` MODIFY `type` enum('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U','K','Y','Z','W','Q','J','H','@','0','1','2') NOT NULL default 'P';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1457638175)
diff --git a/sql-files/upgrades/2016-07-08--02-42.sql b/sql-files/upgrades/2016-07-08--02-42.sql
new file mode 100644
index 00000000..94ca7e6d
--- /dev/null
+++ b/sql-files/upgrades/2016-07-08--02-42.sql
@@ -0,0 +1,35 @@
+#1467934919
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2015-2016 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `charlog` MODIFY `time` DATETIME NULL;
+ALTER TABLE `interlog` MODIFY `time` DATETIME NULL;
+ALTER TABLE `ipbanlist` MODIFY `btime` DATETIME NULL;
+ALTER TABLE `ipbanlist` MODIFY `rtime` DATETIME NULL;
+ALTER TABLE `login` MODIFY `lastlogin` DATETIME NULL;
+ALTER TABLE `login` MODIFY `birthdate` DATE NULL;
+
+UPDATE `charlog` SET `time` = NULL WHERE `time` = '0000-00-00 00:00:00';
+UPDATE `interlog` SET `time` = NULL WHERE `time` = '0000-00-00 00:00:00';
+UPDATE `ipbanlist` SET `btime` = NULL WHERE `btime` = '0000-00-00 00:00:00';
+UPDATE `ipbanlist` SET `rtime` = NULL WHERE `rtime` = '0000-00-00 00:00:00';
+UPDATE `login` SET `lastlogin` = NULL WHERE `lastlogin` = '0000-00-00 00:00:00';
+UPDATE `login` SET `birthdate` = NULL WHERE `birthdate` = '0000-00-00';
+
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1467934919)
diff --git a/sql-files/upgrades/2016-07-08--02-51.sql b/sql-files/upgrades/2016-07-08--02-51.sql
new file mode 100644
index 00000000..8ecf1a25
--- /dev/null
+++ b/sql-files/upgrades/2016-07-08--02-51.sql
@@ -0,0 +1,30 @@
+#1467935469
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2015-2016 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `atcommandlog` MODIFY `atcommand_date` DATETIME NULL;
+ALTER TABLE `branchlog` MODIFY `branch_date` DATETIME NULL;
+ALTER TABLE `chatlog` MODIFY `time` DATETIME NULL;
+ALTER TABLE `loginlog` MODIFY `time` DATETIME NULL;
+ALTER TABLE `mvplog` MODIFY `mvp_date` DATETIME NULL;
+ALTER TABLE `npclog` MODIFY `npc_date` DATETIME NULL;
+ALTER TABLE `picklog` MODIFY `time` DATETIME NULL;
+ALTER TABLE `zenylog` MODIFY `time` DATETIME NULL;
+
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1467935469)
diff --git a/sql-files/upgrades/2016-10-03--20-27.sql b/sql-files/upgrades/2016-10-03--20-27.sql
new file mode 100644
index 00000000..6ad840e0
--- /dev/null
+++ b/sql-files/upgrades/2016-10-03--20-27.sql
@@ -0,0 +1,23 @@
+#1475526420
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2015-2016 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `charlog` ADD `class` MEDIUMINT(9) NOT NULL DEFAULT '0' AFTER `char_num`;
+
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1475526420);
diff --git a/sql-files/upgrades/2016-10-26--10-29.sql b/sql-files/upgrades/2016-10-26--10-29.sql
new file mode 100644
index 00000000..cabd7db1
--- /dev/null
+++ b/sql-files/upgrades/2016-10-26--10-29.sql
@@ -0,0 +1,23 @@
+#1477434595
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2015-2016 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `zenylog` CHANGE `type` `type` ENUM('T','V','P','M','S','N','D','C','A','E','I','B','K') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'S';
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1477434595 , 'No');
diff --git a/sql-files/upgrades/2017-03-02--11-40.sql b/sql-files/upgrades/2017-03-02--11-40.sql
new file mode 100644
index 00000000..30798b5d
--- /dev/null
+++ b/sql-files/upgrades/2017-03-02--11-40.sql
@@ -0,0 +1,93 @@
+#1488454834
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2015-2016 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `auction`
+ ADD COLUMN `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `card3`,
+ ADD COLUMN `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx0`,
+ ADD COLUMN `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val0`,
+ ADD COLUMN `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx1`,
+ ADD COLUMN `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val1`,
+ ADD COLUMN `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx2`,
+ ADD COLUMN `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val2`,
+ ADD COLUMN `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx3`,
+ ADD COLUMN `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val3`,
+ ADD COLUMN `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx4`;
+
+ALTER TABLE `cart_inventory`
+ ADD COLUMN `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `card3`,
+ ADD COLUMN `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx0`,
+ ADD COLUMN `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val0`,
+ ADD COLUMN `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx1`,
+ ADD COLUMN `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val1`,
+ ADD COLUMN `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx2`,
+ ADD COLUMN `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val2`,
+ ADD COLUMN `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx3`,
+ ADD COLUMN `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val3`,
+ ADD COLUMN `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx4`;
+
+ALTER TABLE `guild_storage`
+ ADD COLUMN `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `card3`,
+ ADD COLUMN `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx0`,
+ ADD COLUMN `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val0`,
+ ADD COLUMN `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx1`,
+ ADD COLUMN `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val1`,
+ ADD COLUMN `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx2`,
+ ADD COLUMN `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val2`,
+ ADD COLUMN `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx3`,
+ ADD COLUMN `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val3`,
+ ADD COLUMN `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx4`;
+
+ALTER TABLE `inventory`
+ ADD COLUMN `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `card3`,
+ ADD COLUMN `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx0`,
+ ADD COLUMN `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val0`,
+ ADD COLUMN `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx1`,
+ ADD COLUMN `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val1`,
+ ADD COLUMN `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx2`,
+ ADD COLUMN `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val2`,
+ ADD COLUMN `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx3`,
+ ADD COLUMN `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val3`,
+ ADD COLUMN `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx4`;
+
+ALTER TABLE `mail`
+ ADD COLUMN `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `card3`,
+ ADD COLUMN `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx0`,
+ ADD COLUMN `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val0`,
+ ADD COLUMN `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx1`,
+ ADD COLUMN `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val1`,
+ ADD COLUMN `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx2`,
+ ADD COLUMN `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val2`,
+ ADD COLUMN `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx3`,
+ ADD COLUMN `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val3`,
+ ADD COLUMN `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx4`;
+
+ALTER TABLE `storage`
+ ADD COLUMN `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `card3`,
+ ADD COLUMN `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx0`,
+ ADD COLUMN `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val0`,
+ ADD COLUMN `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx1`,
+ ADD COLUMN `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val1`,
+ ADD COLUMN `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx2`,
+ ADD COLUMN `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val2`,
+ ADD COLUMN `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx3`,
+ ADD COLUMN `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val3`,
+ ADD COLUMN `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx4`;
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1488454834 , 'No');
diff --git a/sql-files/upgrades/2017-03-05--08-09.sql b/sql-files/upgrades/2017-03-05--08-09.sql
new file mode 100644
index 00000000..3b5ee1a2
--- /dev/null
+++ b/sql-files/upgrades/2017-03-05--08-09.sql
@@ -0,0 +1,15 @@
+#1488744559
+
+ALTER TABLE `picklog`
+ ADD COLUMN `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `card3`,
+ ADD COLUMN `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx0`,
+ ADD COLUMN `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val0`,
+ ADD COLUMN `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx1`,
+ ADD COLUMN `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val1`,
+ ADD COLUMN `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx2`,
+ ADD COLUMN `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val2`,
+ ADD COLUMN `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx3`,
+ ADD COLUMN `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `opt_val3`,
+ ADD COLUMN `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0' AFTER `opt_idx4`;
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1488744559 , 'No');
diff --git a/sql-files/upgrades/2017-03-15--14-29.sql b/sql-files/upgrades/2017-03-15--14-29.sql
new file mode 100644
index 00000000..6e604473
--- /dev/null
+++ b/sql-files/upgrades/2017-03-15--14-29.sql
@@ -0,0 +1,74 @@
+#1489588190
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2017 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+CREATE TABLE IF NOT EXISTS `rodex_items` (
+ `id` INT(11) NOT NULL AUTO_INCREMENT,
+ `mail_id` BIGINT(20) NOT NULL DEFAULT '0',
+ `nameid` INT(11) NOT NULL DEFAULT '0',
+ `amount` INT(11) NOT NULL DEFAULT '0',
+ `equip` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `identify` SMALLINT(6) NOT NULL DEFAULT '0',
+ `refine` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
+ `attribute` TINYINT(4) NOT NULL DEFAULT '0',
+ `card0` SMALLINT(11) NOT NULL DEFAULT '0',
+ `card1` SMALLINT(11) NOT NULL DEFAULT '0',
+ `card2` SMALLINT(11) NOT NULL DEFAULT '0',
+ `card3` SMALLINT(11) NOT NULL DEFAULT '0',
+ `opt_idx0` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val0` SMALLINT(5) NOT NULL DEFAULT '0',
+ `opt_idx1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val1` SMALLINT(5) NOT NULL DEFAULT '0',
+ `opt_idx2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val2` SMALLINT(5) NOT NULL DEFAULT '0',
+ `opt_idx3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val3` SMALLINT(5) NOT NULL DEFAULT '0',
+ `opt_idx4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
+ `opt_val4` SMALLINT(5) NOT NULL DEFAULT '0',
+ `expire_time` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `bound` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+ `unique_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ KEY `mail_id` (`mail_id`)
+) ENGINE=InnoDB;
+
+CREATE TABLE IF NOT EXISTS `rodex_mail` (
+ `mail_id` BIGINT(20) NOT NULL AUTO_INCREMENT,
+ `sender_name` VARCHAR(30) NOT NULL COLLATE 'utf8_unicode_ci',
+ `sender_id` INT(11) NOT NULL,
+ `receiver_name` VARCHAR(30) NOT NULL COLLATE 'utf8_unicode_ci',
+ `receiver_id` INT(11) NOT NULL,
+ `receiver_accountid` INT(11) NOT NULL,
+ `title` VARCHAR(50) NOT NULL COLLATE 'utf8_unicode_ci',
+ `body` VARCHAR(510) NOT NULL COLLATE 'utf8_unicode_ci',
+ `zeny` BIGINT(20) NOT NULL,
+ `type` TINYINT(8) UNSIGNED NOT NULL,
+ `is_read` TINYINT(8) NOT NULL,
+ `send_date` INT(11) NOT NULL,
+ `expire_date` INT(11) NOT NULL,
+ `weight` INT(11) NOT NULL,
+ PRIMARY KEY (`mail_id`),
+ KEY `sender_id` (`sender_id`),
+ KEY `receiver_id` (`receiver_id`),
+ KEY `receiver_accountid` (`receiver_accountid`),
+ KEY `send_date` (`send_date`),
+ KEY `expire_date` (`expire_date`)
+) ENGINE=MyISAM;
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1489588190 , 'No');
diff --git a/sql-files/upgrades/2017-06-04--15-04.sql b/sql-files/upgrades/2017-06-04--15-04.sql
new file mode 100644
index 00000000..0805d054
--- /dev/null
+++ b/sql-files/upgrades/2017-06-04--15-04.sql
@@ -0,0 +1,24 @@
+#1496588640
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2017 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `char` ADD COLUMN `clan_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `guild_id`;
+ALTER TABLE `char` ADD COLUMN `last_login` BIGINT(20) NULL DEFAULT '0' AFTER `robe`;
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1496588640 , 'No');
diff --git a/sql-files/upgrades/2017-06-04--15-05.sql b/sql-files/upgrades/2017-06-04--15-05.sql
new file mode 100644
index 00000000..550197a1
--- /dev/null
+++ b/sql-files/upgrades/2017-06-04--15-05.sql
@@ -0,0 +1,23 @@
+#1496588700
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2017 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `chatlog` MODIFY COLUMN `type` enum('O','W','P','G','M','C') NOT NULL DEFAULT 'O' AFTER `time`;
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1496588700 , 'No');
diff --git a/sql-files/upgrades/2017-11-04--10-39.sql b/sql-files/upgrades/2017-11-04--10-39.sql
new file mode 100644
index 00000000..f95dbef0
--- /dev/null
+++ b/sql-files/upgrades/2017-11-04--10-39.sql
@@ -0,0 +1,6 @@
+#1509835214
+
+ALTER TABLE `homunculus`
+ ADD COLUMN `autofeed` TINYINT(2) NOT NULL DEFAULT '0' AFTER `vaporize`;
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1509835214 , 'No');
diff --git a/sql-files/upgrades/2018-02-26--15-57.sql b/sql-files/upgrades/2018-02-26--15-57.sql
new file mode 100644
index 00000000..a2090bb3
--- /dev/null
+++ b/sql-files/upgrades/2018-02-26--15-57.sql
@@ -0,0 +1,6 @@
+#1519671456
+
+ALTER TABLE `rodex_mail`
+ ADD COLUMN `sender_read` TINYINT(2) NOT NULL DEFAULT '0' AFTER `is_read`;
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1519671456 , 'No');
diff --git a/sql-files/upgrades/2018-03-10--04-06.sql b/sql-files/upgrades/2018-03-10--04-06.sql
new file mode 100644
index 00000000..ee827735
--- /dev/null
+++ b/sql-files/upgrades/2018-03-10--04-06.sql
@@ -0,0 +1,24 @@
+#1520654809
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2017 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `char` ADD COLUMN `attendance_count` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `hotkey_rowshift`;
+ALTER TABLE `char` ADD COLUMN `attendance_timer` BIGINT(20) NULL DEFAULT '0' AFTER `attendance_count`;
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1520654809 , 'No');
diff --git a/sql-files/upgrades/2018-06-03--00-10.sql b/sql-files/upgrades/2018-06-03--00-10.sql
new file mode 100644
index 00000000..c7f6ac48
--- /dev/null
+++ b/sql-files/upgrades/2018-06-03--00-10.sql
@@ -0,0 +1,40 @@
+#1527964800
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2018 Hercules Dev Team
+-- Copyright (C) Smokexyz
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+CREATE TABLE `char_achievements` (
+ `char_id` INT(11) UNSIGNED NOT NULL,
+ `ach_id` INT(11) UNSIGNED NOT NULL,
+ `completed_at` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ `rewarded_at` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ `obj_0` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ `obj_1` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ `obj_2` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ `obj_3` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ `obj_4` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ `obj_5` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ `obj_6` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ `obj_7` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ `obj_8` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ `obj_9` INT(10) UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`char_id`, `ach_id`)
+) ENGINE=MyISAM;
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1527964800, 'No');
diff --git a/sql-files/upgrades/2018-06-03--17-16.sql b/sql-files/upgrades/2018-06-03--17-16.sql
new file mode 100644
index 00000000..e14ca62c
--- /dev/null
+++ b/sql-files/upgrades/2018-06-03--17-16.sql
@@ -0,0 +1,24 @@
+#1528026381
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2018 Hercules Dev Team
+-- Copyright (C) Dastgir
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `char` ADD `title_id` INT(11) UNSIGNED NOT NULL DEFAULT '0';
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1528026381, 'No');
diff --git a/sql-files/upgrades/2018-06-05--12-02.sql b/sql-files/upgrades/2018-06-05--12-02.sql
new file mode 100644
index 00000000..26c22243
--- /dev/null
+++ b/sql-files/upgrades/2018-06-05--12-02.sql
@@ -0,0 +1,24 @@
+#1528180320
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2018 Hercules Dev Team
+-- Copyright (C) 2018 Dastgir
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `pet` ADD COLUMN `autofeed` TINYINT(2) UNSIGNED NOT NULL DEFAULT '0';
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1528180320 , 'No');
diff --git a/sql-files/upgrades/2018-07-24--03-23.sql b/sql-files/upgrades/2018-07-24--03-23.sql
new file mode 100644
index 00000000..a8d2d8f7
--- /dev/null
+++ b/sql-files/upgrades/2018-07-24--03-23.sql
@@ -0,0 +1,22 @@
+#1532403228
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2018 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+UPDATE `inventory` SET `identify` = 1, `attribute` = 1 WHERE `card0` = -256 and `identify` = 0;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1532403228);
diff --git a/sql-files/upgrades/2018-09-01--05-22.sql b/sql-files/upgrades/2018-09-01--05-22.sql
new file mode 100644
index 00000000..7a834edd
--- /dev/null
+++ b/sql-files/upgrades/2018-09-01--05-22.sql
@@ -0,0 +1,63 @@
+#1535865732
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2018 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `auction`
+ MODIFY `card0` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card1` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card2` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card3` INT(11) NOT NULL DEFAULT '0';
+
+ALTER TABLE `cart_inventory`
+ MODIFY `card0` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card1` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card2` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card3` INT(11) NOT NULL DEFAULT '0';
+
+ALTER TABLE `guild_storage`
+ MODIFY `card0` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card1` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card2` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card3` INT(11) NOT NULL DEFAULT '0';
+
+ALTER TABLE `inventory`
+ MODIFY `card0` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card1` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card2` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card3` INT(11) NOT NULL DEFAULT '0';
+
+ALTER TABLE `mail`
+ MODIFY `card0` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card1` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card2` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card3` INT(11) NOT NULL DEFAULT '0';
+
+ALTER TABLE `rodex_items`
+ MODIFY `card0` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card1` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card2` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card3` INT(11) NOT NULL DEFAULT '0';
+
+ALTER TABLE `storage`
+ MODIFY `card0` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card1` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card2` INT(11) NOT NULL DEFAULT '0',
+ MODIFY `card3` INT(11) NOT NULL DEFAULT '0';
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1535865732, 'No');
diff --git a/sql-files/upgrades/2018-12-14--01-02.sql b/sql-files/upgrades/2018-12-14--01-02.sql
new file mode 100644
index 00000000..7bcd583c
--- /dev/null
+++ b/sql-files/upgrades/2018-12-14--01-02.sql
@@ -0,0 +1,24 @@
+#1544738447
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2018 Hercules Dev Team
+-- Copyright (C) 4144
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `char` ADD `inventory_size` INT(11) UNSIGNED NOT NULL DEFAULT '100';
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1544738447, 'No');
diff --git a/sql-files/upgrades/2018-12-29--07-51.sql b/sql-files/upgrades/2018-12-29--07-51.sql
new file mode 100644
index 00000000..64117939
--- /dev/null
+++ b/sql-files/upgrades/2018-12-29--07-51.sql
@@ -0,0 +1,29 @@
+#1546059075
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2013-2015 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+CREATE TABLE IF NOT EXISTS `npc_barter_data` (
+ `name` VARCHAR(24) NOT NULL DEFAULT '',
+ `itemId` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `amount` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `priceId` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `priceAmount` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ PRIMARY KEY (`name`, `itemid`, `priceId`, `priceAmount`)
+) ENGINE=MyISAM;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1546059075);
diff --git a/sql-files/upgrades/2019-04-08--21-52.sql b/sql-files/upgrades/2019-04-08--21-52.sql
new file mode 100644
index 00000000..bd015acf
--- /dev/null
+++ b/sql-files/upgrades/2019-04-08--21-52.sql
@@ -0,0 +1,29 @@
+#1554760320
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2013-2019 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+UPDATE `auction` SET `card3` = `card2` >> 16, `card2` = `card2` % 65536 WHERE `card2` > 65536 AND (`card0` = 255 OR `card0` = 254);
+UPDATE `cart_inventory` SET `card3` = `card2` >> 16, `card2` = `card2` % 65536 WHERE `card2` > 65536 AND (`card0` = 255 OR `card0` = 254);
+UPDATE `inventory` SET `card3` = `card2` >> 16, `card2` = `card2` % 65536 WHERE `card2` > 65536 AND (`card0` = 255 OR `card0` = 254);
+UPDATE `guild_storage` SET `card3` = `card2` >> 16, `card2` = `card2` % 65536 WHERE `card2` > 65536 AND (`card0` = 255 OR `card0` = 254);
+UPDATE `mail` SET `card3` = `card2` >> 16, `card2` = `card2` % 65536 WHERE `card2` > 65536 AND (`card0` = 255 OR `card0` = 254);
+UPDATE `rodex_items` SET `card3` = `card2` >> 16, `card2` = `card2` % 65536 WHERE `card2` > 65536 AND (`card0` = 255 OR `card0` = 254);
+UPDATE `storage` SET `card3` = `card2` >> 16, `card2` = `card2` % 65536 WHERE `card2` > 65536 AND (`card0` = 255 OR `card0` = 254);
+
+INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1554760320, 'No');
diff --git a/sql-files/upgrades/2019-04-25--02-12.sql b/sql-files/upgrades/2019-04-25--02-12.sql
new file mode 100644
index 00000000..64abe45b
--- /dev/null
+++ b/sql-files/upgrades/2019-04-25--02-12.sql
@@ -0,0 +1,24 @@
+#1556147483
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2013-2019 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+TRUNCATE TABLE `guild_expulsion`;
+ALTER TABLE `guild_expulsion` ADD `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `account_id`;
+
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1556147483);
diff --git a/sql-files/upgrades/2019-05-09--18-07.sql b/sql-files/upgrades/2019-05-09--18-07.sql
new file mode 100644
index 00000000..96d80c29
--- /dev/null
+++ b/sql-files/upgrades/2019-05-09--18-07.sql
@@ -0,0 +1,22 @@
+#1557414445
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2015 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `char` ADD COLUMN `hotkey_rowshift2` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `hotkey_rowshift`;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1557414445);
diff --git a/sql-files/upgrades/2019-08-08--19-43.sql b/sql-files/upgrades/2019-08-08--19-43.sql
new file mode 100644
index 00000000..15bc4a89
--- /dev/null
+++ b/sql-files/upgrades/2019-08-08--19-43.sql
@@ -0,0 +1,95 @@
+#1565293394
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2019-2020 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `guild_castle` DROP PRIMARY KEY;
+ALTER TABLE `guild_castle` ADD COLUMN `castle_name` VARCHAR(24) AFTER `castle_id`;
+UPDATE `guild_castle` SET `castle_name` = 'aldeg_cas01' WHERE castle_id = 0;
+UPDATE `guild_castle` SET `castle_name` = 'aldeg_cas02' WHERE castle_id = 1;
+UPDATE `guild_castle` SET `castle_name` = 'aldeg_cas03' WHERE castle_id = 2;
+UPDATE `guild_castle` SET `castle_name` = 'aldeg_cas04' WHERE castle_id = 3;
+UPDATE `guild_castle` SET `castle_name` = 'aldeg_cas05' WHERE castle_id = 4;
+UPDATE `guild_castle` SET `castle_name` = 'gefg_cas01' WHERE castle_id = 5;
+UPDATE `guild_castle` SET `castle_name` = 'gefg_cas02' WHERE castle_id = 6;
+UPDATE `guild_castle` SET `castle_name` = 'gefg_cas03' WHERE castle_id = 7;
+UPDATE `guild_castle` SET `castle_name` = 'gefg_cas04' WHERE castle_id = 8;
+UPDATE `guild_castle` SET `castle_name` = 'gefg_cas05' WHERE castle_id = 9;
+UPDATE `guild_castle` SET `castle_name` = 'payg_cas01' WHERE castle_id = 10;
+UPDATE `guild_castle` SET `castle_name` = 'payg_cas02' WHERE castle_id = 11;
+UPDATE `guild_castle` SET `castle_name` = 'payg_cas03' WHERE castle_id = 12;
+UPDATE `guild_castle` SET `castle_name` = 'payg_cas04' WHERE castle_id = 13;
+UPDATE `guild_castle` SET `castle_name` = 'payg_cas05' WHERE castle_id = 14;
+UPDATE `guild_castle` SET `castle_name` = 'prtg_cas01' WHERE castle_id = 15;
+UPDATE `guild_castle` SET `castle_name` = 'prtg_cas02' WHERE castle_id = 16;
+UPDATE `guild_castle` SET `castle_name` = 'prtg_cas03' WHERE castle_id = 17;
+UPDATE `guild_castle` SET `castle_name` = 'prtg_cas04' WHERE castle_id = 18;
+UPDATE `guild_castle` SET `castle_name` = 'prtg_cas05' WHERE castle_id = 19;
+UPDATE `guild_castle` SET `castle_name` = 'nguild_alde' WHERE castle_id = 20;
+UPDATE `guild_castle` SET `castle_name` = 'nguild_gef' WHERE castle_id = 21;
+UPDATE `guild_castle` SET `castle_name` = 'nguild_pay' WHERE castle_id = 22;
+UPDATE `guild_castle` SET `castle_name` = 'nguild_prt' WHERE castle_id = 23;
+UPDATE `guild_castle` SET `castle_name` = 'schg_cas01' WHERE castle_id = 24;
+UPDATE `guild_castle` SET `castle_name` = 'schg_cas02' WHERE castle_id = 25;
+UPDATE `guild_castle` SET `castle_name` = 'schg_cas03' WHERE castle_id = 26;
+UPDATE `guild_castle` SET `castle_name` = 'schg_cas04' WHERE castle_id = 27;
+UPDATE `guild_castle` SET `castle_name` = 'schg_cas05' WHERE castle_id = 28;
+UPDATE `guild_castle` SET `castle_name` = 'arug_cas01' WHERE castle_id = 29;
+UPDATE `guild_castle` SET `castle_name` = 'arug_cas02' WHERE castle_id = 30;
+UPDATE `guild_castle` SET `castle_name` = 'arug_cas03' WHERE castle_id = 31;
+UPDATE `guild_castle` SET `castle_name` = 'arug_cas04' WHERE castle_id = 32;
+UPDATE `guild_castle` SET `castle_name` = 'arug_cas05' WHERE castle_id = 33;
+
+-- Change the castle ids
+UPDATE `guild_castle` SET `castle_id` = 1 WHERE castle_name = 'prtg_cas01';
+UPDATE `guild_castle` SET `castle_id` = 2 WHERE castle_name = 'prtg_cas02';
+UPDATE `guild_castle` SET `castle_id` = 3 WHERE castle_name = 'prtg_cas03';
+UPDATE `guild_castle` SET `castle_id` = 4 WHERE castle_name = 'prtg_cas04';
+UPDATE `guild_castle` SET `castle_id` = 5 WHERE castle_name = 'prtg_cas05';
+UPDATE `guild_castle` SET `castle_id` = 6 WHERE castle_name = 'aldeg_cas01';
+UPDATE `guild_castle` SET `castle_id` = 7 WHERE castle_name = 'aldeg_cas02';
+UPDATE `guild_castle` SET `castle_id` = 8 WHERE castle_name = 'aldeg_cas03';
+UPDATE `guild_castle` SET `castle_id` = 9 WHERE castle_name = 'aldeg_cas04';
+UPDATE `guild_castle` SET `castle_id` = 10 WHERE castle_name = 'aldeg_cas05';
+UPDATE `guild_castle` SET `castle_id` = 11 WHERE castle_name = 'gefg_cas01';
+UPDATE `guild_castle` SET `castle_id` = 12 WHERE castle_name = 'gefg_cas02';
+UPDATE `guild_castle` SET `castle_id` = 13 WHERE castle_name = 'gefg_cas03';
+UPDATE `guild_castle` SET `castle_id` = 14 WHERE castle_name = 'gefg_cas04';
+UPDATE `guild_castle` SET `castle_id` = 15 WHERE castle_name = 'gefg_cas05';
+UPDATE `guild_castle` SET `castle_id` = 16 WHERE castle_name = 'payg_cas01';
+UPDATE `guild_castle` SET `castle_id` = 17 WHERE castle_name = 'payg_cas02';
+UPDATE `guild_castle` SET `castle_id` = 18 WHERE castle_name = 'payg_cas03';
+UPDATE `guild_castle` SET `castle_id` = 19 WHERE castle_name = 'payg_cas04';
+UPDATE `guild_castle` SET `castle_id` = 20 WHERE castle_name = 'payg_cas05';
+UPDATE `guild_castle` SET `castle_id` = 21 WHERE castle_name = 'arug_cas01';
+UPDATE `guild_castle` SET `castle_id` = 22 WHERE castle_name = 'arug_cas02';
+UPDATE `guild_castle` SET `castle_id` = 23 WHERE castle_name = 'arug_cas03';
+UPDATE `guild_castle` SET `castle_id` = 24 WHERE castle_name = 'arug_cas04';
+UPDATE `guild_castle` SET `castle_id` = 25 WHERE castle_name = 'arug_cas05';
+UPDATE `guild_castle` SET `castle_id` = 26 WHERE castle_name = 'schg_cas01';
+UPDATE `guild_castle` SET `castle_id` = 27 WHERE castle_name = 'schg_cas02';
+UPDATE `guild_castle` SET `castle_id` = 29 WHERE castle_name = 'schg_cas04';
+UPDATE `guild_castle` SET `castle_id` = 28 WHERE castle_name = 'schg_cas03';
+UPDATE `guild_castle` SET `castle_id` = 30 WHERE castle_name = 'schg_cas05';
+UPDATE `guild_castle` SET `castle_id` = 31 WHERE castle_name = 'nguild_prt';
+UPDATE `guild_castle` SET `castle_id` = 32 WHERE castle_name = 'nguild_alde';
+UPDATE `guild_castle` SET `castle_id` = 33 WHERE castle_name = 'nguild_gef';
+UPDATE `guild_castle` SET `castle_id` = 34 WHERE castle_name = 'nguild_pay';
+ALTER TABLE `guild_castle` ADD PRIMARY KEY (`castle_id`);
+ALTER TABLE `guild_castle` DROP COLUMN `castle_name`;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1565293394);
diff --git a/sql-files/upgrades/2019-10-05--19-01.sql b/sql-files/upgrades/2019-10-05--19-01.sql
new file mode 100644
index 00000000..165764a8
--- /dev/null
+++ b/sql-files/upgrades/2019-10-05--19-01.sql
@@ -0,0 +1,28 @@
+#1570309293
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2019-2020 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+-- Adds new total_tick column
+ALTER TABLE `sc_data` ADD COLUMN `total_tick` INT(11) NOT NULL AFTER `tick`;
+
+-- Copy current tick to total_tick so players doesn't lose their current
+-- status_changes, although those will still appear wrong until they end
+UPDATE `sc_data` SET `total_tick` = `tick`;
+
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1570309293);
diff --git a/sql-files/upgrades/2019-10-12--14-21.sql b/sql-files/upgrades/2019-10-12--14-21.sql
new file mode 100644
index 00000000..7da66e9b
--- /dev/null
+++ b/sql-files/upgrades/2019-10-12--14-21.sql
@@ -0,0 +1,23 @@
+#1570870260
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2019 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+ALTER TABLE `picklog` MODIFY `type` enum('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U','K','Y','Z','W','Q','J','H','@','0','1','2', '3') NOT NULL DEFAULT 'P';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1570870260);
diff --git a/sql-files/upgrades/2019-11-22--23-58.sql b/sql-files/upgrades/2019-11-22--23-58.sql
new file mode 100644
index 00000000..34ffc2c7
--- /dev/null
+++ b/sql-files/upgrades/2019-11-22--23-58.sql
@@ -0,0 +1,23 @@
+#1574463539
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2019-2020 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+ALTER TABLE `ipbanlist` MODIFY `list` VARCHAR(13) NOT NULL DEFAULT '';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1574463539);
diff --git a/sql-files/upgrades/2020-01-24--01-09.sql b/sql-files/upgrades/2020-01-24--01-09.sql
new file mode 100644
index 00000000..2370b267
--- /dev/null
+++ b/sql-files/upgrades/2020-01-24--01-09.sql
@@ -0,0 +1,63 @@
+#1579817630
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2013-2020 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+CREATE TABLE IF NOT EXISTS `npc_expanded_barter_data` (
+ `name` VARCHAR(24) NOT NULL DEFAULT '',
+ `itemId` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `amount` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `zeny` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyId1` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount1` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine1` INT(11) NOT NULL DEFAULT '0',
+ `currencyId2` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount2` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine2` INT(11) NOT NULL DEFAULT '0',
+ `currencyId3` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount3` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine3` INT(11) NOT NULL DEFAULT '0',
+ `currencyId4` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount4` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine4` INT(11) NOT NULL DEFAULT '0',
+ `currencyId5` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount5` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine5` INT(11) NOT NULL DEFAULT '0',
+ `currencyId6` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount6` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine6` INT(11) NOT NULL DEFAULT '0',
+ `currencyId7` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount7` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine7` INT(11) NOT NULL DEFAULT '0',
+ `currencyId8` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount8` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine8` INT(11) NOT NULL DEFAULT '0',
+ `currencyId9` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount9` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine9` INT(11) NOT NULL DEFAULT '0',
+ `currencyId10` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyAmount10` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `currencyRefine10` INT(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`name`, `itemid`, `zeny`,
+ `currencyId1`, `currencyAmount1`, `currencyRefine1`,
+ `currencyId2`, `currencyAmount2`, `currencyRefine2`,
+ `currencyId3`, `currencyAmount3`, `currencyRefine3`,
+ `currencyId4`, `currencyAmount4`, `currencyRefine4`
+)
+) ENGINE=MyISAM;
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1579817630);
diff --git a/sql-files/upgrades/2020-03-22--01-56.sql b/sql-files/upgrades/2020-03-22--01-56.sql
new file mode 100644
index 00000000..58f090a6
--- /dev/null
+++ b/sql-files/upgrades/2020-03-22--01-56.sql
@@ -0,0 +1,23 @@
+#1584838560
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2019-2020 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+ALTER TABLE `ipbanlist` MODIFY `list` VARCHAR(39) NOT NULL DEFAULT '';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1584838560);
diff --git a/sql-files/upgrades/2020-03-22--03-09.sql b/sql-files/upgrades/2020-03-22--03-09.sql
new file mode 100644
index 00000000..dbdf65c5
--- /dev/null
+++ b/sql-files/upgrades/2020-03-22--03-09.sql
@@ -0,0 +1,24 @@
+#1584842940
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2019-2020 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `login` ALTER `userid` DROP DEFAULT;
+ALTER TABLE `login` DROP INDEX `name`;
+ALTER TABLE `login` ADD CONSTRAINT `name` UNIQUE (`userid`);
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1584842940);
diff --git a/sql-files/upgrades/2020-05-01--04-44.sql b/sql-files/upgrades/2020-05-01--04-44.sql
new file mode 100644
index 00000000..6cb5a30e
--- /dev/null
+++ b/sql-files/upgrades/2020-05-01--04-44.sql
@@ -0,0 +1,25 @@
+#1588301040
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2019-2020 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ALTER TABLE `acc_reg_str_db` MODIFY `value` VARCHAR(255) NOT NULL DEFAULT '0';
+ALTER TABLE `char_reg_str_db` MODIFY `value` VARCHAR(255) NOT NULL DEFAULT '0';
+ALTER TABLE `global_acc_reg_str_db` MODIFY `value` VARCHAR(255) NOT NULL DEFAULT '0';
+
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1588301040);
diff --git a/sql-files/upgrades/2020-05-10--23-11.sql b/sql-files/upgrades/2020-05-10--23-11.sql
new file mode 100644
index 00000000..9f2755e7
--- /dev/null
+++ b/sql-files/upgrades/2020-05-10--23-11.sql
@@ -0,0 +1,43 @@
+#1589145060
+
+-- This file is part of Hercules.
+-- http://herc.ws - http://github.com/HerculesWS/Hercules
+--
+-- Copyright (C) 2019-2020 Hercules Dev Team
+--
+-- Hercules is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+-- Add separate tables for global integer and string variables.
+CREATE TABLE IF NOT EXISTS `map_reg_num_db` (
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT UNSIGNED NOT NULL DEFAULT '0',
+ `value` INT NOT NULL DEFAULT '0',
+ PRIMARY KEY (`key`, `index`)
+) ENGINE=MyISAM;
+CREATE TABLE IF NOT EXISTS `map_reg_str_db` (
+ `key` VARCHAR(32) BINARY NOT NULL DEFAULT '',
+ `index` INT UNSIGNED NOT NULL DEFAULT '0',
+ `value` VARCHAR(255) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`key`, `index`)
+) ENGINE=MyISAM;
+
+-- Copy data from mapreg table to new map_reg_*_db tables.
+INSERT INTO `map_reg_num_db` (`key`, `index`, `value`) SELECT `varname`, `index`, CAST(`value` AS SIGNED) FROM `mapreg` WHERE NOT RIGHT(`varname`, 1)='$';
+INSERT INTO `map_reg_str_db` (`key`, `index`, `value`) SELECT `varname`, `index`, `value` FROM `mapreg` WHERE RIGHT(`varname`, 1)='$';
+
+-- Remove mapreg table.
+DROP TABLE IF EXISTS `mapreg`;
+
+-- Add update timestamp.
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1589145060);
diff --git a/sql-files/upgrades/index.txt b/sql-files/upgrades/index.txt
new file mode 100644
index 00000000..fb889c28
--- /dev/null
+++ b/sql-files/upgrades/index.txt
@@ -0,0 +1,66 @@
+2013-02-14--16-15.sql
+2013-02-15--18-06.sql
+2013-03-05--01-05.sql
+2013-03-06--00-00.sql
+2013-03-09--01-56.sql
+2013-03-27--18-35.sql
+2013-04-16--01-24.sql
+2013-04-16--02-15.sql
+2013-10-09--21-38.sql
+2013-10-10--16-36.sql
+2013-10-27--16-47.sql
+2013-10-30--19-53.sql
+2013-10-30--21-12.sql
+2013-10-31--07-49.sql
+2013-11-09--00-03.sql
+2013-11-15--00-06.sql
+2013-11-15--19-57.sql
+2013-11-16--07-49.sql
+2013-11-18--08-23.sql
+2013-12-24--00-15.sql
+2014-01-04--16-47.sql
+2014-01-06--17-22.sql
+2014-02-19--17-57.sql
+2014-03-25--23-57.sql
+2014-04-07--22-04.sql
+2014-04-26--10-00.sql
+2014-05-17--00-06.sql
+2014-09-01--16-53.sql
+2014-11-03--00-45.sql
+2015-07-02--18-14.sql
+2015-07-08--13-08.sql
+2015-08-27--20-42.sql
+2015-12-16--12-57.sql
+2015-12-17--15-58.sql
+2016-03-10--22-18.sql
+2016-07-08--02-42.sql
+2016-07-08--02-51.sql
+2016-10-03--20-27.sql
+2016-10-26--10-29.sql
+2017-03-02--11-40.sql
+2017-03-05--08-09.sql
+2017-03-15--14-29.sql
+2017-06-04--15-04.sql
+2017-06-04--15-05.sql
+2017-11-04--10-39.sql
+2018-02-26--15-57.sql
+2018-03-10--04-06.sql
+2018-06-03--00-10.sql
+2018-06-03--17-16.sql
+2018-06-05--12-02.sql
+2018-07-24--03-23.sql
+2018-09-01--05-22.sql
+2018-12-14--01-02.sql
+2018-12-29--07-51.sql
+2019-04-08--21-52.sql
+2019-04-25--02-12.sql
+2019-05-09--18-07.sql
+2019-08-08--19-43.sql
+2019-10-05--19-01.sql
+2019-10-12--14-21.sql
+2019-11-22--23-58.sql
+2020-01-24--01-09.sql
+2020-03-22--01-56.sql
+2020-03-22--03-09.sql
+2020-05-01--04-44.sql
+2020-05-10--23-11.sql