• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OpenTibia Load/unload items.xml into database

Nazubal27

New Member
Joined
Mar 6, 2013
Messages
45
Reaction score
4
Location
Canada
I wrote a small Java program that can load the items.xml file into a database so the values can be more easily updated (if you know how to use SQL).
Once the updates are complete you can run the other method to extract all the items and their attributes out of the database back into the items.xml file.

PLEASE BACKUP YOUR items.xml FILE JUST IN CASE!


STEP 1
So your database will need 2 tables, items and item_attributes:

Code:
CREATE TABLE `items` (
  `id` int(11) NOT NULL,
  `name` varchar(45) DEFAULT NULL,
  `fromid` int(11) DEFAULT NULL,
  `toid` int(11) DEFAULT NULL,
  `article` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `item_attributes` (
  `item_id` int(11) NOT NULL,
  `key` varchar(45) NOT NULL,
  `value` varchar(250) NOT NULL,
  `chance` int(11) DEFAULT NULL,
  `random_min` int(11) DEFAULT NULL,
  `random_max` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

STEP 2

Download the source code for the two classes from github
https://github.com/ChrisKay27/TibiaOT-ItemsXMLPublisherAndShredder/blob/master/ExtractFromDB.java

https://github.com/ChrisKay27/TibiaOT-ItemsXMLPublisherAndShredder/blob/master/LoadIntoDB.java


FINALLY

I am assuming you know Java, how to download the packages required for mysql database connection, run the java program etc.
If you really need any help ask me.
 
Back
Top