Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[DEV] Opening skill_usa.bin

Status
Not open for further replies.
Banned
Banned
Joined
Apr 29, 2008
Messages
713
Reaction score
264
How would I go about properly reading all the data within this file?
 
[B]aSH
Loyal Member
Joined
Apr 2, 2009
Messages
1,138
Reaction score
371
Re: Opening skill_usa.bin

Hex Editor would be a start or possibly making your own tool to read and display the information?

Experienced with parsing and C++ or C#?
 
Newbie Spellweaver
Joined
Apr 23, 2011
Messages
65
Reaction score
18
Re: Opening skill_usa.bin

You can use wizatek's skillviewer but you cant edit it with yet, but it shows the right info needed to add new skills.
 
Banned
Banned
Joined
Apr 29, 2008
Messages
713
Reaction score
264
Re: Opening skill_usa.bin

You can use wizatek's skillviewer but you cant edit it with yet, but it shows the right info needed to add new skills.

Looking how to open it and read its contents. Not looking how to open it itself, but more along the lines of how to extract the data from it.
 
Experienced Elementalist
Joined
Jul 13, 2008
Messages
272
Reaction score
136
Re: Opening skill_usa.bin

PHP:
    class Skills
    {

        public static List<SkillsList> SkillList = new List<SkillsList>();
        public static List<SkillsLevel> SkillLevels = new List<SkillsLevel>();
        

        public static bool LoadFromFile(string FileName)
        {

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

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

                    int lastid = b.ReadInt32();


                    while (b.BaseStream.Position < b.BaseStream.Length)
                    {

                        SkillsList temp = new SkillsList();

                        int SkillID = b.ReadInt32();
                        temp.SkillID = SkillID;
                        temp.Class = b.ReadInt32();
                        temp.Job = b.ReadInt32();
                        temp.Pet = b.ReadInt32();
                        temp.Name = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.Type = b.ReadByte();
                        temp.Flag = b.ReadInt32();
                        temp.SorcFlag = b.ReadInt32();
                        byte Levels = b.ReadByte();
                        temp.Levels = Levels;
                        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 = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.a_ready_effect = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.a_still_animation = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.a_fire_animation = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.a_fire_effect1 = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.a_fire_effect2 = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.a_fire_effect3 = C.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 = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.b_ready_effect = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.b_still_animation = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.b_fire_animation = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.b_fire_effect1 = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.b_fire_effect2 = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.b_fire_effect3 = C.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 = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.descr = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.tooltip = C.GetString(b.ReadBytes(b.ReadInt32()));
                        temp.tex_id = b.ReadInt32();
                        temp.tex_row = b.ReadInt32();
                        temp.tex_col = b.ReadInt32();


                        SkillList.Add(temp);
                        

                        for (byte lvl = 1; lvl <= Levels; lvl++)
                        {

                            SkillsLevel temp2 = new SkillsLevel();

                            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();

                            SkillLevels.Add(temp2);

                        }

                    }


                }

                return true;
            }
            catch(Exception e)
            {
                MessageBox.Show(e.ToString());

                return false;
            }


        }
}

    public class SkillsList
    {
        public int SkillID { get; set; }
        public int Class { get; set; }
        public int Job { get; set; }
        public int Pet { get; set; }
        public string Name { get; set; }
        public byte Type { get; set; }
        public int Flag { get; set; }
        public int SorcFlag { get; set; }
        public byte Levels { get; set; }
        public float AppRange { get; set; }
        public float FireRange { get; set; }
        public float FireRange2 { get; set; }
        public byte TargetType { get; set; }
        public byte TargetNum { get; set; }
        public int UseState { get; set; }
        public int WeaponType { get; set; }
        public int WeaponType2 { get; set; }
        public int MagicIndex1 { get; set; }
        public int MagicIndex2 { get; set; }
        public int MagicIndex3 { get; set; }
        public byte MagicLevel1 { get; set; }
        public byte MagicLevel2 { get; set; }
        public byte MagicLevel3 { get; set; }
        public int Unknown1 { get; set; }
        public int UseKind { get; set; }
        public int ReadyTime { get; set; }
        public int StillTime { get; set; }
        public int FireTime { get; set; }
        public int CoolTime { get; set; }
        public string a_ready_animation { get; set; }
        public string a_ready_effect { get; set; }
        public string a_still_animation { get; set; }
        public string a_fire_animation { get; set; }
        public string a_fire_effect1 { get; set; }
        public string a_fire_effect2 { get; set; }
        public string a_fire_effect3 { get; set; }
        public byte a_fire_object_type { get; set; }
        public float a_fire_object_speed { get; set; }
        public float a_fire_object_x { get; set; }
        public float a_fire_object_z { get; set; }
        public float a_fire_object_h { get; set; }
        public byte a_fire_object_coord { get; set; }
        public byte a_fire_object_delay_count { get; set; }
        public float a_fire_object_delay0 { get; set; }
        public float a_fire_object_delay1 { get; set; }
        public float a_fire_object_delay2 { get; set; }
        public float a_fire_object_delay3 { get; set; }
        public float a_fire_dest_animation { get; set; }
        public string b_ready_animation { get; set; }
        public string b_ready_effect { get; set; }
        public string b_still_animation { get; set; }
        public string b_fire_animation { get; set; }
        public string b_fire_effect1 { get; set; }
        public string b_fire_effect2 { get; set; }
        public string b_fire_effect3 { get; set; }
        public byte b_fire_object_type { get; set; }
        public float b_fire_object_speed { get; set; }
        public float b_fire_object_x { get; set; }
        public float b_fire_object_z { get; set; }
        public float b_fire_object_h { get; set; }
        public byte b_fire_object_coord { get; set; }
        public byte b_fire_object_delay_count { get; set; }
        public float b_fire_object_delay0 { get; set; }
        public float b_fire_object_delay1 { get; set; }
        public float b_fire_object_delay2 { get; set; }
        public float b_fire_object_delay3 { get; set; }
        public float b_fire_dest_animation { get; set; }
        public string ExtraEffect { get; set; }
        public string descr { get; set; }
        public string tooltip { get; set; }
        public int tex_id { get; set; }
        public int tex_row { get; set; }
        public int tex_col { get; set; }

    }

    public class SkillsLevel
    {

        public int SkillID { get; set; }
        public byte Level { get; set; }
        public int Need_HP { get; set; }
        public int Need_MP { get; set; }
        public int Need_GP { get; set; }
        public int DureTime { get; set; }
        public int Power { get; set; }
        public int Use_Item1_Id { get; set; }
        public int Use_Item2_Id { get; set; }
        public int Use_Item1_Amount { get; set; }
        public int Use_Item2_Amount { get; set; }
        public int Need_Level { get; set; }
        public int Need_SP { get; set; }
        public int Need_Skill1_Id { get; set; }
        public int Need_Skill2_Id { get; set; }
        public int Need_Skill3_Id { get; set; }
        public byte Need_Skill1_Level { get; set; }
        public byte Need_Skill2_Level { get; set; }
        public byte Need_Skill3_Level { get; set; }
        public int Need_Item1_Id { get; set; }
        public int Need_Item2_Id { get; set; }
        public int Need_Item3_Id { get; set; }
        public int Need_Item1_Amount { get; set; }
        public int Need_Item2_Amount { get; set; }
        public int Need_Item3_Amount { get; set; }
        public int Need_Strength { get; set; }
        public int Need_Dexterity { get; set; }
        public int Need_Intelligence { get; set; }
        public int Need_Constitution { get; set; }
        public int App_Magic1_Id { get; set; }
        public int App_Magic2_Id { get; set; }
        public int App_Magic3_Id { get; set; }
        public byte App_Magic1_Level { get; set; }
        public byte App_Magic2_Level { get; set; }
        public byte App_Magic3_Level { get; set; }
        public int Magic1_Id { get; set; }
        public int Magic2_Id { get; set; }
        public int Magic3_Id { get; set; }
        public byte Magic1_Level { get; set; }
        public byte Magic2_Level { get; set; }
        public byte Magic3_Level { get; set; }
        public int Learn_GP { get; set; }



    }
Then u can simply load the file with
PHP:
Skills.LoadFromFile("pathtofile");
And u can get the skillinfo easy
PHP:
int i = Skills.SkillsList.FindIndex(p => p.SkillID == id);

Skills.SkillsList[i].anyhinguneed
Thats in C# but it wouldn't be that different in another language i guess
 
Last edited:
Status
Not open for further replies.
Back
Top