Ejemplo n.º 1
0
        private static void LoadItemName()
        {
            string loaded;

            byte[] dec;
            System.IO.StreamReader temp_stream;
            System.IO.MemoryStream mem_stream;

            try
            {
                dec = GetData(data_itemname, "speves4azu52JutH");

                mem_stream = new System.IO.MemoryStream(dec);
                temp_stream = new System.IO.StreamReader((System.IO.Stream)mem_stream);

                int version = Util.GetInt32(temp_stream.ReadLine());
                if (version < Globals.MinDataPack)
                {
                    System.Windows.Forms.MessageBox.Show("itemname.txt is too old for this version of L2.Net!");
                    System.Windows.Forms.Application.Exit();
                }
                
                Globals.itemname = new SortedList();
                Globals.itemname.Capacity = Globals.COUNT_ITEMNAME;

                while ((loaded = temp_stream.ReadLine()) != null)
                {
                    ItemName itemnm = new ItemName();

                    itemnm.Parse(loaded);

                    Globals.itemname.Add(itemnm.ID, itemnm);
                }

                mem_stream.Close();
                temp_stream.Close();

                ItemName null_itm = new ItemName();
                null_itm.ID = 0;
                null_itm.Name = "no item";
                Globals.itemname.Add((uint)0, null_itm);

                //Add_Text("loaded itemname", Globals.Red);
            }
            catch(Exception e)
            {
                Globals.l2net_home.Add_PopUpError("failed to load data\\itemname.txt" + e.Message);
            }
            //////////////////
            try
            {
                dec = GetData(data_etcitemgrp, "5rePruchetupHuth");

                mem_stream = new System.IO.MemoryStream(dec);
                temp_stream = new System.IO.StreamReader((System.IO.Stream)mem_stream);

                int version2 = Util.GetInt32(temp_stream.ReadLine());
                if (version2 < Globals.MinDataPack)
                {
                    System.Windows.Forms.MessageBox.Show("etcitemgrp.txt is too old for this version of L2.Net!");
                    System.Windows.Forms.Application.Exit();
                }
                
                while ((loaded = temp_stream.ReadLine()) != null)
                {
                    ItemName itemnm = new ItemName();

                    itemnm.ParseETC(loaded);

                    ((ItemName)Globals.itemname[itemnm.ID]).ParseETC(itemnm);
                }

                mem_stream.Close();
                temp_stream.Close();

                //Add_Text("loaded etcitemgrp", Globals.Red);
            }
            catch
            {
                Globals.l2net_home.Add_PopUpError("failed to load data\\etcitemgrp.txt");
            }
            //////////////
            try
            {
                dec = GetData(data_weapongrp, "defru6e4ezuyuSWE");

                mem_stream = new System.IO.MemoryStream(dec);
                temp_stream = new System.IO.StreamReader((System.IO.Stream)mem_stream);

                int version232 = Util.GetInt32(temp_stream.ReadLine());
                if (version232 < Globals.MinDataPack)
                {
                    System.Windows.Forms.MessageBox.Show("weapongrp.txt is too old for this version of L2.Net!");
                    System.Windows.Forms.Application.Exit();
                }
                
                while ((loaded = temp_stream.ReadLine()) != null)
                {
                    ItemName itemnm = new ItemName();

                    itemnm.ParseWeapon(loaded);

                    if (Globals.itemname.ContainsKey(itemnm.ID))
                    {
                        ((ItemName)Globals.itemname[itemnm.ID]).ParseWeapon(itemnm);
                    }
                }

                mem_stream.Close();
                temp_stream.Close();

                //Add_Text("loaded weapongrp", Globals.Red);
            }
            catch (Exception e)
            {
                Globals.l2net_home.Add_PopUpError("failed to load data\\weapongrp.txt " + e.Message);
            }
            //////////////
            try
            {
                dec = GetData(data_armorgrp, "8uf53XU3ravudepe");

                mem_stream = new System.IO.MemoryStream(dec);
                temp_stream = new System.IO.StreamReader((System.IO.Stream)mem_stream);

                int version = Util.GetInt32(temp_stream.ReadLine());
                if (version < Globals.MinDataPack)
                {
                    System.Windows.Forms.MessageBox.Show("armorgrp.txt is too old for this version of L2.Net!");
                    System.Windows.Forms.Application.Exit();
                }
                
                while ((loaded = temp_stream.ReadLine()) != null)
                {
                    ItemName itemnm = new ItemName();

                    itemnm.ParseArmor(loaded);

                    ((ItemName)Globals.itemname[itemnm.ID]).ParseArmor(itemnm);
                }

                mem_stream.Close();
                temp_stream.Close();

                //Add_Text("loaded armorgrp", Globals.Red);
            }
            catch
            {
                Globals.l2net_home.Add_PopUpError("failed to load data\\armorgrp.txt");
            }

            dec = null;
        }
Ejemplo n.º 2
0
 public void ParseWeapon(ItemName inp)
 {
     //ID
     ID = inp.ID;
     //Drop Mesh 1
     Has_Mesh = inp.Has_Mesh;
     //Icon 0
     Icon = inp.Icon;
     //Durability
     Durability = inp.Durability;
     //Weight
     Weight = inp.Weight;
     //Material
     Material = inp.Material;
     //Crystallizable
     Crystallizable = inp.Crystallizable;
     //Body_Part
     Body_Part = inp.Body_Part;
     //Hardness
     Hardness = inp.Hardness;
     //Random_Damage
     Random_Damage = inp.Random_Damage;
     //PAtt
     PAtt = inp.PAtt;
     //MAtt
     MAtt = inp.MAtt;
     //Weapon_Type
     Weapon_Type = inp.Weapon_Type;
     //Crystal_Type
     Crystal_Type = inp.Crystal_Type;
     //Critical
     Critical = inp.Critical;
     //Hit_Mod
     Hit_Mod = inp.Hit_Mod;
     //Avoid_Mod
     Avoid_Mod = inp.Avoid_Mod;
     //Shield_Pdef
     Shield_Pdef = inp.Shield_Pdef;
     //Shield_Rate
     Shield_Rate = inp.Shield_Rate;
     //Speed
     Speed = inp.Speed;
     //MP_Consume
     MP_Consume = inp.MP_Consume;
     //SS
     SS = inp.SS;
     //SPS
     SPS = inp.SPS;
     //Curvature
     Curvature = inp.Curvature;
     //isHero
     isHero = inp.isHero;
 }
Ejemplo n.º 3
0
 public void ParseArmor(ItemName inp)
 {
     //ID
     ID = inp.ID;
     //Drop Mesh 1
     Has_Mesh = inp.Has_Mesh;
     //Icon 0
     Icon = inp.Icon;
     //Durability
     Durability = inp.Durability;
     //Weight
     Weight = inp.Weight;
     //Material
     Material = inp.Material;
     //Crystallizable
     Crystallizable = inp.Crystallizable;
     //Body_Part
     Body_Part = inp.Body_Part;
     //Armor_Type
     Armor_Type = inp.Armor_Type;
     //Crystal_Type
     Crystal_Type = inp.Crystal_Type;
     //Avoid_Mod
     Avoid_Mod = inp.Avoid_Mod;
     //Pdef
     /*
     Pdef = inp.Pdef;
     //Mdef
     Mdef = inp.Mdef;
     //MPbonus
     MPbonus = inp.MPbonus;*/
 }
Ejemplo n.º 4
0
 public void ParseETC(ItemName inp)
 {
     //ID
     ID = inp.ID;
     //Drop Mesh 1
     Has_Mesh = inp.Has_Mesh;
     //Icon 0
     Icon = inp.Icon;
     //Durability
     Durability = inp.Durability;
     //Weight
     Weight = inp.Weight;
     //Material
     Material = inp.Material;
     //Crystallizable
     Crystallizable = inp.Crystallizable;
     //Stackable
     Stackable = inp.Stackable;
     //Family
     Family = inp.Family;
     //Grade
     Grade = inp.Grade;
 }