示例#1
0
        private void listView_players_data_DoubleClick(object sender, EventArgs e)
        {
            //double click on a player in the list
            //normal - follow them
            //cntrl - attack them
            if (listView_players_data.SelectedIndices.Count > 0)
            {
                //action to this item
                uint id = Util.GetUInt32(listView_players_data.Items[listView_players_data.SelectedIndices[0]].SubItems[5].Text);

                if (Globals.PlayerLock.TryEnterReadLock(Globals.THREAD_WAIT_GUI))
                {
                    try
                    {
                        CharInfo player = Util.GetChar(id);

                        if (player != null)
                        {
                            ServerPackets.ClickChar(id, Util.Float_Int32(player.X), Util.Float_Int32(player.Y), Util.Float_Int32(player.Z), Globals.gamedata.Control, Globals.gamedata.Shift);
                        }
                    }
                    finally
                    {
                        Globals.PlayerLock.ExitReadLock();
                    }
                }
            }
        }
示例#2
0
        public void Parse(string inp)
        {
            int pipe = 0, oldpipe = 0;

            //ID
            pipe    = inp.IndexOf('|', oldpipe);
            ID      = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Message
            pipe    = inp.IndexOf('|', oldpipe);
            Message = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe = pipe + 1;
            //Group
            pipe    = inp.IndexOf('|', oldpipe);
            Group   = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Blue 0
            pipe    = inp.IndexOf('|', oldpipe);
            Blue    = byte.Parse(inp.Substring(oldpipe, pipe - oldpipe), System.Globalization.NumberStyles.HexNumber);
            oldpipe = pipe + 1;
            //Green 1
            pipe    = inp.IndexOf('|', oldpipe);
            Green   = byte.Parse(inp.Substring(oldpipe, pipe - oldpipe), System.Globalization.NumberStyles.HexNumber);
            oldpipe = pipe + 1;
            //Red 2
            pipe    = inp.IndexOf('|', oldpipe);
            Red     = byte.Parse(inp.Substring(oldpipe, pipe - oldpipe), System.Globalization.NumberStyles.HexNumber);
            oldpipe = pipe + 1;
            //SubMessage
            pipe       = inp.IndexOf('|', oldpipe);
            SubMessage = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe    = pipe + 1;
            //Type
            Type = inp.Substring(oldpipe, inp.Length - oldpipe);
        }
示例#3
0
        private void listView_items_data_DoubleClick(object sender, EventArgs e)
        {
            if (listView_items_data.SelectedIndices.Count > 0)
            {
                //action to this item
                uint id = Util.GetUInt32(listView_items_data.Items[listView_items_data.SelectedIndices[0]].SubItems[2].Text);

                if (Globals.ItemLock.TryEnterReadLock(Globals.THREAD_WAIT_GUI))
                {
                    try
                    {
                        ItemInfo item = Util.GetItem(id);

                        if (item != null)
                        {
                            ServerPackets.ClickItem(id, Util.Float_Int32(item.X), Util.Float_Int32(item.Y), Util.Float_Int32(item.Z), Globals.gamedata.Shift);
                        }
                    }
                    finally
                    {
                        Globals.ItemLock.ExitReadLock();
                    }
                }
            }
        }
示例#4
0
文件: ItemName.cs 项目: zixela/l2net
        public void Parse(string inp)
        {
            int pipe = 0, oldpipe = 0;

            //ID
            pipe    = inp.IndexOf('|', oldpipe);
            ID      = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Name
            pipe    = inp.IndexOf('|', oldpipe);
            Name    = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe = pipe + 1;
            //Add_Name
            pipe     = inp.IndexOf('|', oldpipe);
            Add_Name = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe  = pipe + 1;
            //Description
            pipe        = inp.IndexOf('|', oldpipe);
            Description = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe     = pipe + 1;
            //Special_Enchant_Amount
            pipe = inp.IndexOf('|', oldpipe);
            if (pipe == -1)
            {
                Special_Enchant_Amount = Util.GetInt32(inp.Substring(oldpipe, inp.Length - oldpipe));
                return;
            }
            Special_Enchant_Amount = Util.GetInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Special_Enchant_Desc
            Special_Enchant_Desc = inp.Substring(oldpipe, inp.Length - oldpipe);
        }
示例#5
0
        private void listView_skills_SelectedIndexChanged(object sender, EventArgs e)
        {
            string text = "";

            if (listView_skills.SelectedIndices.Count > 0)
            {
                uint      id = Util.GetUInt32(listView_skills.Items[listView_skills.SelectedIndices[0]].SubItems[2].Text);
                UserSkill us = null;

                if (Globals.SkillListLock.TryEnterReadLock(Globals.THREAD_WAIT_GUI))
                {
                    try
                    {
                        us = Util.GetSkill(id);
                    }
                    finally
                    {
                        Globals.SkillListLock.ExitReadLock();
                    }
                }

                if (us != null)
                {
                    text = Util.GetSkillName(us.ID, us.Level) + Environment.NewLine +
                           "Level: " + us.Level.ToString() + Environment.NewLine +
                           (us.Passive == 0x01 ? "Passive" : "Active") + Environment.NewLine +
                           Util.GetSkillDesc(us.ID, us.Level, 1) + Environment.NewLine +
                           Util.GetSkillDesc(us.ID, us.Level, 2) + Environment.NewLine +
                           Util.GetSkillDesc(us.ID, us.Level, 3) + Environment.NewLine +
                           "Type ID: " + us.ID;
                }
            }

            toolTip1.SetToolTip(listView_skills, text);
        }
示例#6
0
文件: NPCName.cs 项目: zixela/l2net
        public void Parse(string inp)
        {
            int pipe = 0, oldpipe = 0;

            //ID
            pipe    = inp.IndexOf('|', oldpipe);
            ID      = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Name
            pipe    = inp.IndexOf('|', oldpipe);
            Name    = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe = pipe + 1;
            //Description
            pipe        = inp.IndexOf('|', oldpipe);
            Description = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe     = pipe + 1;
            //Blue
            pipe    = inp.IndexOf('|', oldpipe);
            Blue    = byte.Parse(inp.Substring(oldpipe, pipe - oldpipe), System.Globalization.NumberStyles.HexNumber);
            oldpipe = pipe + 1;
            //Green
            pipe    = inp.IndexOf('|', oldpipe);
            Green   = byte.Parse(inp.Substring(oldpipe, pipe - oldpipe), System.Globalization.NumberStyles.HexNumber);
            oldpipe = pipe + 1;
            //Red
            Red = byte.Parse(inp.Substring(oldpipe, inp.Length - oldpipe), System.Globalization.NumberStyles.HexNumber);
        }
示例#7
0
        public void Parse(string inp)
        {
            int pipe = 0, oldpipe = 0;

            //ID
            pipe    = inp.IndexOf('|', oldpipe);
            ID      = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //WorldX
            pipe    = inp.IndexOf('|', oldpipe);
            WorldX  = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //WorldY
            pipe    = inp.IndexOf('|', oldpipe);
            WorldY  = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //MaxZ
            pipe    = inp.IndexOf('|', oldpipe);
            MaxZ    = Util.GetDouble(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //MinZ
            pipe    = inp.IndexOf('|', oldpipe);
            MinZ    = Util.GetDouble(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Name
            Name = inp.Substring(oldpipe, inp.Length - oldpipe);
        }
示例#8
0
文件: SkillInfo.cs 项目: zixela/l2net
        public void Parse(string inp)
        {
            int pipe = 0, oldpipe = 0;

            //ID
            pipe    = inp.IndexOf('|', oldpipe);
            ID      = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Level
            pipe    = inp.IndexOf('|', oldpipe);
            Level   = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Name
            pipe    = inp.IndexOf('|', oldpipe);
            Name    = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe = pipe + 1;
            //Desc1
            pipe    = inp.IndexOf('|', oldpipe);
            Desc1   = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe = pipe + 1;
            //Desc2
            pipe    = inp.IndexOf('|', oldpipe);
            Desc2   = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe = pipe + 1;
            //Desc3
            Desc3 = inp.Substring(oldpipe, inp.Length - oldpipe);
        }
示例#9
0
        public void Parse(string inp)
        {
            int pipe = 0, oldpipe = 0;

            //ID
            pipe    = inp.IndexOf('|', oldpipe);
            ID      = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //DYE_ID
            pipe    = inp.IndexOf('|', oldpipe);
            DYE_ID  = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Name
            pipe    = inp.IndexOf('|', oldpipe);
            Name    = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe = pipe + 1;
            //Icon
            pipe    = inp.IndexOf('|', oldpipe);
            Icon    = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe = pipe + 1;
            //Add_Name
            pipe     = inp.IndexOf('|', oldpipe);
            Add_Name = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe  = pipe + 1;
            //Add_Desc
            Add_Desc = inp.Substring(oldpipe, inp.Length - oldpipe);
        }
示例#10
0
文件: Races.cs 项目: zixela/l2net
        public void Parse(string inp)
        {
            int pipe;

            //ID
            pipe = inp.IndexOf('|');
            ID   = Util.GetUInt32(inp.Substring(0, pipe));
            //Name
            Name = inp.Substring(pipe + 1, inp.Length - pipe - 1);
        }
示例#11
0
        private void listView_players_data_SelectedIndexChanged(object sender, EventArgs e)
        {
            string text = "";

            if (listView_players_data.SelectedIndices.Count > 0)
            {
                //action to this item
                uint     id     = Util.GetUInt32(listView_players_data.Items[listView_players_data.SelectedIndices[0]].SubItems[5].Text);
                CharInfo player = null;

                if (Globals.PlayerLock.TryEnterReadLock(Globals.THREAD_WAIT_GUI))
                {
                    try
                    {
                        player = Util.GetChar(id);
                    }
                    finally
                    {
                        Globals.PlayerLock.ExitReadLock();
                    }
                }

                if (player != null)
                {
                    text = player.Name + Environment.NewLine +
                           player.Title + Environment.NewLine +
                           (player.Sex == 0 ? "Male " : "Female ") + Util.GetRace(player.Race) + " " + Util.GetClass(player.Class) + Environment.NewLine +
                           "R: " + (player.EnchantAmount == 0 ? "" : "+" + player.EnchantAmount.ToString() + " ") + Util.GetItemName(player.RHand) + Environment.NewLine +
                           "LR: " + Util.GetItemName(player.LRHand) + Environment.NewLine +
                           "L: " + Util.GetItemName(player.LHand) + Environment.NewLine +
                           Util.GetItemName(player.Head) + Environment.NewLine +
                           Util.GetItemName(player.Gloves) + Environment.NewLine +
                           Util.GetItemName(player.Feet) + Environment.NewLine +
                           Util.GetItemName(player.Chest) + Environment.NewLine +
                           Util.GetItemName(player.Legs) + Environment.NewLine +
                           Util.GetItemName(player.Back) + Environment.NewLine +
                           Util.GetItemName(player.Hair) + Environment.NewLine +
                           "PvP Flag: " + player.PvPFlag.ToString() + Environment.NewLine +
                           (player.isAlikeDead == 0x00 ? "Alive" : "Dead") + Environment.NewLine +
                           "Karma: " + player.Karma.ToString() + Environment.NewLine +
                           "Cast Speed: " + player.MatkSpeed.ToString() + Environment.NewLine +
                           "Attack Speed: " + (player.PatkSpeed /* * player.AttackSpeedMult*/).ToString() + Environment.NewLine +
                           "Run Speed: " + (player.RunSpeed * player.MoveSpeedMult).ToString() + Environment.NewLine +
                           "Rec: " + player.RecAmount.ToString() + Environment.NewLine +
                           "X: " + player.X.ToString() + Environment.NewLine +
                           "Y: " + player.Y.ToString() + Environment.NewLine +
                           "Z: " + player.Z.ToString() + Environment.NewLine +
                           "Dist: " + Util.Distance(Globals.gamedata.my_char.X, Globals.gamedata.my_char.Y, Globals.gamedata.my_char.Z, player.X, player.Y, player.Z).ToString() + Environment.NewLine +
                           "Unique ID: " + player.ID + Environment.NewLine +
                           "Name Color: " + player.NameColor.ToString();
                }
            }

            toolTip1.SetToolTip(listView_players_data, text);
        }
示例#12
0
        private void UpdateItemsListInternal()
        {
            System.Collections.ArrayList dirty_items = new System.Collections.ArrayList();

            for (int i = 0; i < listView_items_data_items.Count; i++)
            {
                uint id = Util.GetUInt32(((ListViewItem)listView_items_data_items[i]).SubItems[2].Text);

                if (Globals.gamedata.nearby_items.ContainsKey(id))
                {
                    ItemInfo item = Util.GetItem(id);

                    item.InList = true;

                    //update it
                    //((ListViewItem)listView_items_data_items[i]).SubItems[0].Text = Util.GetItemName(item.ItemID);
                    //((ListViewItem)listView_items_data_items[i]).SubItems[1].Text = item.Count.ToString();
                    //((ListViewItem)listView_items_data_items[i]).SubItems[2].Text = item.ID.ToString();
                }
                else
                {
                    dirty_items.Add(i);
                }
            }

            //need to remove all dirty items now
            for (int i = dirty_items.Count - 1; i >= 0; i--)
            {
                listView_items_data_items.RemoveAt((int)dirty_items[i]);
            }
            dirty_items.Clear();

            foreach (ItemInfo item in Globals.gamedata.nearby_items.Values)
            {
                if (!item.InList)
                {
                    item.InList = true;

                    string mesh_info = "";
                    if (!item.HasMesh)
                    {
                        mesh_info = " [NO MESH]";
                    }

                    //add it
                    System.Windows.Forms.ListViewItem ObjListItem;
                    ObjListItem = new ListViewItem(Util.GetItemName(item.ItemID) + mesh_info); //ItmID
                    ObjListItem.SubItems.Add(item.Count.ToString());                           //Count
                    ObjListItem.SubItems.Add(item.ID.ToString());                              //ObjID
                    ObjListItem.ImageIndex = AddInfo.Get_Item_Image_Index(item.ItemID);

                    listView_items_data_items.Add(ObjListItem);
                }
            }
        }
示例#13
0
        public void Parse(string inp)
        {
            int pipe = 0, oldpipe = 0;

            //ID
            pipe    = inp.IndexOf('|', oldpipe);
            ID      = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Text
            pipe = inp.IndexOf('|', oldpipe);
            text = inp.Substring(oldpipe, inp.Length - oldpipe);
        }
示例#14
0
文件: LoadData.cs 项目: zixela/l2net
        private static void LoadXP()
        {
            string loaded;

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

#if !DEBUG
            try
            {
#endif
            dec = GetData(data_lvlexp, "<M4H90ag7{_j6~3[");

            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("lvlexp.txt is too old for this version of L2.Net!");
                System.Windows.Forms.Application.Exit();
            }

            Globals.levelexp = new SortedList();

            while ((loaded = temp_stream.ReadLine()) != null)
            {
                int pipe;
                //lvl
                pipe = loaded.IndexOf('|');
                uint lvl = Util.GetUInt32(loaded.Substring(0, pipe));
                //xp
                ulong xp = Util.GetUInt64(loaded.Substring(pipe + 1, loaded.Length - pipe - 1));

                Globals.levelexp.Add(lvl, xp);
            }

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

            //Add_Text("loaded lvlexp", Globals.Red);
#if !DEBUG
        }

        catch
        {
            Globals.l2net_home.Add_PopUpError("failed to load data\\lvlexp.txt");
        }
#endif

            dec = null;
        }
示例#15
0
        public void Parse(string inp)
        {
            int pipe = 0, oldpipe = 0;

            //ID
            pipe    = inp.IndexOf('|', oldpipe);
            ID      = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Type
            pipe    = inp.IndexOf('|', oldpipe);
            Type    = Util.GetInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Category
            pipe     = inp.IndexOf('|', oldpipe);
            Category = Util.GetInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe  = pipe + 1;
            //cat2_cnt
            pipe     = inp.IndexOf('|', oldpipe);
            cat2_cnt = Util.GetInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe  = pipe + 1;
            //Name
            pipe    = inp.IndexOf('|', oldpipe);
            Name    = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe = pipe + 1;
            //Icon
            pipe    = inp.IndexOf('|', oldpipe);
            Icon    = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe = pipe + 1;
            //Desc
            pipe = inp.IndexOf('|', oldpipe);
            if (pipe == -1)
            {
                Desc = inp.Substring(oldpipe, inp.Length - oldpipe);
                return;
            }
            else
            {
                Desc    = inp.Substring(oldpipe, pipe - oldpipe);
                oldpipe = pipe + 1;
            }
            //Cmd
            pipe = inp.IndexOf('|', oldpipe);
            if (pipe == -1)
            {
                Cmd = inp.Substring(oldpipe, inp.Length - oldpipe);
                return;
            }
            else
            {
                Cmd     = inp.Substring(oldpipe, pipe - oldpipe);
                oldpipe = pipe + 1;
            }
        }
示例#16
0
文件: ItemName.cs 项目: zixela/l2net
        public void ParseETC(string inp)
        {
            int pipe = 0, oldpipe = 0;

            //ID
            pipe    = inp.IndexOf('|', oldpipe);
            ID      = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Drop Mesh 1
            pipe = inp.IndexOf('|', oldpipe);
            string mesh = inp.Substring(oldpipe, pipe - oldpipe);

            oldpipe = pipe + 1;
            if (mesh.Length > 0)
            {
                Has_Mesh = true;
            }
            else
            {
                Has_Mesh = false;
            }
            //Icon 0
            pipe    = inp.IndexOf('|', oldpipe);
            Icon    = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe = pipe + 1;
            //Durability
            pipe       = inp.IndexOf('|', oldpipe);
            Durability = Util.GetInt64(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe    = pipe + 1;
            //Weight
            pipe    = inp.IndexOf('|', oldpipe);
            Weight  = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Material
            pipe     = inp.IndexOf('|', oldpipe);
            Material = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe  = pipe + 1;
            //Crystallizable
            pipe           = inp.IndexOf('|', oldpipe);
            Crystallizable = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe        = pipe + 1;
            //Stackable
            pipe      = inp.IndexOf('|', oldpipe);
            Stackable = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe   = pipe + 1;
            //Family
            pipe    = inp.IndexOf('|', oldpipe);
            Family  = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Grade
            Grade = Util.GetUInt32(inp.Substring(oldpipe, inp.Length - oldpipe));
        }
示例#17
0
        private void listView_npc_data_SelectedIndexChanged(object sender, EventArgs e)
        {
            string text = "";

            if (listView_npc_data.SelectedIndices.Count > 0)
            {
                //action to this item
                uint    id  = Util.GetUInt32(listView_npc_data.Items[listView_npc_data.SelectedIndices[0]].SubItems[2].Text);
                NPCInfo npc = null;

                if (Globals.NPCLock.TryEnterReadLock(Globals.THREAD_WAIT_GUI))
                {
                    try
                    {
                        npc = Util.GetNPC(id);
                    }
                    finally
                    {
                        Globals.NPCLock.ExitReadLock();
                    }
                }

                if (npc != null)
                {
                    text = npc.Name + Environment.NewLine +
                           npc.Title + Environment.NewLine +
                           (npc.isAttackable == 0x00 ? "Invincible" : "Attackable") + Environment.NewLine +
                           "Cast Speed: " + npc.MatkSpeed.ToString() + Environment.NewLine +
                           "Attack Speed: " + (npc.AttackSpeedMult * npc.PatkSpeed).ToString() + Environment.NewLine +
                           "Run Speed: " + (npc.RunSpeed * npc.MoveSpeedMult).ToString() + Environment.NewLine +
                           "R: " + Util.GetItemName(npc.RHand) + Environment.NewLine +
                           "LR: " + Util.GetItemName(npc.LRHand) + Environment.NewLine +
                           "L: " + Util.GetItemName(npc.LHand) + Environment.NewLine +
                           (npc.isAlikeDead == 0x00 ? "Alive" : "Dead") + Environment.NewLine +
                           /*(npc.isInvisible == 0x00 ? "Spawned" : "Summoned") + Environment.NewLine +*/
                           "Karma: " + npc.Karma.ToString() + Environment.NewLine +
                           "Abnormal Effects: " + npc.AbnormalEffects.ToString() + Environment.NewLine +
                           "X: " + npc.X.ToString() + Environment.NewLine +
                           "Y: " + npc.Y.ToString() + Environment.NewLine +
                           "Z: " + npc.Z.ToString() + Environment.NewLine +
                           "Dist: " + Util.Distance(Globals.gamedata.my_char.X, Globals.gamedata.my_char.Y, Globals.gamedata.my_char.Z, npc.X, npc.Y, npc.Z).ToString() + Environment.NewLine +
                           "Cur HP: " + npc.Cur_HP + Environment.NewLine +
                           "Max HP: " + npc.Max_HP + Environment.NewLine +
                           (npc.isInvisible == 0x00 ? "Visible" : "Invisible") + Environment.NewLine +
                           "Type ID: " + npc.NPCID + Environment.NewLine +
                           "Unique ID: " + npc.ID + Environment.NewLine +
                           "SummonedNameColor: " + npc.SummonedNameColor;
                }
            }

            toolTip1.SetToolTip(listView_npc_data, text);
        }
示例#18
0
        private void UpdateNPCListInternal()
        {
            System.Collections.ArrayList dirty_items = new System.Collections.ArrayList();

            for (int i = 0; i < listView_npc_data.Items.Count; i++)
            {
                uint id = Util.GetUInt32(((ListViewItem)listView_npc_data_items[i]).SubItems[2].Text);

                if (Globals.gamedata.nearby_npcs.ContainsKey(id))
                {
                    NPCInfo npc = Util.GetNPC(id);

                    npc.InList = true;

                    //update it
                    //((ListViewItem)listView_npc_data_items[i]).SubItems[0].Text = Util.GetNPCName(npc.NPCID);
                    //((ListViewItem)listView_npc_data_items[i]).SubItems[1].Text = npc.Title;
                    //((ListViewItem)listView_npc_data_items[i]).SubItems[2].Text = npc.ID.ToString();
                    //((ListViewItem)listView_npc_data_items[i]).SubItems[3].Text = npc.NPCID.ToString();
                }
                else
                {
                    dirty_items.Add(i);
                }
            }

            //need to remove all dirty items now
            for (int i = dirty_items.Count - 1; i >= 0; i--)
            {
                listView_npc_data_items.RemoveAt((int)dirty_items[i]);
            }
            dirty_items.Clear();

            foreach (NPCInfo npc in Globals.gamedata.nearby_npcs.Values)
            {
                if (!npc.InList)
                {
                    npc.InList = true;
                    if (npc.isInvisible != 1)
                    {
                        //add it
                        System.Windows.Forms.ListViewItem ObjListItem;
                        ObjListItem = new ListViewItem(Util.GetNPCName(npc.NPCID)); //Name
                        ObjListItem.SubItems.Add(npc.Title);                        //Title
                        ObjListItem.SubItems.Add(npc.ID.ToString());                //ObjID
                        ObjListItem.SubItems.Add(npc.NPCID.ToString());             //TypeID

                        listView_npc_data_items.Add(ObjListItem);
                    }
                }
            }
        }
示例#19
0
        private void listView_inventory_DoubleClick(object sender, EventArgs e)
        {
            if (Globals.gamedata.running && Globals.gamedata.logged_in)
            {
                if (listView_inventory.SelectedIndices.Count > 0)
                {
                    uint id = Util.GetUInt32(listView_inventory.Items[listView_inventory.SelectedIndices[0]].SubItems[4].Text);

                    if (id != 0)
                    {
                        ServerPackets.Use_Item(id);
                    }
                }
            }
        }
示例#20
0
        private void listView_skills_DoubleClick(object sender, EventArgs e)
        {
            if (Globals.gamedata.logged_in)
            {
                if (listView_skills.SelectedIndices.Count > 0) //&& listView_skills.Items[listView_skills.SelectedIndices[0]].SubItems[2].Text == "Active"
                {
                    uint id = Util.GetUInt32(listView_skills.Items[listView_skills.SelectedIndices[0]].SubItems[2].Text);

                    if (id != 0)
                    {
                        ServerPackets.Try_Use_Skill(id, Globals.gamedata.Control, Globals.gamedata.Shift);
                    }
                } //dont want to use passive skills
            }     //end of check for running
        }
示例#21
0
        private void deleteStackToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // https://opensvn.csie.org/traccgi/l2jc4/browser/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/clientpackets/RequestDestroyItem.java
            //delete crap from inventory
            try
            {
                uint objID = Util.GetUInt32(listView_inventory.Items[listView_inventory.SelectedIndices[0]].SubItems[4].Text);
                uint count = Util.GetUInt32(listView_inventory.Items[listView_inventory.SelectedIndices[0]].SubItems[1].Text);

                ServerPackets.DeleteItem(objID, count);
            }
            catch
            {
            }
        }
示例#22
0
        private void crystalizeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // https://opensvn.csie.org/traccgi/l2jc4/browser/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/clientpackets/RequestCrystallizeItem.java
            //crsytalize crap in our inventory
            try
            {
                uint objID = Util.GetUInt32(listView_inventory.Items[listView_inventory.SelectedIndices[0]].SubItems[4].Text);
                uint count = 1;//Util.GetInt32(listView_inventory.Items[listView_inventory.SelectedIndices[0]].SubItems[3].Text);

                ServerPackets.CrystalizeItem(objID, count);
            }
            catch
            {
            }
        }
示例#23
0
        private void dropStackToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // https://opensvn.csie.org/traccgi/l2jc4/browser/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/clientpackets/RequestDropItem.java
            //drop an item from inventory
            //probably safest to drop it on our own location
            //although perhaps we can drop things in the sky kekeke
            try
            {
                uint objID = Util.GetUInt32(listView_inventory.Items[listView_inventory.SelectedIndices[0]].SubItems[4].Text);
                uint count = Util.GetUInt32(listView_inventory.Items[listView_inventory.SelectedIndices[0]].SubItems[1].Text);
                int  x     = Util.Float_Int32(Globals.gamedata.my_char.X);
                int  y     = Util.Float_Int32(Globals.gamedata.my_char.Y);
                int  z     = Util.Float_Int32(Globals.gamedata.my_char.Z);

                ServerPackets.DropItem(objID, count, x, y, z);
            }
            catch
            {
            }
        }
示例#24
0
        private void listView_inventory_SelectedIndexChanged(object sender, EventArgs e)
        {
            string text = "";

            if (listView_inventory.SelectedIndices.Count > 0)
            {
                uint          id   = Util.GetUInt32(listView_inventory.Items[listView_inventory.SelectedIndices[0]].SubItems[4].Text);
                InventoryInfo item = null;

                if (Globals.InventoryLock.TryEnterReadLock(Globals.THREAD_WAIT_GUI))
                {
                    try
                    {
                        item = Util.GetInventory(id);
                    }
                    finally
                    {
                        Globals.InventoryLock.ExitReadLock();
                    }
                }

                if (item != null)
                {
                    text = (item.Enchant == 0 ? "" : "+" + item.Enchant.ToString() + " ") + Util.GetItemName(item.ItemID) + Environment.NewLine +
                           (item.isEquipped == 0x01 ? "Equipped" + Environment.NewLine : "") +
                           "Count: " + item.Count.ToString() + Environment.NewLine +
                           "Augment: " + item.AugID.ToString() + Environment.NewLine +
                           "Mana: " + item.Mana.ToString() + Environment.NewLine +
                           "Slot: " + item.Slot.ToString() + Environment.NewLine +
                           "Type 1: " + item.Type.ToString() + Environment.NewLine +
                           "Type 2: " + item.Type2.ToString() + Environment.NewLine +
                           "Type 3: " + item.Type3.ToString() + Environment.NewLine +
                           "Type 4: " + item.Type4.ToString() + Environment.NewLine +
                           "Type ID: " + item.ItemID + Environment.NewLine +
                           "Unique ID: " + item.ID;
                }
            }

            toolTip1.SetToolTip(listView_inventory, text);
        }
示例#25
0
        private void listView_items_data_SelectedIndexChanged(object sender, EventArgs e)
        {
            string text = "";

            if (listView_items_data.SelectedIndices.Count > 0)
            {
                //action to this item
                uint     id   = Util.GetUInt32(listView_items_data.Items[listView_items_data.SelectedIndices[0]].SubItems[2].Text);
                ItemInfo item = null;

                if (Globals.ItemLock.TryEnterReadLock(Globals.THREAD_WAIT_GUI))
                {
                    try
                    {
                        item = Util.GetItem(id);
                    }
                    finally
                    {
                        Globals.ItemLock.ExitReadLock();
                    }
                }

                if (item != null)
                {
                    text = Util.GetItemName(item.ItemID) + Environment.NewLine +
                           item.Count.ToString() + Environment.NewLine +
                           (item.Stackable == 0x01 ? "Stacks" : "Single") + Environment.NewLine +
                           "X: " + item.X.ToString() + Environment.NewLine +
                           "Y: " + item.Y.ToString() + Environment.NewLine +
                           "Z: " + item.Z.ToString() + Environment.NewLine +
                           "Dist: " + Util.Distance(Globals.gamedata.my_char.X, Globals.gamedata.my_char.Y, Globals.gamedata.my_char.Z, item.X, item.Y, item.Z).ToString() + Environment.NewLine +
                           "Type ID: " + item.ItemID + Environment.NewLine +
                           "Unique ID: " + item.ID;
                }
            }

            toolTip1.SetToolTip(listView_items_data, text);
        }
示例#26
0
        private void UpdateMyBuffsListInternal()
        {
            System.Collections.ArrayList dirty_items = new System.Collections.ArrayList();

            for (int i = 0; i < listView_mybuffs_data.Items.Count; i++)
            {
                uint id = Util.GetUInt32(((ListViewItem)listView_mybuffs_data_items[i]).SubItems[3].Text);

                if (Globals.gamedata.mybuffs.ContainsKey(id))
                {
                    CharBuff cb = Util.GetBuff(id);

                    cb.InList = true;

                    if (cb.ExpiresTime == -1)
                    {
                        ((ListViewItem)listView_mybuffs_data_items[i]).SubItems[2].Text = "ON";
                    }
                    else
                    {
                        System.TimeSpan remain = new System.TimeSpan(cb.ExpiresTime - System.DateTime.Now.Ticks);

                        //update it
                        //((ListViewItem)listView_npc_data_items[i]).SubItems[0].Text = Util.GetNPCName(npc.NPCID);
                        //((ListViewItem)listView_npc_data_items[i]).SubItems[1].Text = npc.Title;
                        ((ListViewItem)listView_mybuffs_data_items[i]).SubItems[2].Text = ((int)remain.TotalMinutes).ToString() + ":" + remain.Seconds.ToString();
                        //((ListViewItem)listView_mybuffs_data_items[i]).SubItems[2].Text = cb.ID.ToString();
                    }
                }
                else
                {
                    dirty_items.Add(i);
                }
            }

            //need to remove all dirty items now
            for (int i = dirty_items.Count - 1; i >= 0; i--)
            {
                listView_mybuffs_data_items.RemoveAt((int)dirty_items[i]);
            }
            dirty_items.Clear();

            foreach (CharBuff cb in Globals.gamedata.mybuffs.Values)
            {
                if (!cb.InList)
                {
                    cb.InList = true;

                    System.TimeSpan remain = new System.TimeSpan(0);
                    if (cb.ExpiresTime == -1)
                    {
                    }
                    else
                    {
                        remain = new System.TimeSpan(cb.ExpiresTime - System.DateTime.Now.Ticks);
                    }

                    //add it
                    System.Windows.Forms.ListViewItem ObjListItem;
                    ObjListItem = new ListViewItem(Util.GetSkillName(cb.ID, cb.SkillLevel)); //Name
                    ObjListItem.SubItems.Add(cb.SkillLevel.ToString());                      //Title
                    if (cb.ExpiresTime == -1)
                    {
                        ObjListItem.SubItems.Add("ON");
                    }
                    else
                    {
                        ObjListItem.SubItems.Add(((int)remain.TotalMinutes).ToString() + ":" + remain.Seconds.ToString()); //Remaining Time
                    }
                    ObjListItem.SubItems.Add(cb.ID.ToString());                                                            //ObjID
                    ObjListItem.ImageIndex = AddInfo.Get_Skill_Image_Index(cb.ID);

                    listView_mybuffs_data_items.Add(ObjListItem);
                }
            }
        }
示例#27
0
        private void UpdatePlayerListInternal()
        {
            bool Active = true;

            float x = Globals.gamedata.my_char.X;
            float y = Globals.gamedata.my_char.Y;
            float z = Globals.gamedata.my_char.Z;

            System.Collections.ArrayList dirty_items = new System.Collections.ArrayList();

            for (int i = 0; i < listView_players_data_items.Count; i++)
            {
                uint id = Util.GetUInt32(((ListViewItem)listView_players_data_items[i]).SubItems[5].Text);

                if (Globals.gamedata.nearby_chars.ContainsKey(id))
                {
                    CharInfo player = Util.GetChar(id);

                    player.InList = true;

                    //update it
                    ((ListViewItem)listView_players_data_items[i]).SubItems[0].Text = player.WarState.ToString();
                    //((ListViewItem)listView_players_data_items[i]).SubItems[1].Text = player.Name;
                    if (Active)
                    {
                        ((ListViewItem)listView_players_data_items[i]).SubItems[2].Text = Util.GetClass(player.Class) + (player.isAlikeDead == 0x00 ? " :A: " : " :D: ") + ((int)Util.Distance(x, y, z, player.X, player.Y, player.Z)).ToString("0000");
                    }
                    else
                    {
                        ((ListViewItem)listView_players_data_items[i]).SubItems[2].Text = Util.GetClass(player.Class);
                    }
                    ((ListViewItem)listView_players_data_items[i]).SubItems[3].Text = player.ClanName; //clan
                    ((ListViewItem)listView_players_data_items[i]).SubItems[4].Text = player.AllyName; //ally
                    //((ListViewItem)listView_players_data_items[i]).SubItems[5].Text = player.ID.ToString();//didnt change

                    ((ListViewItem)listView_players_data_items[i]).ImageIndex = player.ClanCrestIndex;
                }
                else
                {
                    dirty_items.Add(i);
                }
            }

            //need to remove all dirty items now
            for (int i = dirty_items.Count - 1; i >= 0; i--)
            {
                listView_players_data_items.RemoveAt((int)dirty_items[i]);
            }
            dirty_items.Clear();

            foreach (CharInfo player in Globals.gamedata.nearby_chars.Values)
            {
                //find the item in our arraylist...

                if (!player.InList)
                {
                    player.InList = true;

                    //add it
                    System.Windows.Forms.ListViewItem ObjListItem;
                    ObjListItem = new ListViewItem(player.WarState.ToString()); //war
                    ObjListItem.SubItems.Add(player.Name);                      //name
                    if (Active)
                    {
                        ObjListItem.SubItems.Add(Util.GetClass(player.Class) + (player.isAlikeDead == 0x00 ? " :A: " : " :D: ") + ((int)Util.Distance(x, y, z, player.X, player.Y, player.Z)).ToString("0000"));//class
                    }
                    else
                    {
                        ObjListItem.SubItems.Add(Util.GetClass(player.Class)); //class
                    }
                    ObjListItem.SubItems.Add(player.ClanName);                 //clan
                    ObjListItem.SubItems.Add(player.AllyName);                 //ally
                    ObjListItem.SubItems.Add(player.ID.ToString());            //ID

                    //UpdateClanInfo(ObjListItem);
                    if (player.ClanCrestIndex != 0)
                    {
                        ObjListItem.ImageIndex = player.ClanCrestIndex;
                    }
                    else
                    {
                        ObjListItem.ImageIndex = -1;
                    }

                    //oop cache
                    if (Globals.gamedata.botoptions.OOPNamesArray.Contains(player.Name.ToUpperInvariant()))
                    {
                        if (!Globals.gamedata.botoptions.OOPIDs.Contains(player.ID))
                        {
                            Globals.gamedata.botoptions.OOPIDs.Add(player.ID);
                        }
                    }

                    listView_players_data_items.Add(ObjListItem);
                }
            }
        }
示例#28
0
文件: ItemName.cs 项目: zixela/l2net
        public void ParseArmor(string inp)
        {
            int pipe = 0, oldpipe = 0;

            //ID
            pipe    = inp.IndexOf('|');
            ID      = Util.GetUInt32(inp.Substring(0, pipe));
            oldpipe = pipe + 1;
            //Drop Mesh 1
            pipe = inp.IndexOf('|', oldpipe);
            string mesh = inp.Substring(oldpipe, pipe - oldpipe);

            oldpipe = pipe + 1;
            if (mesh.Length > 0)
            {
                Has_Mesh = true;
            }
            else
            {
                Has_Mesh = false;
            }
            //Icon 0
            pipe    = inp.IndexOf('|', oldpipe);
            Icon    = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe = pipe + 1;
            //Durability
            pipe       = inp.IndexOf('|', oldpipe);
            Durability = Util.GetInt64(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe    = pipe + 1;
            //Weight
            pipe    = inp.IndexOf('|', oldpipe);
            Weight  = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Material
            pipe     = inp.IndexOf('|', oldpipe);
            Material = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe  = pipe + 1;
            //Crystallizable
            pipe           = inp.IndexOf('|', oldpipe);
            Crystallizable = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe        = pipe + 1;
            //Body_Part
            pipe      = inp.IndexOf('|', oldpipe);
            Body_Part = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe   = pipe + 1;
            //Armor_Type
            pipe       = inp.IndexOf('|', oldpipe);
            Armor_Type = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe    = pipe + 1;
            //Crystal_Type
            pipe         = inp.IndexOf('|', oldpipe);
            Crystal_Type = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe      = pipe + 1;
            //Avoid_Mod
            pipe      = inp.IndexOf('|', oldpipe);
            Avoid_Mod = Util.GetInt32(inp.Substring(oldpipe, inp.Length - oldpipe));

            /*
             * oldpipe = pipe + 1;
             * //Pdef
             * pipe = inp.IndexOf('|', oldpipe);
             * Pdef = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
             * oldpipe = pipe + 1;
             * //Mdef
             * pipe = inp.IndexOf('|', oldpipe);
             * Mdef = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
             * oldpipe = pipe + 1;
             * //MPbonus
             * MPbonus = Util.GetUInt32(inp.Substring(oldpipe, inp.Length - oldpipe));*/
        }
示例#29
0
文件: ItemName.cs 项目: zixela/l2net
        public void ParseWeapon(string inp)
        {
            int pipe = 0, oldpipe = 0;

            //ID
            pipe    = inp.IndexOf('|', oldpipe);
            ID      = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Drop Mesh 1
            pipe = inp.IndexOf('|', oldpipe);
            string mesh = inp.Substring(oldpipe, pipe - oldpipe);

            oldpipe = pipe + 1;
            if (mesh.Length > 0)
            {
                Has_Mesh = true;
            }
            else
            {
                Has_Mesh = false;
            }
            //Icon 0
            pipe    = inp.IndexOf('|', oldpipe);
            Icon    = inp.Substring(oldpipe, pipe - oldpipe);
            oldpipe = pipe + 1;
            //Durability
            pipe       = inp.IndexOf('|', oldpipe);
            Durability = Util.GetInt64(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe    = pipe + 1;
            //Weight
            pipe    = inp.IndexOf('|', oldpipe);
            Weight  = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Material
            pipe     = inp.IndexOf('|', oldpipe);
            Material = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe  = pipe + 1;
            //Crystallizable
            pipe           = inp.IndexOf('|', oldpipe);
            Crystallizable = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe        = pipe + 1;
            //Body_Part
            pipe      = inp.IndexOf('|', oldpipe);
            Body_Part = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe   = pipe + 1;
            //Hardness
            pipe     = inp.IndexOf('|', oldpipe);
            Hardness = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe  = pipe + 1;
            //Random_Damage
            pipe          = inp.IndexOf('|', oldpipe);
            Random_Damage = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe       = pipe + 1;
            //PAtt

            /*
             * pipe = inp.IndexOf('|', oldpipe);
             * PAtt = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
             * oldpipe = pipe + 1;
             * //MAtt
             * pipe = inp.IndexOf('|', oldpipe);
             * MAtt = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
             * oldpipe = pipe + 1;
             */
            //Weapon_Type
            pipe        = inp.IndexOf('|', oldpipe);
            Weapon_Type = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe     = pipe + 1;
            //Crystal_Type
            pipe         = inp.IndexOf('|', oldpipe);
            Crystal_Type = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe      = pipe + 1;

            /*
             * //Critical
             * pipe = inp.IndexOf('|', oldpipe);
             * Critical = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
             * oldpipe = pipe + 1;
             * //Hit_Mod
             * pipe = inp.IndexOf('|', oldpipe);
             * Hit_Mod = Util.GetInt32(inp.Substring(oldpipe, pipe - oldpipe));
             * oldpipe = pipe + 1;
             * //Avoid_Mod
             * pipe = inp.IndexOf('|', oldpipe);
             * Avoid_Mod = Util.GetInt32(inp.Substring(oldpipe, pipe - oldpipe));
             * oldpipe = pipe + 1;
             * //Shield_Pdef
             * pipe = inp.IndexOf('|', oldpipe);
             * Shield_Pdef = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
             * oldpipe = pipe + 1;
             * //Shield_Rate
             * pipe = inp.IndexOf('|', oldpipe);
             * Shield_Rate = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
             * oldpipe = pipe + 1;
             * //Speed
             * pipe = inp.IndexOf('|', oldpipe);
             * Speed = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
             * oldpipe = pipe + 1;
             */
            //MP_Consume
            pipe       = inp.IndexOf('|', oldpipe);
            MP_Consume = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe    = pipe + 1;
            //SS
            pipe    = inp.IndexOf('|', oldpipe);
            SS      = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //SPS
            pipe    = inp.IndexOf('|', oldpipe);
            SPS     = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe = pipe + 1;
            //Curvature
            pipe      = inp.IndexOf('|', oldpipe);
            Curvature = Util.GetUInt32(inp.Substring(oldpipe, pipe - oldpipe));
            oldpipe   = pipe + 1;
            //isHero
            isHero = Util.GetInt32(inp.Substring(oldpipe, inp.Length - oldpipe));
        }
示例#30
0
        private void UpdateInventoryListInternal()
        {
            System.Collections.ArrayList dirty_items = new System.Collections.ArrayList();
            #region Equipped Items
            if (radioButton_inv_equipped.Checked)
            {
                for (int i = 0; i < listView_inventory_items.Count; i++)
                {
                    uint id = Util.GetUInt32(((ListViewItem)listView_inventory_items[i]).SubItems[4].Text);

                    if (Globals.gamedata.inventory.ContainsKey(id))
                    {
                        //already in the list...
                        InventoryInfo inv_inf = Util.GetInventory(id);
                        if (inv_inf.isEquipped == 0x01)
                        {
                            inv_inf.InList = true;

                            //update the entry
                            if (inv_inf.Enchant == 0)
                            {
                                ((ListViewItem)listView_inventory_items[i]).SubItems[0].Text = Util.GetItemName(inv_inf.ItemID);
                            }
                            else
                            {
                                ((ListViewItem)listView_inventory_items[i]).SubItems[0].Text = "+" + inv_inf.Enchant.ToString() + " " + Util.GetItemName(inv_inf.ItemID);
                            }
                            ((ListViewItem)listView_inventory_items[i]).SubItems[1].Text = inv_inf.Count.ToString(); //Count
                            if (inv_inf.isEquipped == 0x01)                                                          //isEquipped
                            {
                                ((ListViewItem)listView_inventory_items[i]).SubItems[2].Text = "X";
                            }
                            else
                            {
                                ((ListViewItem)listView_inventory_items[i]).SubItems[2].Text = " ";
                            }
                            //((ListViewItem)listView_inventory_items[i]).SubItems[3].Text = inv_inf.Slot.ToString();//Slot
                        }
                        else
                        {
                            //not in the list...
                            //delete this item
                            dirty_items.Add(i);
                        }
                    }
                    else
                    {
                        //not in the list...
                        //delete this item
                        dirty_items.Add(i);
                    }
                }

                //need to remove all dirty items now
                for (int i = dirty_items.Count - 1; i >= 0; i--)
                {
                    listView_inventory_items.RemoveAt((int)dirty_items[i]);
                }
                dirty_items.Clear();

                foreach (InventoryInfo inv_inf in Globals.gamedata.inventory.Values)
                {
                    if (!inv_inf.InList && inv_inf.isEquipped == 0x01)
                    {
                        inv_inf.InList = true;

                        //add it
                        System.Windows.Forms.ListViewItem ObjListItem;

                        if (inv_inf.Enchant == 0)
                        {
                            ObjListItem = new ListViewItem(Util.GetItemName(inv_inf.ItemID));
                        }
                        else
                        {
                            ObjListItem = new ListViewItem("+" + inv_inf.Enchant.ToString() + " " + Util.GetItemName(inv_inf.ItemID));
                        }
                        ObjListItem.SubItems.Add(inv_inf.Count.ToString()); //Count
                        if (inv_inf.isEquipped == 0x01)                     //isEquipped
                        {
                            ObjListItem.SubItems.Add("X");
                            //Do_Equip(inv_inf);
                        }
                        else
                        {
                            ObjListItem.SubItems.Add(" ");
                        }
                        ObjListItem.SubItems.Add(inv_inf.Slot.ToString()); //Slot
                        ObjListItem.SubItems.Add(inv_inf.ID.ToString());   //ObjID
                        ObjListItem.ImageIndex = AddInfo.Get_Item_Image_Index(inv_inf.ItemID);

                        listView_inventory_items.Add(ObjListItem);
                    }
                }
            }
            #endregion

            #region Normal Items
            if (radioButton_inv_items.Checked)
            {
                for (int i = 0; i < listView_inventory_items.Count; i++)
                {
                    uint id = Util.GetUInt32(((ListViewItem)listView_inventory_items[i]).SubItems[4].Text);

                    if (Globals.gamedata.inventory.ContainsKey(id))
                    {
                        //already in the list...
                        InventoryInfo inv_inf = Util.GetInventory(id);
                        if (inv_inf.isEquipped != 0x01 && inv_inf.Type2 != 0x03)
                        {
                            inv_inf.InList = true;

                            //update the entry
                            if (inv_inf.Enchant == 0)
                            {
                                ((ListViewItem)listView_inventory_items[i]).SubItems[0].Text = Util.GetItemName(inv_inf.ItemID);
                            }
                            else
                            {
                                ((ListViewItem)listView_inventory_items[i]).SubItems[0].Text = "+" + inv_inf.Enchant.ToString() + " " + Util.GetItemName(inv_inf.ItemID);
                            }
                            ((ListViewItem)listView_inventory_items[i]).SubItems[1].Text = inv_inf.Count.ToString(); //Count
                            if (inv_inf.isEquipped == 0x01)                                                          //isEquipped
                            {
                                ((ListViewItem)listView_inventory_items[i]).SubItems[2].Text = "X";
                            }
                            else
                            {
                                ((ListViewItem)listView_inventory_items[i]).SubItems[2].Text = " ";
                            }
                            //((ListViewItem)listView_inventory_items[i]).SubItems[3].Text = inv_inf.Slot.ToString();//Slot
                        }
                        else
                        {
                            //not in the list...
                            //delete this item
                            dirty_items.Add(i);
                        }
                    }
                    else
                    {
                        //not in the list...
                        //delete this item
                        dirty_items.Add(i);
                    }
                }

                //need to remove all dirty items now
                for (int i = dirty_items.Count - 1; i >= 0; i--)
                {
                    listView_inventory_items.RemoveAt((int)dirty_items[i]);
                }
                dirty_items.Clear();

                foreach (InventoryInfo inv_inf in Globals.gamedata.inventory.Values)
                {
                    if (!inv_inf.InList && inv_inf.isEquipped != 0x01 && inv_inf.Type2 != 0x03)
                    {
                        inv_inf.InList = true;

                        //add it
                        System.Windows.Forms.ListViewItem ObjListItem;

                        if (inv_inf.Enchant == 0)
                        {
                            ObjListItem = new ListViewItem(Util.GetItemName(inv_inf.ItemID));
                        }
                        else
                        {
                            ObjListItem = new ListViewItem("+" + inv_inf.Enchant.ToString() + " " + Util.GetItemName(inv_inf.ItemID));
                        }
                        ObjListItem.SubItems.Add(inv_inf.Count.ToString()); //Count
                        if (inv_inf.isEquipped == 0x01)                     //isEquipped
                        {
                            ObjListItem.SubItems.Add("X");
                            //Do_Equip(inv_inf);
                        }
                        else
                        {
                            ObjListItem.SubItems.Add(" ");
                        }
                        ObjListItem.SubItems.Add(inv_inf.Slot.ToString()); //Slot
                        ObjListItem.SubItems.Add(inv_inf.ID.ToString());   //ObjID
                        ObjListItem.ImageIndex = AddInfo.Get_Item_Image_Index(inv_inf.ItemID);

                        listView_inventory_items.Add(ObjListItem);
                    }
                }
            }
            #endregion

            #region Quest Items
            if (radioButton_inv_quest.Checked)
            {
                for (int i = 0; i < listView_inventory_items.Count; i++)
                {
                    uint id = Util.GetUInt32(((ListViewItem)listView_inventory_items[i]).SubItems[4].Text);

                    if (Globals.gamedata.inventory.ContainsKey(id))
                    {
                        //already in the list...
                        InventoryInfo inv_inf = Util.GetInventory(id);
                        if (inv_inf.Type2 == 0x03)
                        {
                            inv_inf.InList = true;

                            //update the entry
                            if (inv_inf.Enchant == 0)
                            {
                                ((ListViewItem)listView_inventory_items[i]).SubItems[0].Text = Util.GetItemName(inv_inf.ItemID);
                            }
                            else
                            {
                                ((ListViewItem)listView_inventory_items[i]).SubItems[0].Text = "+" + inv_inf.Enchant.ToString() + " " + Util.GetItemName(inv_inf.ItemID);
                            }
                            ((ListViewItem)listView_inventory_items[i]).SubItems[1].Text = inv_inf.Count.ToString(); //Count
                            if (inv_inf.isEquipped == 0x01)                                                          //isEquipped
                            {
                                ((ListViewItem)listView_inventory_items[i]).SubItems[2].Text = "X";
                            }
                            else
                            {
                                ((ListViewItem)listView_inventory_items[i]).SubItems[2].Text = " ";
                            }
                            //((ListViewItem)listView_inventory_items[i]).SubItems[3].Text = inv_inf.Slot.ToString();//Slot
                        }
                        else
                        {
                            //not in the list...
                            //delete this item
                            dirty_items.Add(i);
                        }
                    }
                    else
                    {
                        //not in the list...
                        //delete this item
                        dirty_items.Add(i);
                    }
                }

                //need to remove all dirty items now
                for (int i = dirty_items.Count - 1; i >= 0; i--)
                {
                    listView_inventory_items.RemoveAt((int)dirty_items[i]);
                }
                dirty_items.Clear();

                foreach (InventoryInfo inv_inf in Globals.gamedata.inventory.Values)
                {
                    if (!inv_inf.InList && inv_inf.Type2 == 0x03)
                    {
                        inv_inf.InList = true;

                        //add it
                        System.Windows.Forms.ListViewItem ObjListItem;

                        if (inv_inf.Enchant == 0)
                        {
                            ObjListItem = new ListViewItem(Util.GetItemName(inv_inf.ItemID));
                        }
                        else
                        {
                            ObjListItem = new ListViewItem("+" + inv_inf.Enchant.ToString() + " " + Util.GetItemName(inv_inf.ItemID));
                        }
                        ObjListItem.SubItems.Add(inv_inf.Count.ToString()); //Count
                        if (inv_inf.isEquipped == 0x01)                     //isEquipped
                        {
                            ObjListItem.SubItems.Add("X");
                            //Do_Equip(inv_inf);
                        }
                        else
                        {
                            ObjListItem.SubItems.Add(" ");
                        }
                        ObjListItem.SubItems.Add(inv_inf.Slot.ToString()); //Slot
                        ObjListItem.SubItems.Add(inv_inf.ID.ToString());   //ObjID
                        ObjListItem.ImageIndex = AddInfo.Get_Item_Image_Index(inv_inf.ItemID);

                        listView_inventory_items.Add(ObjListItem);
                    }
                }
            }
            #endregion
        }