Exemplo n.º 1
0
 public override L2DatDefinition ParseMain(BinaryReader f, int RecNo)
 {
     L2DatDefinition ret = new L2DatDefinition();
     if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone2_4_Epilogue)
     {
         NpcgrpInfo_CT2_4 info = new NpcgrpInfo_CT2_4();
         info.InitFieldValues();
         info = (NpcgrpInfo_CT2_4)base.ReadFieldValue(f, info, "tag", "UNK_1");
         if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone2_5_Freya)
             info = (NpcgrpInfo_CT2_4)base.ReadFieldValue(f, info, "UNK_2");
         info = (NpcgrpInfo_CT2_4)base.ReadFieldValue(f, info, "effect", "npcend");
         if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone2_6_HighFive)
             info = (NpcgrpInfo_CT2_4)base.ReadFieldValue(f, info, "UNK_4");
         ret = info;
     }
     else
     {
         NpcgrpInfo info = new NpcgrpInfo();
         info = (NpcgrpInfo)base.ReadFieldValue(f, info, "tag", "npc_speed");
         if (Program.main_form.selectedDatVersion >= DatVersion.Chronicle5)
             info = (NpcgrpInfo)base.ReadFieldValue(f, info, "UNK_0_NEW");
         else
             info = (NpcgrpInfo)base.ReadFieldValue(f, info, "UNK_0_OLD");
         info = (NpcgrpInfo)base.ReadFieldValue(f, info, "snd1", "snd3");
         if (Program.main_form.selectedDatVersion >= DatVersion.Interlude)
         {
             info = (NpcgrpInfo)base.ReadFieldValue(f, info, "rb_effect_on");
             if (info.rb_effect_on == 1)
                 info = (NpcgrpInfo)base.ReadFieldValue(f, info, "rb_effect", "rb_effect_fl");
         }
         if (Program.main_form.selectedDatVersion >= DatVersion.Chronicle5)
             info = (NpcgrpInfo)base.ReadFieldValue(f, info, "UNK_1_NEW");
         else
             info = (NpcgrpInfo)base.ReadFieldValue(f, info, "UNK_1_OLD", "level_lim_up");
         info = (NpcgrpInfo)base.ReadFieldValue(f, info, "effect", "class_lim");
         ret = info;
     }
     return ret;
 }
Exemplo n.º 2
0
 public void WriteFieldValue(BinaryWriter f, L2DatDefinition item, int FNumber)
 {
     String FName = Program.main_form.DatInfo.getFieldNames()[FNumber];
     WriteFieldValue(f, item, FName);
 }
Exemplo n.º 3
0
 public void WriteFieldValue(BinaryWriter f, L2DatDefinition item, String FName)
 {
     try
     {
         FieldInfo FType = Program.main_form.DatInfo.getDefinition().GetType().GetField(FName);
         if (FType.FieldType.FullName.EndsWith("UInt32"))
             f.Write((UInt32)FType.GetValue(item));
         else if (FType.FieldType.FullName.EndsWith("Int32"))
             f.Write((Int32)FType.GetValue(item));
         else if (FType.FieldType.FullName.EndsWith("Single"))
             f.Write((Single)FType.GetValue(item));
         else if (FType.FieldType.FullName.EndsWith("Color"))
             f.Write(((Color)FType.GetValue(item)).ToArgb());
         else if (FType.FieldType.FullName.EndsWith("CNTINT_PAIR"))
             CNTINT_PAIR.Compile(f, (CNTINT_PAIR)FType.GetValue(item));
         else if (FType.FieldType.FullName.EndsWith("CNTRINT_PAIR"))
             CNTRINT_PAIR.Compile(f, (CNTRINT_PAIR)FType.GetValue(item));
         else if (FType.FieldType.FullName.EndsWith("CNTTXT_PAIR"))
             CNTTXT_PAIR.Compile(f, (CNTTXT_PAIR)FType.GetValue(item));
         else if (FType.FieldType.FullName.EndsWith("CNTTXT_PAIR2"))
             CNTTXT_PAIR2.Compile(f, (CNTTXT_PAIR2)FType.GetValue(item));
         else if (FType.FieldType.FullName.EndsWith("CNTASCF_PAIR"))
             CNTASCF_PAIR.Compile(f, (CNTASCF_PAIR)FType.GetValue(item));
         else if (FType.FieldType.FullName.EndsWith("MTX"))
             MTX.Compile(f, (MTX)FType.GetValue(item));
         else if (FType.FieldType.FullName.EndsWith("MTX2"))
             MTX2.Compile(f, (MTX2)FType.GetValue(item));
         else if (FType.FieldType.FullName.EndsWith("MTX3"))
             MTX3.Compile(f, (MTX3)FType.GetValue(item));
         else if (FType.FieldType.FullName.EndsWith("ASCF"))
             ASCF.Compile(f, (ASCF)FType.GetValue(item));
         else if (FType.FieldType.FullName.EndsWith("HEX"))
             HEX.Compile(f, (HEX)FType.GetValue(item));
         else if (FType.FieldType.FullName.EndsWith("UNICODE"))
             UNICODE.Compile(f, (UNICODE)FType.GetValue(item));
         else
         {
             Console.Out.WriteLine("!!!!! [WARNING] !!!!!");
             Console.Out.WriteLine("UnknownFieldType: " + FType.FieldType.FullName);
         }
     }
     catch (Exception ex)
     {
         item.DumpFieldValues();
         ex = new ApplicationException(
             String.Format("Error compiling string file (FieldName: {0} RecordOffset: 0x{1:X})",
                           FName, f.BaseStream.Position), ex);
     }
 }
Exemplo n.º 4
0
 public L2DatDefinition ReadFieldValue(BinaryReader f, L2DatDefinition info, String FName)
 {
     L2DatDefinition TmpInfo = info;
     long curPos = f.BaseStream.Position;
     try
     {
         FieldInfo FType = Program.main_form.DatInfo.getDefinition().GetType().GetField(FName);
         if (FType.FieldType.FullName.EndsWith("UInt32"))
             FType.SetValue(info, f.ReadUInt32());
         else if (FType.FieldType.FullName.EndsWith("Int32"))
             FType.SetValue(info, f.ReadInt32());
         else if (FType.FieldType.FullName.EndsWith("Single"))
             FType.SetValue(info, f.ReadSingle());
         else if (FType.FieldType.FullName.EndsWith("Color"))
             FType.SetValue(info, Color.FromArgb(f.ReadInt32()));
         else if (FType.FieldType.FullName.EndsWith("CNTINT_PAIR"))
             FType.SetValue(info, CNTINT_PAIR.Parse(f));
         else if (FType.FieldType.FullName.EndsWith("CNTRINT_PAIR"))
             FType.SetValue(info, CNTRINT_PAIR.Parse(f));
         else if (FType.FieldType.FullName.EndsWith("CNTTXT_PAIR"))
             FType.SetValue(info, CNTTXT_PAIR.Parse(f));
         else if (FType.FieldType.FullName.EndsWith("CNTTXT_PAIR2"))
             FType.SetValue(info, CNTTXT_PAIR2.Parse(f));
         else if (FType.FieldType.FullName.EndsWith("CNTASCF_PAIR"))
             FType.SetValue(info, CNTASCF_PAIR.Parse(f));
         else if (FType.FieldType.FullName.EndsWith("MTX"))
             FType.SetValue(info, MTX.Parse(f));
         else if (FType.FieldType.FullName.EndsWith("MTX2"))
             FType.SetValue(info, MTX2.Parse(f));
         else if (FType.FieldType.FullName.EndsWith("MTX3"))
             FType.SetValue(info, MTX3.Parse(f));
         else if (FType.FieldType.FullName.EndsWith("ASCF"))
             FType.SetValue(info, ASCF.Parse(f));
         else if (FType.FieldType.FullName.EndsWith("HEX"))
             FType.SetValue(info, HEX.Parse(f));
         else if (FType.FieldType.FullName.EndsWith("UNICODE"))
             FType.SetValue(info, UNICODE.Parse(f));
         else
         {
             Console.Out.WriteLine("!!!!! [WARNING] !!!!!");
             Console.Out.WriteLine("UnknownFieldType: " + FType.FieldType.FullName);
         }
     }
     catch (Exception ex)
     {
         TmpInfo.DumpFieldValues();
         ex = new ApplicationException(
             String.Format("Error parsing string file (FieldName: {0} RecordOffset: 0x{1:X} DumpData: {2})",
                           FName, f.BaseStream.Position, L2DatTool.Debug_DumpString(f, curPos, 8)), ex);
     }
     return info;
 }
Exemplo n.º 5
0
 public void WriteFieldValue(BinaryWriter f, L2DatDefinition info, String FromName, String ToName)
 {
     int startPos = 0, endPos = 0;
     List<String> TmpArr = Program.main_form.DatInfo.getFieldNames();
     for (int i = 0; i < TmpArr.Count; i++)
     {
         if (TmpArr[i] == FromName)
             startPos = i;
         if (TmpArr[i] == ToName)
             endPos = i;
     }
     for (int i = startPos; i <= endPos; i++)
         WriteFieldValue(f, info, i);
 }
Exemplo n.º 6
0
 public virtual L2DatDefinition ParseMain(BinaryReader f, int RecNo)
 {
     L2DatDefinition info = new L2DatDefinition();
     info = Program.main_form.DatInfo.getDefinition();
     List<String> TmpArr = Program.main_form.DatInfo.getFieldNames();
     for (int i = 0; i < TmpArr.Count; i++)
     {
         String FName = TmpArr[i];
         info = ReadFieldValue(f, info, FName);
     }
     return info;
 }
Exemplo n.º 7
0
 public L2DatDefinition ReadFieldValue(BinaryReader f, L2DatDefinition info, int FNumber)
 {
     String FName = Program.main_form.DatInfo.getFieldNames()[FNumber];
     return ReadFieldValue(f, info, FName);
 }
Exemplo n.º 8
0
 public override L2DatDefinition ParseMain(BinaryReader f, int RecNo)
 {
     L2DatDefinition ret = new L2DatDefinition();
     if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone2_3_Final)
     {
         ItemNameInfo_CT3 info = new ItemNameInfo_CT3();
         info = (ItemNameInfo_CT3)base.ReadFieldValue(f, info, "id", "UNK2");
         ret = info;
     }
     else
     {
         ItemNameInfo info = new ItemNameInfo();
         info = (ItemNameInfo)base.ReadFieldValue(f, info, "id", "popup");
         if (Program.main_form.selectedDatVersion >= DatVersion.Chronicle5)
             info = (ItemNameInfo)base.ReadFieldValue(f, info, "set_ids", "special_enchant_desc");
         if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone2_1_Gracia)
             info = (ItemNameInfo)base.ReadFieldValue(f, info, "UNK2");
         ret = info;
     }
     return ret;
 }
Exemplo n.º 9
0
 public virtual void CompileMain(BinaryWriter f, List<L2DatDefinition> infos, int RecNo)
 {
     L2DatDefinition item = new L2DatDefinition();
     item = infos[RecNo];
     List<String> TmpArr = Program.main_form.DatInfo.getFieldNames();
     for (int i = 0; i < TmpArr.Count; i++)
     {
         String FName = TmpArr[i];
         WriteFieldValue(f, item, FName);
     }
 }
Exemplo n.º 10
0
 public override L2DatDefinition ParseMain(BinaryReader f, int RecNo)
 {
     L2DatDefinition ret = new L2DatDefinition();
     if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone1_0_Kamael)
     {
         EtcitemgrpInfo_CT1 info = new EtcitemgrpInfo_CT1();
         info.InitFieldValues();
         info = (EtcitemgrpInfo_CT1)base.ReadFieldValue(f, info, "tag", "drop_tex3");
         if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone2_3_Final)
             info = (EtcitemgrpInfo_CT1)base.ReadFieldValue(f, info, "drop_extratex1", "newdata8");
         info = (EtcitemgrpInfo_CT1)base.ReadFieldValue(f, info, "icon1", "UNK_1");
         if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone1_5_Hellbound)
             info = (EtcitemgrpInfo_CT1)base.ReadFieldValue(f, info, "UNK_2");
         if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone2_1_Gracia)
             info = (EtcitemgrpInfo_CT1)base.ReadFieldValue(f, info, "UNK_3");
         info = (EtcitemgrpInfo_CT1)base.ReadFieldValue(f, info, "fort", "grade");
         ret = info;
     }
     else if (Program.main_form.selectedDatVersion >= DatVersion.Chronicle4)
     {
         EtcitemgrpInfo_C4 info = new EtcitemgrpInfo_C4();
         info = (EtcitemgrpInfo_C4)base.ReadFieldValue(f, info, "tag", "grade");
         ret = info;
     }
     else
     {
         EtcitemgrpInfo info = new EtcitemgrpInfo();
         info = (EtcitemgrpInfo)base.ReadFieldValue(f, info, "tag", "grade");
         ret = info;
     }
     return ret;
 }
Exemplo n.º 11
0
 public override L2DatDefinition ParseMain(BinaryReader f, int RecNo)
 {
     L2DatDefinition ret = new L2DatDefinition();
     if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone1_0_Kamael)
     {
         ChargrpInfo_CT1 info = new ChargrpInfo_CT1();
         //info = (ChargrpInfo_CT1)base.ReadFieldValue(f, info, "START", "END");
         ret = info;
     }
     else
     {
         ChargrpInfo info = new ChargrpInfo();
         info = (ChargrpInfo)base.ReadFieldValue(f, info, "face_icon", "cnt_ft");
         info.hair_mesh = new UNICODE();
         for (int i = 0; i < info.cnt_hm; i++)
         {
             info.hair_mesh.Text += L2DatTool.ReadStringSimple_UnicodeInt32Length(f);
             if (i < info.cnt_hm - 1)
                 info.hair_mesh.Text += ",";
         }
         info.hair_tex = new UNICODE();
         for (int i = 0; i < info.cnt_ht; i++)
         {
             info.hair_tex.Text += L2DatTool.ReadStringSimple_UnicodeInt32Length(f);
             if (i < info.cnt_ht - 1)
                 info.hair_tex.Text += ",";
         }
         info.face_mesh = new UNICODE();
         for (int i = 0; i < info.cnt_fm; i++)
         {
             info.face_mesh.Text += L2DatTool.ReadStringSimple_UnicodeInt32Length(f);
             if (i < info.cnt_fm - 1)
                 info.face_mesh.Text += ",";
         }
         info.face_tex = new UNICODE();
         for (int i = 0; i < info.cnt_ft; i++)
         {
             info.face_tex.Text += L2DatTool.ReadStringSimple_UnicodeInt32Length(f);
             if (i < info.cnt_ft - 1)
                 info.face_tex.Text += ",";
         }
         info = (ChargrpInfo)base.ReadFieldValue(f, info, "body_mesh1", "cnt_dmg");
         info.snd_att = new UNICODE();
         for (int i = 0; i < info.cnt_att; i++)
         {
             info.snd_att.Text += L2DatTool.ReadStringSimple_UnicodeInt32Length(f);
             if (i < info.cnt_att - 1)
                 info.snd_att.Text += ",";
         }
         info.snd_def = new UNICODE();
         for (int i = 0; i < info.cnt_def; i++)
         {
             info.snd_def.Text += L2DatTool.ReadStringSimple_UnicodeInt32Length(f);
             if (i < info.cnt_def - 1)
                 info.snd_def.Text += ",";
         }
         info.snd_dmg = new UNICODE();
         for (int i = 0; i < info.cnt_dmg; i++)
         {
             info.snd_dmg.Text += L2DatTool.ReadStringSimple_UnicodeInt32Length(f);
             if (i < info.cnt_dmg - 1)
                 info.snd_dmg.Text += ",";
         }
         info = (ChargrpInfo)base.ReadFieldValue(f, info, "voice_snd_hand", "voice_snd_fist");
         ret = info;
     }
     return ret;
 }
Exemplo n.º 12
0
 public override L2DatDefinition ParseMain(BinaryReader f, int RecNo)
 {
     L2DatDefinition ret = new L2DatDefinition();
     if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone2_2_Part2)
     {
         ArmorgrpInfo_CT3 info = new ArmorgrpInfo_CT3();
         info.InitFieldValues();
         info = (ArmorgrpInfo_CT3)base.ReadFieldValue(f, info, "tag", "UNK_6");
         ret = info;
     }
     else if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone1_0_Kamael)
     {
         ArmorgrpInfo_CT1 info = new ArmorgrpInfo_CT1();
         info.InitFieldValues();
         info = (ArmorgrpInfo_CT1)base.ReadFieldValue(f, info, "tag", "UNK_1");
         if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone1_5_Hellbound)
             info = (ArmorgrpInfo_CT1)base.ReadFieldValue(f, info, "UNK_2");
         if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone2_1_Gracia)
             info = (ArmorgrpInfo_CT1)base.ReadFieldValue(f, info, "UNK_3");
         info = (ArmorgrpInfo_CT1)base.ReadFieldValue(f, info, "timetab", "UNK_6");
         ret = info;
     }
     else if (Program.main_form.selectedDatVersion >= DatVersion.Chronicle4)
     {
         ArmorgrpInfo_C4 info = new ArmorgrpInfo_C4();
         info = (ArmorgrpInfo_C4)base.ReadFieldValue(f, info, "tag", "mpbonus");
         ret = info;
     }
     else
     {
         ArmorgrpInfo info = new ArmorgrpInfo();
         info = (ArmorgrpInfo)base.ReadFieldValue(f, info, "tag", "mpbonus");
         ret = info;
     }
     return ret;
 }
Exemplo n.º 13
0
 public override L2DatDefinition ParseMain(BinaryReader f, int RecNo)
 {
     L2DatDefinition ret = new L2DatDefinition();
     if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone1_0_Kamael)
     {
         SkillgrpInfo_CT1 info = new SkillgrpInfo_CT1();
         info = (SkillgrpInfo_CT1)base.ReadFieldValue(f, info, "skill_id", "cast_style");
         if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone1_5_Hellbound)
             info = (SkillgrpInfo_CT1)base.ReadFieldValue(f, info, "UNK_0");
         info = (SkillgrpInfo_CT1)base.ReadFieldValue(f, info, "hit_time", "hp_consume");
         if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone2_4_Epilogue)
             info = (SkillgrpInfo_CT1)base.ReadFieldValue(f, info, "nonetext1");
         info = (SkillgrpInfo_CT1)base.ReadFieldValue(f, info, "UNK_1", "UNK_3");
         if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone2_5_Freya)
             info = (SkillgrpInfo_CT1)base.ReadFieldValue(f, info, "UNK_4", "nonetext2");
         ret = info;
     }
     else
     {
         SkillgrpInfo info = new SkillgrpInfo();
         info = (SkillgrpInfo)base.ReadFieldValue(f, info, "skill_id", "extra_eff");
         if (Program.main_form.selectedDatVersion >= DatVersion.Chronicle4)
             info = (SkillgrpInfo)base.ReadFieldValue(f, info, "is_ench", "UNK_1");
         ret = info;
     }
     return ret;
 }
Exemplo n.º 14
0
 public override L2DatDefinition ParseMain(BinaryReader f, int RecNo)
 {
     L2DatDefinition ret = new L2DatDefinition();
     if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone1)
     {
         SkillgrpInfo_CT1 info = new SkillgrpInfo_CT1();
         info = (SkillgrpInfo_CT1)base.ReadFieldValue(f, info, "skill_id", "skill_level");
         if (Program.main_form.selectedDatVersion >= DatVersion.ChaoticThrone1Plus)
             info = (SkillgrpInfo_CT1)base.ReadFieldValue(f, info, "UNK_0");
         info = (SkillgrpInfo_CT1)base.ReadFieldValue(f, info, "oper_type", "hp_consume");
         if (Program.main_form.selectedDatVersion >= DatVersion.GraciaEpilogue)
             info = (SkillgrpInfo_CT1)base.ReadFieldValue(f, info, "skill_bonus_type");
         info = (SkillgrpInfo_CT1)base.ReadFieldValue(f, info, "UNK_1", "UNK_3");
         ret = info;
     }
     else
     {
         SkillgrpInfo info = new SkillgrpInfo();
         info = (SkillgrpInfo)base.ReadFieldValue(f, info, "skill_id", "extra_eff");
         if (Program.main_form.selectedDatVersion >= DatVersion.Chronicle4)
             info = (SkillgrpInfo)base.ReadFieldValue(f, info, "is_ench", "UNK_1");
         ret = info;
     }
     return ret;
 }