summaryrefslogtreecommitdiff
path: root/src/sql
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2013-02-17 12:24:45 +0100
committerErik Schilling <ablu.erikschilling@googlemail.com>2013-08-26 22:56:47 +0200
commit44ee071d7ece5a2023f79307f36e8a244c9e7b3a (patch)
tree06b7fcea59bbbf1963b460ca9b678d0ea6fa90e4 /src/sql
parente3a1e9c89e102dbf961c624435c495c759776312 (diff)
downloadmanaserv-44ee071d7ece5a2023f79307f36e8a244c9e7b3a.tar.gz
manaserv-44ee071d7ece5a2023f79307f36e8a244c9e7b3a.tar.bz2
manaserv-44ee071d7ece5a2023f79307f36e8a244c9e7b3a.tar.xz
manaserv-44ee071d7ece5a2023f79307f36e8a244c9e7b3a.zip
Removed skills
This removes support for skills. The plan is to allow to implement the skills as they were implemented before via attributes. This adds a lot more flexibility to the server creators while also removing the confusion about skills and attributes. So this change does: - Remove the skillmanager with all its calls, the skill xml file, etc - Move exp giving to the script engine: --> Allows to implement the old behaviour (and more) in the scripts - Remove the exp tag from the monster definition: + Since the server itself does not require it anymore it feels wrong to require it for EVERY monster. TODO: Add a system to add properties to the monsters/items.xml which allow defining things like the exp and allows to read the value from the script engine. + Small drawback, but it should not be hard to implement this property system. - Drop the level networking and calculation. + level calculation will happen via the attribute system later but i would prefer to do this in a seperate patch since this patch already got longer than expected especially since this requires to make setting correction points and available status points scriptable. + The level would be simply set as a attribute, the int number of it will be the level, the remaining digits will be the % number till the next levelup. - NOT remove any existing skill tables in the database update scripts. + There is no way to move them into the attribute table in a unified way (there are too many different way they could have been used). So server admins have to care about moving theirs skills to attributes themselves. + Keeping the old tables does not hurt for existing databases. So removing does not give any advantage/is required anyway. The now obsolote info about the EXP transaction is not removed for updated databases either. (The update script basically only bumps the version number without doing anything else. - bump the network protocol version --> old clients won't be able to connect. - bump the database version --> serveradmins need to update their db.
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/mysql/createTables.sql20
-rw-r--r--src/sql/mysql/updates/update_22_to_23.sql15
-rw-r--r--src/sql/sqlite/createTables.sql18
-rw-r--r--src/sql/sqlite/updates/update_22_to_23.sql58
4 files changed, 75 insertions, 36 deletions
diff --git a/src/sql/mysql/createTables.sql b/src/sql/mysql/createTables.sql
index 212d4812..50fdae90 100644
--- a/src/sql/mysql/createTables.sql
+++ b/src/sql/mysql/createTables.sql
@@ -33,7 +33,6 @@ CREATE TABLE IF NOT EXISTS `mana_characters` (
`gender` tinyint(3) unsigned NOT NULL,
`hair_style` tinyint(3) unsigned NOT NULL,
`hair_color` tinyint(3) unsigned NOT NULL,
- `level` tinyint(3) unsigned NOT NULL,
`char_pts` smallint(5) unsigned NOT NULL,
`correct_pts` smallint(5) unsigned NOT NULL,
-- location on the map
@@ -70,21 +69,6 @@ CREATE TABLE IF NOT EXISTS `mana_char_attr` (
DEFAULT CHARSET=utf8;
--
--- table: `mana_char_skills`
---
-CREATE TABLE IF NOT EXISTS `mana_char_skills` (
- `char_id` int(10) unsigned NOT NULL,
- `skill_id` smallint(5) unsigned NOT NULL,
- `skill_exp` smallint(5) unsigned NOT NULL,
- --
- PRIMARY KEY (`char_id`, `skill_id`),
- FOREIGN KEY (`char_id`)
- REFERENCES `mana_characters` (`id`)
- ON DELETE CASCADE
-) ENGINE=InnoDB
-DEFAULT CHARSET=utf8;
-
---
-- table: `mana_char_status_effects`
--
CREATE TABLE IF NOT EXISTS `mana_char_status_effects` (
@@ -417,7 +401,6 @@ AS
c.user_id as user_id,
c.name as name,
c.gender as gender,
- c.level as level,
c.map_id as map_id
FROM mana_online_list l
JOIN mana_characters c
@@ -438,7 +421,7 @@ AUTO_INCREMENT=0 ;
INSERT INTO mana_world_states VALUES('accountserver_startup',-1,'0', NOW());
INSERT INTO mana_world_states VALUES('accountserver_version',-1,'0', NOW());
-INSERT INTO mana_world_states VALUES('database_version', -1,'22', NOW());
+INSERT INTO mana_world_states VALUES('database_version', -1,'23', NOW());
-- all known transaction codes
@@ -475,7 +458,6 @@ INSERT INTO mana_transaction_codes VALUES ( 30, 'Trade items', 'Act
INSERT INTO mana_transaction_codes VALUES ( 31, 'Attribute increased', 'Character' );
INSERT INTO mana_transaction_codes VALUES ( 32, 'Attribute decreased', 'Character' );
INSERT INTO mana_transaction_codes VALUES ( 33, 'Command MUTE', 'Commands' );
-INSERT INTO mana_transaction_codes VALUES ( 34, 'Command EXP', 'Commands' );
INSERT INTO mana_transaction_codes VALUES ( 35, 'Command INVISIBLE', 'Commands' );
INSERT INTO mana_transaction_codes VALUES ( 36, 'Command COMBAT', 'Commands' );
INSERT INTO mana_transaction_codes VALUES ( 37, 'Command ANNOUNCE', 'Commands' );
diff --git a/src/sql/mysql/updates/update_22_to_23.sql b/src/sql/mysql/updates/update_22_to_23.sql
new file mode 100644
index 00000000..c4affaed
--- /dev/null
+++ b/src/sql/mysql/updates/update_22_to_23.sql
@@ -0,0 +1,15 @@
+START TRANSACTION;
+
+-- There is no way to convert all your skills to attributes. You will have to
+-- do this manually.
+
+ALTER TABLE mana_characters DROP COLUMN level;
+
+-- Update database version.
+UPDATE mana_world_states
+ SET value = '23',
+ moddate = UNIX_TIMESTAMP()
+ WHERE state_name = 'database_version';
+
+COMMIT;
+
diff --git a/src/sql/sqlite/createTables.sql b/src/sql/sqlite/createTables.sql
index aaf18efc..72a70090 100644
--- a/src/sql/sqlite/createTables.sql
+++ b/src/sql/sqlite/createTables.sql
@@ -51,7 +51,6 @@ CREATE TABLE mana_characters
gender INTEGER NOT NULL,
hair_style INTEGER NOT NULL,
hair_color INTEGER NOT NULL,
- level INTEGER NOT NULL,
char_pts INTEGER NOT NULL,
correct_pts INTEGER NOT NULL,
x INTEGER NOT NULL,
@@ -81,19 +80,6 @@ CREATE INDEX mana_char_attr_char ON mana_char_attr ( char_id );
-----------------------------------------------------------------------------
-CREATE TABLE mana_char_skills
-(
- char_id INTEGER NOT NULL,
- skill_id INTEGER NOT NULL,
- skill_exp INTEGER NOT NULL,
- --
- FOREIGN KEY (char_id) REFERENCES mana_characters(id)
-);
-
-CREATE INDEX mana_char_skills_char ON mana_char_skills ( char_id );
-
------------------------------------------------------------------------------
-
CREATE TABLE mana_char_status_effects
(
char_id INTEGER NOT NULL,
@@ -387,7 +373,6 @@ AS
c.user_id as user_id,
c.name as name,
c.gender as gender,
- c.level as level,
c.map_id as map_id
FROM mana_online_list l
JOIN mana_characters c
@@ -424,7 +409,7 @@ AS
INSERT INTO mana_world_states VALUES('accountserver_startup',-1,'0', strftime('%s','now'));
INSERT INTO mana_world_states VALUES('accountserver_version',-1,'0', strftime('%s','now'));
-INSERT INTO mana_world_states VALUES('database_version', -1,'22', strftime('%s','now'));
+INSERT INTO mana_world_states VALUES('database_version', -1,'23', strftime('%s','now'));
-- all known transaction codes
@@ -461,7 +446,6 @@ INSERT INTO mana_transaction_codes VALUES ( 30, 'Trade items', 'Act
INSERT INTO mana_transaction_codes VALUES ( 31, 'Attribute increased', 'Character' );
INSERT INTO mana_transaction_codes VALUES ( 32, 'Attribute decreased', 'Character' );
INSERT INTO mana_transaction_codes VALUES ( 33, 'Command MUTE', 'Commands' );
-INSERT INTO mana_transaction_codes VALUES ( 34, 'Command EXP', 'Commands' );
INSERT INTO mana_transaction_codes VALUES ( 35, 'Command INVISIBLE', 'Commands' );
INSERT INTO mana_transaction_codes VALUES ( 36, 'Command COMBAT', 'Commands' );
INSERT INTO mana_transaction_codes VALUES ( 37, 'Command ANNOUNCE', 'Commands' );
diff --git a/src/sql/sqlite/updates/update_22_to_23.sql b/src/sql/sqlite/updates/update_22_to_23.sql
new file mode 100644
index 00000000..7172b56f
--- /dev/null
+++ b/src/sql/sqlite/updates/update_22_to_23.sql
@@ -0,0 +1,58 @@
+BEGIN;
+
+-- There is no way to convert all your skills to attributes. You will have to
+-- do this manually.
+
+CREATE TABLE mana_characters_backup
+(
+ id INTEGER PRIMARY KEY,
+ user_id INTEGER NOT NULL,
+ name TEXT NOT NULL UNIQUE,
+ gender INTEGER NOT NULL,
+ hair_style INTEGER NOT NULL,
+ hair_color INTEGER NOT NULL,
+ char_pts INTEGER NOT NULL,
+ correct_pts INTEGER NOT NULL,
+ x INTEGER NOT NULL,
+ y INTEGER NOT NULL,
+ map_id INTEGER NOT NULL,
+ slot INTEGER NOT NULL,
+ --
+ FOREIGN KEY (user_id) REFERENCES mana_accounts(id)
+);
+
+INSERT INTO mana_characters_backup SELECT
+ id, user_id, name, gender, hair_style, hair_color, char_pts, correct_pts,
+ x, y, map_id, slot FROM mana_characters;
+
+DROP TABLE mana_characters;
+
+CREATE TABLE mana_characters
+(
+ id INTEGER PRIMARY KEY,
+ user_id INTEGER NOT NULL,
+ name TEXT NOT NULL UNIQUE,
+ gender INTEGER NOT NULL,
+ hair_style INTEGER NOT NULL,
+ hair_color INTEGER NOT NULL,
+ char_pts INTEGER NOT NULL,
+ correct_pts INTEGER NOT NULL,
+ x INTEGER NOT NULL,
+ y INTEGER NOT NULL,
+ map_id INTEGER NOT NULL,
+ slot INTEGER NOT NULL,
+ --
+ FOREIGN KEY (user_id) REFERENCES mana_accounts(id)
+);
+
+INSERT INTO mana_characters SELECT * FROM mana_characters_backup;
+DROP TABLE mana_characters_backup;
+
+-- Update the database version, and set date of update
+UPDATE mana_world_states
+ SET value = '23',
+ moddate = strftime('%s','now')
+ WHERE state_name = 'database_version';
+
+END;
+