Exemple #1
0
        public ObjetosInventario(string paquete)
        {
            string[] separador = paquete.Split('~');

            id_inventario = Convert.ToUInt32(separador[0], 16);
            id_modelo     = Convert.ToInt32(separador[1], 16);
            cantidad      = Convert.ToInt32(separador[2], 16);

            if (!string.IsNullOrEmpty(separador[3]))
            {
                posicion = (InventarioPosiciones)Convert.ToSByte(separador[3], 16);
            }

            FileInfo archivo_item = new FileInfo("items/" + id_modelo + ".xml");

            if (archivo_item.Exists)
            {
                archivo_objeto  = XElement.Load(archivo_item.FullName);
                nombre          = archivo_objeto.Element("NOMBRE").Value;
                pods            = short.Parse(archivo_objeto.Element("PODS").Value);
                tipo            = byte.Parse(archivo_objeto.Element("TIPO").Value);
                nivel           = short.Parse(archivo_objeto.Element("NIVEL").Value);
                tipo_inventario = InventarioUtiles.get_Objetos_Inventario(tipo);

                archivo_objeto = null;
            }

            archivo_item = null;
        }
        // Token: 0x060003F6 RID: 1014 RVA: 0x0000E8FC File Offset: 0x0000CCFC
        public ObjetosInventario(string paquete)
        {
            string[] array = paquete.Split(new char[]
            {
                '~'
            });
            this.id_inventario = Convert.ToUInt32(array[0], 16);
            this.id_modelo     = Convert.ToInt32(array[1], 16);
            this.cantidad      = Convert.ToInt32(array[2], 16);
            bool flag = !string.IsNullOrEmpty(array[3]);

            if (flag)
            {
                this.posicion = (InventarioPosiciones)Convert.ToSByte(array[3], 16);
            }
            string[] array2 = array[4].Split(new char[]
            {
                ','
            });
            foreach (string text in array2)
            {
                string[] array4 = text.Split(new char[]
                {
                    '#'
                });
                string value = array4[0];
                bool   flag2 = string.IsNullOrEmpty(value);
                if (!flag2)
                {
                    int  num   = Convert.ToInt32(value, 16);
                    bool flag3 = num == 110;
                    if (flag3)
                    {
                        this.vida_regenerada = Convert.ToInt16(array4[1], 16);
                    }
                }
            }
            FileInfo fileInfo = new FileInfo("items/" + this.id_modelo.ToString() + ".xml");
            bool     exists   = fileInfo.Exists;

            if (exists)
            {
                this.archivo_objeto  = XElement.Load(fileInfo.FullName);
                this.nombre          = this.archivo_objeto.Element("NOMBRE").Value;
                this.pods            = short.Parse(this.archivo_objeto.Element("PODS").Value);
                this.tipo            = byte.Parse(this.archivo_objeto.Element("TIPO").Value);
                this.nivel           = short.Parse(this.archivo_objeto.Element("NIVEL").Value);
                this.tipo_inventario = InventarioUtiles.get_Objetos_Inventario(this.tipo);
                this.archivo_objeto  = null;
            }
        }
Exemple #3
0
        public ObjetosInventario(string paquete)
        {
            string[] separador = paquete.Split('~');

            id_inventario = Convert.ToUInt32(separador[0], 16);
            id_modelo     = Convert.ToInt32(separador[1], 16);
            cantidad      = Convert.ToInt32(separador[2], 16);

            if (!string.IsNullOrEmpty(separador[3]))
            {
                posicion = (InventarioPosiciones)Convert.ToSByte(separador[3], 16);
            }

            string[] split = separador[4].Split(',');
            foreach (string stat in split)
            {
                string[] separador_stats = stat.Split('#');
                string   id = separador_stats[0];

                if (string.IsNullOrEmpty(id))
                {
                    continue;
                }

                int stat_id = Convert.ToInt32(id, 16);
                if (stat_id == 110)
                {
                    vida_regenerada = Convert.ToInt16(separador_stats[1], 16);
                }
            }

            FileInfo archivo_item = new FileInfo("items/" + id_modelo + ".xml");

            if (archivo_item.Exists)
            {
                archivo_objeto  = XElement.Load(archivo_item.FullName);
                nombre          = archivo_objeto.Element("NOMBRE").Value;
                pods            = short.Parse(archivo_objeto.Element("PODS").Value);
                tipo            = byte.Parse(archivo_objeto.Element("TIPO").Value);
                nivel           = short.Parse(archivo_objeto.Element("NIVEL").Value);
                tipo_inventario = InventarioUtiles.get_Objetos_Inventario(tipo);

                archivo_objeto = null;
            }
        }
Exemple #4
0
        public ObjetosInventario(string paquete)
        {
            string[] separador = paquete.Split('~');

            id_inventario = Convert.ToUInt32(separador[0], 16);
            id_modelo     = Convert.ToInt32(separador[1], 16);
            cantidad      = Convert.ToInt32(separador[2], 16);

            if (!string.IsNullOrEmpty(separador[3]))
            {
                posicion = Convert.ToInt16(separador[3], 16);
            }
            else
            {
                posicion = -1;
            }

            FileInfo mapa_archivo = new FileInfo("items/" + id_modelo + ".xml");

            if (mapa_archivo.Exists)
            {
                archivo_objeto  = XElement.Load(mapa_archivo.FullName);
                nombre          = archivo_objeto.Element("NOMBRE").Value;
                pods            = byte.Parse(archivo_objeto.Element("PODS").Value);
                tipo            = byte.Parse(archivo_objeto.Element("TIPO").Value);
                tipo_inventario = get_Objetos_Inventario(tipo);

                archivo_objeto = null;
            }
            else
            {
                nombre          = "Desconocido";
                tipo_inventario = TipoObjetosInventario.DESCONOCIDO;
            }
            mapa_archivo = null;
        }