Exemplo n.º 1
0
        public Bitmap IconFast(int itemID)
        {
            Image     image1    = Image.FromFile("icons/ItemBtn0.png");
            Bitmap    bitmap1   = new Bitmap(32, 32);
            Graphics  graphics1 = Graphics.FromImage((Image)bitmap1);
            Rectangle srcRect1  = new Rectangle(0, 0, 32, 32);

            graphics1.DrawImage(image1, 0, 0, srcRect1, GraphicsUnit.Pixel);
            graphics1.Dispose();
            if (itemID == -1)
            {
                return(bitmap1);
            }
            ticon ticon = IconList.List.Find((Predicate <ticon>)(p => p.ItemID.Equals(itemID)));

            if (ticon == null)
            {
                return(bitmap1);
            }
            int       fileId    = ticon.FileID;
            int       row       = ticon.Row;
            int       col       = ticon.Col;
            Image     image2    = Image.FromFile("icons/ItemBtn" + fileId.ToString() + ".png");
            Bitmap    bitmap2   = new Bitmap(32, 32);
            Graphics  graphics2 = Graphics.FromImage((Image)bitmap2);
            int       y         = row * 32;
            Rectangle srcRect2  = new Rectangle(col * 32, y, 32, 32);

            graphics2.DrawImage(image2, 0, 0, srcRect2, GraphicsUnit.Pixel);
            graphics2.Dispose();
            return(bitmap2);
        }
Exemplo n.º 2
0
        public string ItemDescrFast(int itemID) //dethunter12 item description fast implement
        {
            if (itemID == -1)
            {
                return("None");
            }
            ticon ticon = IconList.List.Find((Predicate <ticon>)(p => p.ItemID.Equals(itemID)));

            if (ticon == null)
            {
                return("None");
            }
            return(ticon.Desc);
        }
Exemplo n.º 3
0
        public string ItemNameFast(int itemID)
        {
            if (itemID == -1)
            {
                return("");
            }
            ticon ticon = IconList.List.Find((Predicate <ticon>)(p => p.ItemID.Equals(itemID)));

            if (ticon == null)
            {
                return("");
            }
            return(ticon.Name);
        }
Exemplo n.º 4
0
        public string DrawBoxNameFromItem(int itemID) //dethunter12 draw box name from icon
        {
            if (itemID == -1)
            {
                return("None");
            }

            ticon ticon = IconList.List.Find((Predicate <ticon>)(p => p.ItemID.Equals(itemID)));

            if (ticon == null)
            {
                return("None");
            }
            int num1 = 0;

            string          str             = " select a_num_0 from t_item WHERE a_type_idx = 2 AND a_sub_type_idx = 9 AND ENABLE = 1 AND  a_index = '" + itemID + "';";
            MySqlConnection mySqlConnection = new MySqlConnection("datasource=" + Host + ";port=3306;username="******";password="******";database=" + Database);
            MySqlCommand    command         = mySqlConnection.CreateCommand();

            command.CommandText = str;
            mySqlConnection.Open();
            MySqlDataReader mySqlDataReader = command.ExecuteReader();

            while (mySqlDataReader.Read())
            {
                num1       = Convert.ToInt32(mySqlDataReader.GetValue(0));
                ticon.num0 = num1;
            }
            mySqlConnection.Close();
            if (itemID == 1838 || itemID == 1839 || itemID == 2135 ||
                itemID == 2136 || itemID == 2146 || itemID == 2148 ||
                itemID == 2407 || itemID == 2408 || itemID == 2500 || itemID == 2609 || itemID == 2666 ||
                itemID == 2710 || itemID == 2711 || itemID == 2712 || itemID == 2713 || itemID == 2714 || itemID == 2859 || itemID == 2860 || itemID == 2861 || itemID == 2862 || itemID == 2863 ||
                itemID == 2864 || itemID == 2882 || itemID == 2982 || itemID == 3575 || itemID == 3764 || itemID == 3769 || itemID == 4709 || itemID == 4911 ||
                itemID == 5018 || itemID == 5019 || itemID == 5067 || itemID == 5123 || itemID == 5124 || itemID == 5329 || itemID == 5347 || itemID == 5952 || itemID == 6251 ||
                itemID == 6256 || itemID == 6258 || itemID == 6259 || itemID == 6260 || itemID == 6593 || itemID == 6647 || itemID == 6648 || itemID == 6653 || itemID == 6697 || itemID == 6804 ||
                itemID == 6890 || itemID == 6891 || itemID == 7064 || itemID == 7210 || itemID == 7307 || itemID == 7308 || itemID == 7310 ||
                itemID == 7311 || itemID == 7320 || itemID == 7321 || itemID == 7336 || itemID == 7337 || itemID == 7394 || itemID == 7484 ||
                itemID == 7572 || itemID == 7573 || itemID == 7574 || itemID == 7575 || itemID == 7576 || itemID == 7577 || itemID == 7578 || itemID == 7579 || itemID == 7580 || itemID == 7612 || itemID == 7619 || itemID == 7620 || itemID == 7622 || itemID == 7623 || itemID == 7624 ||
                itemID == 7736 || itemID == 7898 || itemID == 9938 || itemID == 10022 || itemID == 10266 || itemID == 10286 || itemID == 10301 || itemID == 10799 || itemID == 11038)
            {
                return("None");
            }
            return(ticon.Name);
        }