Skill Viewer by Wisatek
#11

[highlight=csharp]

public static List LoadFromFile(string FileName, int Version)

{

 

List skills = new List();

 

System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();

 

 

using (BinaryReader b = new BinaryReader(File.Open(FileName, FileMode.Open)))

{

 

int lastid = b.ReadInt32();

 

 

while (b.BaseStream.Position

{

 

cSkill temp = new cSkill();

 

if (Version == 2012)

{

 

temp.SkillID = SkillID;

temp.Class = b.ReadInt32();

temp.Job = b.ReadInt32();

temp.Pet = b.ReadInt32();

temp.Name = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.Type = b.ReadByte();

temp.Flag = b.ReadInt32();

temp.SorcFlag = b.ReadInt32();

temp.Levels = b.ReadByte();

temp.AppRange = b.ReadSingle();

temp.FireRange = b.ReadSingle();

temp.FireRange2 = b.ReadSingle();

temp.TargetType = b.ReadByte();

temp.TargetNum = b.ReadByte();

temp.UseState = b.ReadInt32();

temp.WeaponType = b.ReadInt32();

temp.WeaponType2 = b.ReadInt32();

temp.MagicIndex1 = b.ReadInt32();

temp.MagicLevel1 = b.ReadByte();

temp.MagicIndex2 = b.ReadInt32();

temp.MagicLevel2 = b.ReadByte();

temp.MagicIndex3 = b.ReadInt32();

temp.MagicLevel3 = b.ReadByte();

temp.Unknown1 = b.ReadInt32();

temp.UseKind = b.ReadInt32();

temp.ReadyTime = b.ReadInt32();

temp.StillTime = b.ReadInt32();

temp.FireTime = b.ReadInt32();

temp.CoolTime = b.ReadInt32();

temp.a_ready_animation = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.a_ready_effect = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.a_still_animation = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.a_fire_animation = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.a_fire_effect1 = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.a_fire_effect2 = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.a_fire_effect3 = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.a_fire_object_type = b.ReadByte();

temp.a_fire_object_speed = b.ReadSingle();

temp.a_fire_object_x = b.ReadSingle();

temp.a_fire_object_z = b.ReadSingle();

temp.a_fire_object_h = b.ReadSingle();

temp.a_fire_object_coord = b.ReadByte();

temp.a_fire_object_delay_count = b.ReadByte();

temp.a_fire_object_delay0 = b.ReadSingle();

temp.a_fire_object_delay1 = b.ReadSingle();

temp.a_fire_object_delay2 = b.ReadSingle();

temp.a_fire_object_delay3 = b.ReadSingle();

temp.a_fire_dest_animation = b.ReadSingle();

temp.b_ready_animation = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.b_ready_effect = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.b_still_animation = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.b_fire_animation = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.b_fire_effect1 = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.b_fire_effect2 = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.b_fire_effect3 = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.b_fire_object_type = b.ReadByte();

temp.b_fire_object_speed = b.ReadSingle();

temp.b_fire_object_x = b.ReadSingle();

temp.b_fire_object_z = b.ReadSingle();

temp.b_fire_object_h = b.ReadSingle();

temp.b_fire_object_coord = b.ReadByte();

temp.b_fire_object_delay_count = b.ReadByte();

temp.b_fire_object_delay0 = b.ReadSingle();

temp.b_fire_object_delay1 = b.ReadSingle();

temp.b_fire_object_delay2 = b.ReadSingle();

temp.b_fire_object_delay3 = b.ReadSingle();

temp.b_fire_dest_animation = b.ReadSingle();

temp.ExtraEffect = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.descr = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.tooltip = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.tex_id = b.ReadInt32();

temp.tex_row = b.ReadInt32();

temp.tex_col = b.ReadInt32();

 

 

temp.LevelData = new cSkillLevel[temp.Levels];

 

for (byte lvl = 1; lvl

{

 

cSkillLevel temp2 = temp.LevelData[lvl];

 

temp2.SkillID = SkillID;

temp2.Level = lvl;

 

temp2.Need_HP = b.ReadInt32();

temp2.Need_MP = b.ReadInt32();

temp2.Need_GP = b.ReadInt32();

temp2.DureTime = b.ReadInt32();

temp2.Power = b.ReadInt32();

temp2.Use_Item1_Id = b.ReadInt32();

temp2.Use_Item1_Amount = b.ReadInt32();

temp2.Use_Item2_Id = b.ReadInt32();

temp2.Use_Item2_Amount = b.ReadInt32();

temp2.Need_Level = b.ReadInt32();

temp2.Need_SP = b.ReadInt32();

temp2.Need_Skill1_Id = b.ReadInt32();

temp2.Need_Skill1_Level = b.ReadByte();

temp2.Need_Skill2_Id = b.ReadInt32();

temp2.Need_Skill2_Level = b.ReadByte();

temp2.Need_Skill3_Id = b.ReadInt32();

temp2.Need_Skill3_Level = b.ReadByte();

temp2.Need_Item1_Id = b.ReadInt32();

temp2.Need_Item1_Amount = b.ReadInt32();

temp2.Need_Item2_Id = b.ReadInt32();

temp2.Need_Item2_Amount = b.ReadInt32();

temp2.Need_Item3_Id = b.ReadInt32();

temp2.Need_Item3_Amount = b.ReadInt32();

temp2.Need_Strength = b.ReadInt32();

temp2.Need_Dexterity = b.ReadInt32();

temp2.Need_Intelligence = b.ReadInt32();

temp2.Need_Constitution = b.ReadInt32();

temp2.App_Magic1_Id = b.ReadInt32();

temp2.App_Magic1_Level = b.ReadByte();

temp2.App_Magic2_Id = b.ReadInt32();

temp2.App_Magic2_Level = b.ReadByte();

temp2.App_Magic3_Id = b.ReadInt32();

temp2.App_Magic3_Level = b.ReadByte();

temp2.Magic1_Id = b.ReadInt32();

temp2.Magic1_Level = b.ReadByte();

temp2.Magic2_Id = b.ReadInt32();

temp2.Magic2_Level = b.ReadByte();

temp2.Magic3_Id = b.ReadInt32();

temp2.Magic3_Level = b.ReadByte();

temp2.Learn_GP = b.ReadInt32();

 

 

}

}

 

 

 

 

if (Version == 2008)

{

int SkillID = b.ReadInt32();

temp.SkillID = SkillID;

temp.Class = b.ReadInt32();

temp.Job = b.ReadInt32();

temp.Pet = b.ReadInt32();

temp.Name = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.Type = b.ReadByte();

temp.Flag = b.ReadInt32();

temp.SorcFlag = b.ReadInt32();

temp.Levels = b.ReadByte();

temp.AppRange = b.ReadSingle();

temp.FireRange = b.ReadSingle();

temp.FireRange2 = b.ReadSingle();

temp.TargetType = b.ReadByte();

temp.TargetNum = b.ReadByte();

temp.UseState = b.ReadInt32();

temp.WeaponType = b.ReadInt32();

temp.WeaponType2 = b.ReadInt32();

temp.MagicIndex1 = b.ReadInt32();

temp.MagicLevel1 = b.ReadByte();

temp.MagicIndex2 = b.ReadInt32();

temp.MagicLevel2 = b.ReadByte();

temp.MagicIndex3 = b.ReadInt32();

temp.MagicLevel3 = b.ReadByte();

temp.Unknown1 = 0;

temp.UseKind = b.ReadInt32();

temp.ReadyTime = b.ReadInt32();

temp.StillTime = b.ReadInt32();

temp.FireTime = b.ReadInt32();

temp.CoolTime = b.ReadInt32();

temp.a_ready_animation = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.a_ready_effect = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.a_still_animation = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.a_fire_animation = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.a_fire_effect1 = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.a_fire_effect2 = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.a_fire_effect3 = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.a_fire_object_type = b.ReadByte();

temp.a_fire_object_speed = b.ReadSingle();

temp.a_fire_object_x = b.ReadSingle();

temp.a_fire_object_z = b.ReadSingle();

temp.a_fire_object_h = b.ReadSingle();

temp.a_fire_object_coord = b.ReadByte();

temp.a_fire_object_delay_count = b.ReadByte();

temp.a_fire_object_delay0 = b.ReadSingle();

temp.a_fire_object_delay1 = b.ReadSingle();

temp.a_fire_object_delay2 = b.ReadSingle();

temp.a_fire_object_delay3 = b.ReadSingle();

temp.a_fire_dest_animation = b.ReadSingle();

temp.b_ready_animation = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.b_ready_effect = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.b_still_animation = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.b_fire_animation = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.b_fire_effect1 = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.b_fire_effect2 = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.b_fire_effect3 = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.b_fire_object_type = b.ReadByte();

temp.b_fire_object_speed = b.ReadSingle();

temp.b_fire_object_x = b.ReadSingle();

temp.b_fire_object_z = b.ReadSingle();

temp.b_fire_object_h = b.ReadSingle();

temp.b_fire_object_coord = b.ReadByte();

temp.b_fire_object_delay_count = b.ReadByte();

temp.b_fire_object_delay0 = b.ReadSingle();

temp.b_fire_object_delay1 = b.ReadSingle();

temp.b_fire_object_delay2 = b.ReadSingle();

temp.b_fire_object_delay3 = b.ReadSingle();

temp.b_fire_dest_animation = b.ReadSingle();

temp.ExtraEffect = "";

temp.descr = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.tooltip = enc.GetString(b.ReadBytes(b.ReadInt32()));

temp.tex_id = b.ReadInt32();

temp.tex_row = b.ReadInt32();

temp.tex_col = b.ReadInt32();

 

 

temp.LevelData = new cSkillLevel[temp.Levels];

for (byte lvl = 1; lvl

{

 

cSkillLevel temp2 = temp.LevelData[lvl];

 

temp2.SkillID = SkillID;

temp2.Level = lvl;

temp2.Need_HP = b.ReadInt32();

temp2.Need_MP = b.ReadInt32();

temp2.Need_GP = 0;

temp2.DureTime = b.ReadInt32();

temp2.Power = b.ReadInt32();

temp2.Use_Item1_Id = b.ReadInt32();

temp2.Use_Item1_Amount = b.ReadInt32();

temp2.Use_Item2_Id = b.ReadInt32();

temp2.Use_Item2_Amount = b.ReadInt32();

temp2.Need_Level = b.ReadInt32();

temp2.Need_SP = b.ReadInt32();

temp2.Need_Skill1_Id = b.ReadInt32();

temp2.Need_Skill1_Level = b.ReadByte();

temp2.Need_Skill2_Id = b.ReadInt32();

temp2.Need_Skill2_Level = b.ReadByte();

temp2.Need_Skill3_Id = b.ReadInt32();

temp2.Need_Skill3_Level = b.ReadByte();

temp2.Need_Item1_Id = b.ReadInt32();

temp2.Need_Item1_Amount = b.ReadInt32();

temp2.Need_Item2_Id = b.ReadInt32();

temp2.Need_Item2_Amount = b.ReadInt32();

temp2.Need_Item3_Id = b.ReadInt32();

temp2.Need_Item3_Amount = b.ReadInt32();

temp2.Need_Strength = b.ReadInt32();

temp2.Need_Dexterity = b.ReadInt32();

temp2.Need_Intelligence = b.ReadInt32();

temp2.Need_Constitution = b.ReadInt32();

temp2.App_Magic1_Id = b.ReadInt32();

temp2.App_Magic1_Level = b.ReadByte();

temp2.App_Magic2_Id = b.ReadInt32();

temp2.App_Magic2_Level = b.ReadByte();

temp2.App_Magic3_Id = b.ReadInt32();

temp2.App_Magic3_Level = b.ReadByte();

temp2.Magic1_Id = b.ReadInt32();

temp2.Magic1_Level = b.ReadByte();

temp2.Magic2_Id = b.ReadInt32();

temp2.Magic2_Level = b.ReadByte();

temp2.Magic3_Id = b.ReadInt32();

temp2.Magic3_Level = b.ReadByte();

temp2.Learn_GP = b.ReadInt32();

 

}

}

 

 

 

skills.Add(temp);

 

 

 

}

 

b.Close();

 

 

}

 

return skills;

 

}

[/highlight]

 

Enjoy Tongue



Messages In This Thread
[No subject] - by Aquilis - 09-29-2011, 01:31 PM
[No subject] - by Wizatek - 09-29-2011, 02:51 PM
[No subject] - by Aquilis - 09-29-2011, 03:06 PM
[No subject] - by Wizatek - 09-29-2011, 03:35 PM
[No subject] - by Infinity - 09-29-2011, 06:47 PM
[No subject] - by Wrong - 12-26-2011, 03:02 AM
[No subject] - by slayer1 - 02-03-2012, 10:15 PM
[No subject] - by Kenpachi - 02-12-2012, 08:57 PM
[No subject] - by illusionist - 02-12-2012, 09:10 PM
[No subject] - by Kenpachi - 02-12-2012, 09:14 PM
[No subject] - by Wizatek - 02-12-2012, 10:26 PM
[No subject] - by Kenpachi - 02-12-2012, 10:33 PM
[No subject] - by illusionist - 02-13-2012, 02:12 PM
[No subject] - by Infinity - 02-13-2012, 08:08 PM
[No subject] - by Wrong - 02-13-2012, 08:21 PM
[No subject] - by Infinity - 02-13-2012, 08:25 PM
[No subject] - by DeChamp3 - 02-18-2012, 08:10 PM
[No subject] - by deathii - 03-16-2012, 12:54 PM
[No subject] - by rdrago - 03-16-2012, 11:22 PM
[No subject] - by deathii - 03-17-2012, 03:51 AM
[No subject] - by deathii - 03-17-2012, 11:16 AM
[No subject] - by deathii - 03-19-2012, 06:05 AM
[No subject] - by iFlash - 03-19-2012, 09:17 PM
[No subject] - by slayer1 - 06-07-2012, 09:40 PM
[No subject] - by someone - 06-07-2012, 11:24 PM
[No subject] - by slayer1 - 06-07-2012, 11:30 PM
[No subject] - by slayer1 - 06-07-2012, 11:58 PM
[No subject] - by yurofx - 06-21-2012, 07:10 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)