[Release]Table Convertor Open Source

04/04/2012 14:37 funhacker#1
Hi guys,

Another application that is also open source. This one is a 'wip' as I've not had time to test out any other table -> data file structures yet. But it does work with cq_itemtype -> itemtype.dat. However you do need to make some modifications to your cq_itemtype table.

The application comes with a 'ItemtypeStructure.ini' file, which defines how the Itemtype is structured. This structure I made according to the best of my knowledge and added fields (although unused) that I believe to exist.

Before using this app you should make sure you cq_itemtype matches this:

Use Navicat and right click cq_itemtype and choose 'design table' make sure the fields are in the correct order too if you wish to use my structure file.

Code:
Primary Key = id
Allow Null = NONE
Decimals = 0 FOR ALL

Field Name	|Type		|Length	|Signed/Unsigned|Default Value
----------------+---------------+-------+---------------+-------------
id		|int		|4	|Unsigned	|0
name		|char		|16	|N/A		|Empty String
req_profession	|tinyint	|1	|Unsigned	|0
level		|tinyint	|1	|Unsigned	|0
req_level	|tinyint	|1	|Unsigned	|0
req_sex		|tinyint	|1	|Unsigned	|0
req_force	|smallint	|2	|Unsigned	|0
req_dex		|smallint	|2	|Unsigned	|0
req_health	|smallint	|2	|Unsigned	|0
req_soul	|smallint	|2	|Unsigned	|0
monopoly	|tinyint	|1	|Unsigned	|0
weight		|smallint	|2	|Unsigned	|0
price		|int		|4	|Unsigned	|0
id_action	|int		|4	|Unsigned	|0
attack_max	|smallint	|2	|Unsigned	|0
attack_min	|smallint	|2	|Unsigned	|0
defense		|smallint	|2	|Unsigned	|0
magic_atk_min	|smallint	|2	|Unsigned	|0
dodge		|smallint	|2	|Signed		|0
life		|smallint	|2	|Signed		|0
mana		|smallint	|2	|Signed		|0
amount		|smallint	|2	|Unsigned	|0
amount_limit	|smallint	|2	|Unsigned	|0
ident		|tinyint	|1	|Unsigned	|0
gem1		|tinyint	|1	|Unsigned	|0
gem2		|tinyint	|1	|Unsigned	|0
magic1		|tinyint	|1	|Unsigned	|0
magic2		|tinyint	|1	|Unsigned	|0
magic3		|tinyint	|1	|Unsigned	|0
magic_atk_max	|smallint	|2	|Unsigned	|0
magic_def	|smallint	|2	|Unsigned	|0
atk_range	|smallint	|2	|Unsigned	|0
atk_speed	|smallint	|2	|Unsigned	|0
hitrate		|int		|4	|Unsigned	|0
monster_type	|int		|4	|Unsigned	|0
target		|smallint	|2	|Unsigned	|0
able_mask	|tinyint	|1	|Unsigned	|0
exp_type	|tinyint	|1	|Unsigned	|0
emoney		|int		|4	|Unsigned	|0
official1	|smallint	|2	|Unsigned	|0
official2	|smallint	|2	|Unsigned	|0
official3	|smallint	|2	|Unsigned	|0
official4	|smallint	|2	|Unsigned	|0
official5	|smallint	|2	|Unsigned	|0
official6	|smallint	|2	|Unsigned	|0
official7	|smallint	|2	|Unsigned	|0
official8	|smallint	|2	|Unsigned	|0
official9	|smallint	|2	|Unsigned	|0
official10	|smallint	|2	|Unsigned	|0
official11	|smallint	|2	|Unsigned	|0
official12	|smallint	|2	|Unsigned	|0
soul_value	|int		|4	|Unsigned	|0
description	|char		|128	|N/A		|Empty String
How to create Itemtype.dat from new cq_itemtype
Open application
File -> New -> Binary File
Load Text file that has pasted data from your cq_itemtype
Load Structure file (ItemtypeStructure.ini) that was included in the application.rar
Input text that separates field values (%tab represents a tab character and is the default text)
Click 'Create Converted Binary File'
Choose name of the new file, then click save
File is now made

Note
ItemtypeStructure.ini applies to EO as of version approx 1100 (Latest Pserver version)
But in theory this application should be applicable for any other game/application.
I'm posting this thread in CO/EO/ZO sections to see if people that fully understand structures will create their own structure files and get back to me on any errors if encountered.
This source is fully open source, but also note that only [Only registered and activated users can see links. Click Here To Register...] and [Only registered and activated users can see links. Click Here To Register...] have permission to post any kind of copies of this application and/or source files.

Thanks,
funhacker

Important Update:
Please note I hadn't fully tested the table design I had placed. It screwed with the data when items are dropped in game.
So I've removed the 'luck' field, this also showed a minor flaw in the programming which is now fixed.
So please re-download the application.rar for the new .exe and the itemtypestructure.
04/04/2012 15:03 zombaxcrop#2
Nice realease dude btw why your itemtypeeditor application when im using it and after item reach 5000 description become [Only registered and activated users can see links. Click Here To Register...] .com ? can you explain about that?
04/04/2012 15:29 grey97#3
Nice Release !! Thanks .. Going tu push thaT THANKS Button :D
04/04/2012 17:51 corey88#4
"Load Text file that has pasted data from your cq_itemtype"
I Don't understeand it..
04/04/2012 19:24 cruey#5
Well done, im impressed :)
04/04/2012 20:36 funhacker#6
Quote:
Originally Posted by zombaxcrop View Post
Nice realease dude btw why your itemtypeeditor application when im using it and after item reach 5000 description become [Only registered and activated users can see links. Click Here To Register...] .com ? can you explain about that?
That's part of the application.
This one however is 100% add free and open source

Quote:
Originally Posted by corey88 View Post
"Load Text file that has pasted data from your cq_itemtype"
I Don't understeand it..
You just have to select all the fields in your cq_itemtype and copy them, then make a text file and paste all the copied data into it.
This is the text file that you will load.



Important Update:
Please note I hadn't fully tested the table design I had placed. It screwed with the data when items are dropped in game.
So I've removed the 'luck' field, this also showed a minor flaw in the programming which is now fixed.
So please re-download the application.rar for the new .exe and the itemtypestructure.
04/05/2012 00:47 linja12#7
Well Done. Its much easier If Itemtype.dat convert to cq_itemtype. because Need time to make new description.
04/05/2012 01:41 funhacker#8
Quote:
Originally Posted by linja12 View Post
Well Done. Its much easier If Itemtype.dat convert to cq_itemtype. because Need time to make new description.
I'll work on a little app that will extract all the descriptions for you and create a sql file

Edit: please note the thread: [Only registered and activated users can see links. Click Here To Register...]
04/06/2012 17:18 linja12#9
FUnhacker. This Aplication not work for me. Im Already setting it right. can help?
04/07/2012 01:58 funhacker#10
Quote:
Originally Posted by linja12 View Post
FUnhacker. This Aplication not work for me. Im Already setting it right. can help?
Care to elaborate?
04/07/2012 02:21 Eurion#11
Not sure about them, but I know I get a null exception error after it runs for a few seconds. I am pretty sure I modified the table correctly, but It could be me too.

edit
The error I get is

Code:
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at cq_itemtypeToItemtypeDat.Itemtype.GetBytes(Field field)
   at cq_itemtypeToItemtypeDat.Itemtype.SaveDatFile(String fileName)
   at cq_itemtypeToItemtypeDat.FormBinaryFile.btnCreate_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.235 (RTMGDR.030319-2300)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
cq_itemtypeToItemtypeDat
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/MentalGaming/Desktop/EoStuff/TableConverter/cq_itemtypeToItemtypeDat/bin/Release/app/cq_itemtypeToItemtypeDat.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.235 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.232 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Data.InputOutput
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/MentalGaming/Desktop/EoStuff/TableConverter/cq_itemtypeToItemtypeDat/bin/Release/app/Data.InputOutput.DLL
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
04/07/2012 13:14 funhacker#12
Quote:
Originally Posted by Eurion View Post
Not sure about them, but I know I get a null exception error after it runs for a few seconds. I am pretty sure I modified the table correctly, but It could be me too.

edit
The error I get is

Code:
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at cq_itemtypeToItemtypeDat.Itemtype.GetBytes(Field field)
   at cq_itemtypeToItemtypeDat.Itemtype.SaveDatFile(String fileName)
   at cq_itemtypeToItemtypeDat.FormBinaryFile.btnCreate_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.235 (RTMGDR.030319-2300)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
cq_itemtypeToItemtypeDat
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/MentalGaming/Desktop/EoStuff/TableConverter/cq_itemtypeToItemtypeDat/bin/Release/app/cq_itemtypeToItemtypeDat.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.235 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.232 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Data.InputOutput
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/MentalGaming/Desktop/EoStuff/TableConverter/cq_itemtypeToItemtypeDat/bin/Release/app/Data.InputOutput.DLL
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
This could possibly occur when there is no description at all
04/07/2012 13:27 Eurion#13
Never thought of that, I will test it out when I get up and let you know :)

Edit
After re-doing the entire table, making sure there were no blank entries at all, checking the .txt file to make sure there were no blank lines, and getting rid of all Chinese from the files. I am still getting the null exception error.

I opened the itemtype.dat that it did create and it seems to be hanging at around entry 1889. So I checked that line and the ones previous to it and after it, they all seem alright. Any more ideas you can think of funhacker?
04/08/2012 10:43 funhacker#14
Quote:
Originally Posted by Eurion View Post
Never thought of that, I will test it out when I get up and let you know :)

Edit
After re-doing the entire table, making sure there were no blank entries at all, checking the .txt file to make sure there were no blank lines, and getting rid of all Chinese from the files. I am still getting the null exception error.

I opened the itemtype.dat that it did create and it seems to be hanging at around entry 1889. So I checked that line and the ones previous to it and after it, they all seem alright. Any more ideas you can think of funhacker?
Did you sent format types correctly in your table?
If a field has invalid values it will most likely null the field..
When I'm feeling better I will make some changes to avoid this occurring, sorry..
04/08/2012 13:03 Eurion#15
Quote:
Originally Posted by funhacker View Post
Did you sent format types correctly in your table?
If a field has invalid values it will most likely null the field..
When I'm feeling better I will make some changes to avoid this occurring, sorry..
Yes I did, I made a copy of the cq_itemtype and modified it so it was identical to your table layout in the first post. I will await an update when you're feeling better, no rush :)



Edit

I finally got it to work correctly, I think it was an error on my side all along.

For anyone else having issues. What I did to fix it was remove all special characters such as ` and ' also make sure there aren't any spaces in the name or description area.