Well since the source downgrading progress ran into some problems (client closing as soon as other entities appeared) and I couldn't fix it, I decided to mess around with something else that has always bothered me; the magictype.dat for lower patches.
This is the code I have for converting the MagicType.dat to MagicType.txt:
Code:
private void button2_Click(object sender, EventArgs e)
{
IniFile Ini = new IniFile("./Config.ini");
ConquerPath = Ini.ReadString("Config", "ConquerPath", "");
OutputPath = Ini.ReadString("Config", "OutputPath", "");
StreamWriter Writer = new StreamWriter(new FileStream(OutputPath + @"MagicType.txt", FileMode.Create));
using (BinaryReader Reader = new BinaryReader(new FileStream(ConquerPath + @"MagicType.dat", FileMode.Open)))
{
int TotalSpells = Reader.ReadInt32();
for (int i = 0; i < TotalSpells; i++)
{
Writer.WriteLine(Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Encoding.ASCII.GetString(Reader.ReadBytes(16)) + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Encoding.ASCII.GetString(Reader.ReadBytes(64)) + " " +
Encoding.ASCII.GetString(Reader.ReadBytes(256)) + " " +
Encoding.ASCII.GetString(Reader.ReadBytes(64)) + " " +
Encoding.ASCII.GetString(Reader.ReadBytes(260)) + " " +
Encoding.ASCII.GetString(Reader.ReadBytes(64)) + " " +
Encoding.ASCII.GetString(Reader.ReadBytes(260)) + " " +
Reader.ReadInt32() + " " +
Encoding.ASCII.GetString(Reader.ReadBytes(64)) + " " +
Encoding.ASCII.GetString(Reader.ReadBytes(260)) + " " +
Encoding.ASCII.GetString(Reader.ReadBytes(64)) + " " +
Encoding.ASCII.GetString(Reader.ReadBytes(64)) + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32() + " " +
Reader.ReadInt32());
}
MessageBox.Show("Finished");
}
Writer.Flush();
Writer.Close();
}
It's based on this post:
Quote:
Originally Posted by nTL3fTy
Magictype.dat structure:
| datatype | name | | int | amount | | uint[amount] | id | | MagicType[amount] | magictypes |
MagicType structure:
| datatype | name | | uint | type | | uint | sort | | byte[16] | name | | uint | crime | | uint | ground | | uint | multi | | uint | target | | uint | level | | uint | use_mp | | int | power | | uint | intone_duration | | uint | percent | | uint | duration | | uint | range | | uint | distance | | uint | status | | uint | req_profession | | int | req_exp | | uint | req_level | | uint | use_xp | | uint | weapon_subtype | | uint | active_times | | uint | auto_active | | uint | floor_attr | | uint | auto_learn | | uint | learn_level | | uint | drop_weapon | | uint | use_stamina | | uint | weapon_hit | | uint | use_item | | uint | next_magic | | uint | delay | | uint | use_item_num | | uint | sender_action | | byte[64] | description | | byte[256] | description_ex | | byte[64] | intone_effect | | byte[260] | intone_sound | | byte[64] | sender_effect | | byte[260] | sender_sound | | uint | target_delay | | byte[64] | target_effect | | byte[260] | target_sound | | byte[64] | ground_effect | | byte[64] | trace_effect | | uint | screen_represent | | uint | use_in_market | | uint | target_wound_delay |
I believe this should be all you need to parse the file. The id mentioned in the beginning of the file is type*10+level. With that information, you can build a dictionary.
|
But I probably applied it in the wrong way since the result is quite odd, I attached it to this post.
Any help?