// 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; } }
// Token: 0x060003D7 RID: 983 RVA: 0x0000DECC File Offset: 0x0000C2CC public bool equipar_Objeto(ObjetosInventario objeto) { bool flag = objeto == null || objeto.cantidad == 0 || this.cuenta.esta_ocupado(); bool result; if (flag) { this.cuenta.logger.log_Error("INVENTAIRE", "l'objet " + objeto.nombre + " ne peut pas être équipé"); result = false; } else { bool flag2 = objeto.nivel > (short)this.cuenta.juego.personaje.nivel; if (flag2) { this.cuenta.logger.log_Error("INVENTAIRE", "Le niveau de l'objet " + objeto.nombre + " est superieur au niveau actuel."); result = false; } else { bool flag3 = objeto.posicion != InventarioPosiciones.PAS_EQUIPE; if (flag3) { this.cuenta.logger.log_Error("INVENTAIRE", "L'objet " + objeto.nombre + " est déjà équipé"); result = false; } else { List <InventarioPosiciones> list = InventarioUtiles.get_Posibles_Posiciones((int)objeto.tipo); bool flag4 = list == null || list.Count == 0; if (flag4) { this.cuenta.logger.log_Error("INVENTAIRE", "L'objet " + objeto.nombre + " ne peut pas être équipé."); result = false; } else { foreach (InventarioPosiciones inventarioPosiciones in list) { bool flag5 = this.get_Objeto_en_Posicion(inventarioPosiciones) == null; if (flag5) { this.cuenta.conexion.enviar_Paquete("OM" + objeto.id_inventario.ToString() + "|" + ((sbyte)inventarioPosiciones).ToString(), true); this.cuenta.logger.log_informacion("INVENTAIRE", objeto.nombre + " équipé."); objeto.posicion = inventarioPosiciones; Action <bool> action = this.inventario_actualizado; if (action != null) { action(true); } return(true); } } ObjetosInventario objetosInventario; bool flag6 = this._objetos.TryGetValue(this.get_Objeto_en_Posicion(list[0]).id_inventario, out objetosInventario); if (flag6) { objetosInventario.posicion = InventarioPosiciones.PAS_EQUIPE; this.cuenta.conexion.enviar_Paquete("OM" + objetosInventario.id_inventario.ToString() + "|" + -1.ToString(), false); } this.cuenta.conexion.enviar_Paquete("OM" + objeto.id_inventario.ToString() + "|" + ((sbyte)list[0]).ToString(), false); bool flag7 = objeto.cantidad == 1; if (flag7) { objeto.posicion = list[0]; } this.cuenta.logger.log_informacion("INVENTAIRE", objeto.nombre + " équipé."); Action <bool> action2 = this.inventario_actualizado; if (action2 != null) { action2(true); } result = true; } } } } return(result); }