// Token: 0x06000444 RID: 1092 RVA: 0x0000F6D0 File Offset: 0x0000DAD0 private bool get_Intentar_Mover_Interactivo(KeyValuePair <short, ObjetoInteractivo> interactivo) { this.interactivo_recolectando = interactivo.Value; byte distancia_detener = 1; ObjetosInventario objetosInventario = this.cuenta.juego.personaje.inventario.get_Objeto_en_Posicion(InventarioPosiciones.CAC); bool flag = objetosInventario != null; if (flag) { distancia_detener = this.get_Distancia_herramienta(objetosInventario.id_modelo); } ResultadoMovimientos resultadoMovimientos = this.cuenta.juego.manejador.movimientos.get_Mover_A_Celda(this.interactivo_recolectando.celda, this.mapa.celdas_ocupadas(), true, distancia_detener); ResultadoMovimientos resultadoMovimientos2 = resultadoMovimientos; bool result; if (resultadoMovimientos2 > ResultadoMovimientos.MISMA_CELDA) { this.get_Cancelar_Interactivo(); result = false; } else { this.get_Intentar_Recolectar_Interactivo(); result = true; } return(result); }
// Token: 0x0600047A RID: 1146 RVA: 0x00010D30 File Offset: 0x0000F130 private void dataGridView_recursos_CellContentClick(object sender, DataGridViewCellEventArgs e) { bool flag = e.ColumnIndex < 5; if (!flag) { ObjetosInventario objetosInventario = this.cuenta.juego.personaje.inventario.recursos.ElementAt(e.RowIndex); string text = this.dataGridView_recursos.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); int cantidad; bool flag2 = !int.TryParse(Interaction.InputBox(string.Concat(new string[] { "Réduire la quantité de ", text.ToLower(), " de l'objet ", objetosInventario.nombre, " (0 = tout):" }), text, "1", -1, -1), out cantidad); if (!flag2) { string text2 = text; string text3 = text2; if (text3 != null) { if (text3 == "Supprimer") { this.cuenta.juego.personaje.inventario.eliminar_Objeto(objetosInventario, cantidad, true); } } } } }
private void dataGridView_equipamientos_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex < 5) { return; } ObjetosInventario objeto = cuenta.juego.personaje.inventario.equipamiento.ElementAt(e.RowIndex); string accion = dataGridView_equipamientos.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); switch (accion) { case "Equipar": cuenta.juego.personaje.inventario.equipar_Objeto(objeto); break; case "Desequipar": cuenta.juego.personaje.inventario.desequipar_Objeto(objeto); break; case "Eliminar": if (MessageBox.Show("Realmente deseas eliminar " + objeto.nombre + "?", "Eliminar un objeto", MessageBoxButtons.YesNo) == DialogResult.Yes) { cuenta.juego.personaje.inventario.eliminar_Objeto(objeto, 1, true); } break; } }
private bool get_Intentar_Mover_Interactivo(KeyValuePair <short, ObjetoInteractivo> interactivo) { interactivo_recolectando = interactivo.Value; byte distancia_detener = 1; ObjetosInventario arma = cuenta.juego.personaje.inventario.get_Objeto_en_Posicion(InventarioPosiciones.ARMA); if (arma != null) { distancia_detener = get_Distancia_herramienta(arma.id_modelo); } ResultadoMovimientos resultado_movimiento = cuenta.juego.manejador.movimientos.get_Mover_A_Celda(interactivo_recolectando.celda, mapa.celdas_ocupadas(), true, distancia_detener); switch (resultado_movimiento) { case ResultadoMovimientos.EXITO: case ResultadoMovimientos.MISMA_CELDA: get_Intentar_Recolectar_Interactivo(); return(true); default: get_Cancelar_Interactivo(); return(false); } }
internal override async Task <ResultadosAcciones> proceso(Account cuenta) { ObjetosInventario objeto = cuenta.Game.Character.inventario.get_Objeto_Modelo_Id(modelo_id); if (objeto != null && cuenta.Game.Character.inventario.equipar_Objeto(objeto)) { await Task.Delay(500); } return(ResultadosAcciones.HECHO); }
internal override async Task <ResultadosAcciones> proceso(Cuenta cuenta) { ObjetosInventario objeto = cuenta.juego.personaje.inventario.get_Objeto_Modelo_Id(modelo_id); if (objeto != null && cuenta.juego.personaje.inventario.equipar_Objeto(objeto)) { await Task.Delay(500); } return(ResultadosAcciones.HECHO); }
private async Task get_Verificar_Script_Regeneracion() { Table auto_regeneracion = manejador_script.get_Global_Or <Table>("AUTO_REGENERACION", DataType.Table, null); if (auto_regeneracion == null) { return; } PersonajeJuego personaje = cuenta.juego.personaje; int vida_minima = auto_regeneracion.get_Or("VIDA_MINIMA", DataType.Number, 0); int vida_maxima = auto_regeneracion.get_Or("VIDA_MAXIMA", DataType.Number, 100); if (vida_minima == 0 || personaje.caracteristicas.porcentaje_vida > vida_minima) { return; } int fin_vida = vida_maxima * personaje.caracteristicas.vitalidad_maxima / 100; int vida_para_regenerar = fin_vida - personaje.caracteristicas.vitalidad_actual; List <int> objetos = auto_regeneracion.Get("OBJETOS").ToObject <List <int> >(); foreach (int id_objeto in objetos) { if (vida_para_regenerar < 20) { break; } ObjetosInventario objeto = personaje.inventario.get_Objeto_Modelo_Id(id_objeto); if (objeto == null) { continue; } if (objeto.vida_regenerada <= 0) { continue; } int cantidad_necesaria = (int)Math.Floor(vida_para_regenerar / (double)objeto.vida_regenerada); int cantidad_correcta = Math.Min(cantidad_necesaria, objeto.cantidad); for (int j = 0; j < cantidad_correcta; j++) { personaje.inventario.utilizar_Objeto(objeto); await Task.Delay(800); } vida_para_regenerar -= objeto.vida_regenerada * cantidad_correcta; } }
public bool equipar(int modelo_id) { ObjetosInventario objeto = cuenta.juego.personaje.inventario.get_Objeto_Modelo_Id(modelo_id); if (objeto == null || objeto.posicion != InventarioPosiciones.NO_EQUIPADO) { return(false); } manejar_acciones.enqueue_Accion(new EquiparItemAccion(modelo_id), true); return(true); }
public bool utilizar(int modelo_id) { ObjetosInventario objeto = cuenta.juego.personaje.inventario.get_Objeto_Modelo_Id(modelo_id); if (objeto == null) { return(false); } manejar_acciones.enqueue_Accion(new UtilizarObjetoAccion(modelo_id), true); return(true); }
// Token: 0x06000194 RID: 404 RVA: 0x00007360 File Offset: 0x00005760 internal override async Task <ResultadosAcciones> proceso(Cuenta cuenta) { ObjetosInventario objeto = cuenta.juego.personaje.inventario.get_Objeto_Modelo_Id(this.modelo_id); bool flag = objeto != null; if (flag) { cuenta.juego.personaje.inventario.utilizar_Objeto(objeto); await Task.Delay(800); } return(ResultadosAcciones.HECHO); }
private Dictionary <short, ObjetoInteractivo> get_Interactivos_Utilizables(List <short> elementos_ids) { Dictionary <short, ObjetoInteractivo> elementos_utilizables = new Dictionary <short, ObjetoInteractivo>(); GameCharacter personaje = cuenta.Game.Character; ObjetosInventario arma = personaje.inventario.get_Objeto_en_Posicion(InventarioPosiciones.ARMA); byte distancia_arma = 1; bool es_herramienta_pescar = false; if (arma != null) { distancia_arma = get_Distancia_herramienta(arma.id_modelo); es_herramienta_pescar = herramientas_pescar.Contains(arma.id_modelo); } foreach (ObjetoInteractivo interactivo in _map.interactivos.Values) { if (!interactivo.es_utilizable || !interactivo.modelo.recolectable) { continue; } List <Celda> path = pathfinder.get_Path(personaje.celda, interactivo.celda, _map.celdas_ocupadas(), true, distancia_arma); if (path == null || path.Count == 0) { continue; } foreach (short habilidad in interactivo.modelo.habilidades) { if (!elementos_ids.Contains(habilidad)) { continue; } if (!es_herramienta_pescar && path.Last().get_Distancia_Entre_Dos_Casillas(interactivo.celda) > 1) { continue; } if (es_herramienta_pescar && path.Last().get_Distancia_Entre_Dos_Casillas(interactivo.celda) > distancia_arma) { continue; } elementos_utilizables.Add(interactivo.celda.id, interactivo); } } return(elementos_utilizables); }
// Token: 0x060000DC RID: 220 RVA: 0x00004E9C File Offset: 0x0000329C private async Task get_Verificar_Script_Regeneracion() { Table auto_regeneracion = this.manejador_script.get_Global_Or <Table>("AUTO_REGENERATION", DataType.Table, null); bool flag = auto_regeneracion == null; if (!flag) { PersonajeJuego personaje = this.cuenta.juego.personaje; int vida_minima = auto_regeneracion.get_Or("VIE_MIN", DataType.Number, 0); int vida_maxima = auto_regeneracion.get_Or("VIE_MAX", DataType.Number, 100); bool flag2 = vida_minima == 0 || personaje.caracteristicas.porcentaje_vida > vida_minima; if (!flag2) { int fin_vida = vida_maxima * personaje.caracteristicas.vitalidad_maxima / 100; int vida_para_regenerar = fin_vida - personaje.caracteristicas.vitalidad_actual; List <int> objetos = auto_regeneracion.Get("OBJETS").ToObject <List <int> >(); foreach (int id_objeto in objetos) { bool flag3 = vida_para_regenerar < 20; if (flag3) { break; } ObjetosInventario objeto = personaje.inventario.get_Objeto_Modelo_Id(id_objeto); bool flag4 = objeto == null; if (!flag4) { bool flag5 = objeto.vida_regenerada <= 0; if (!flag5) { int cantidad_necesaria = (int)Math.Floor((double)vida_para_regenerar / (double)objeto.vida_regenerada); int cantidad_correcta = Math.Min(cantidad_necesaria, objeto.cantidad); for (int i = 0; i < cantidad_correcta; i++) { personaje.inventario.utilizar_Objeto(objeto); await Task.Delay(800); } vida_para_regenerar -= (int)objeto.vida_regenerada * cantidad_correcta; objeto = null; } } } List <int> .Enumerator enumerator = default(List <int> .Enumerator); } } }
// Token: 0x06000132 RID: 306 RVA: 0x000062C8 File Offset: 0x000046C8 public bool utiliser(int modelo_id) { ObjetosInventario objetosInventario = this.cuenta.juego.personaje.inventario.get_Objeto_Modelo_Id(modelo_id); bool flag = objetosInventario == null; bool result; if (flag) { result = false; } else { this.manejar_acciones.enqueue_Accion(new UtilizarObjetoAccion(modelo_id), true); result = true; } return(result); }
// Token: 0x06000133 RID: 307 RVA: 0x00006318 File Offset: 0x00004718 public bool equiper(int modelo_id) { ObjetosInventario objetosInventario = this.cuenta.juego.personaje.inventario.get_Objeto_Modelo_Id(modelo_id); bool flag = objetosInventario == null || objetosInventario.posicion != InventarioPosiciones.PAS_EQUIPE; bool result; if (flag) { result = false; } else { this.manejar_acciones.enqueue_Accion(new EquiparItemAccion(modelo_id), true); result = true; } return(result); }
// Token: 0x06000443 RID: 1091 RVA: 0x0000F4FC File Offset: 0x0000D8FC private Dictionary <short, ObjetoInteractivo> get_Interactivos_Utilizables(List <short> elementos_ids) { Dictionary <short, ObjetoInteractivo> dictionary = new Dictionary <short, ObjetoInteractivo>(); PersonajeJuego personaje = this.cuenta.juego.personaje; ObjetosInventario objetosInventario = personaje.inventario.get_Objeto_en_Posicion(InventarioPosiciones.CAC); byte b = 1; bool flag = false; bool flag2 = objetosInventario != null; if (flag2) { b = this.get_Distancia_herramienta(objetosInventario.id_modelo); flag = Recoleccion.herramientas_pescar.Contains(objetosInventario.id_modelo); } foreach (ObjetoInteractivo objetoInteractivo in this.mapa.interactivos.Values) { bool flag3 = !objetoInteractivo.es_utilizable || !objetoInteractivo.modelo.recolectable; if (!flag3) { List <Celda> list = this.pathfinder.get_Path(personaje.celda, objetoInteractivo.celda, this.mapa.celdas_ocupadas(), true, b); bool flag4 = list == null || list.Count == 0; if (!flag4) { foreach (short item in objetoInteractivo.modelo.habilidades) { bool flag5 = !elementos_ids.Contains(item); if (!flag5) { bool flag6 = !flag && list.Last <Celda>().get_Distancia_Entre_Dos_Casillas(objetoInteractivo.celda) > 1; if (!flag6) { bool flag7 = flag && list.Last <Celda>().get_Distancia_Entre_Dos_Casillas(objetoInteractivo.celda) > (int)b; if (!flag7) { dictionary.Add(objetoInteractivo.celda.id, objetoInteractivo); } } } } } } } return(dictionary); }
private void dataGridView_recursos_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex < 5) { return; } ObjetosInventario objeto = cuenta.personaje.inventario.recursos.ElementAt(e.RowIndex); string accion = dataGridView_recursos.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); if (!int.TryParse(Interaction.InputBox($"Ingresa la cantidad para {accion.ToLower()} el objeto {objeto.nombre} (0 = toda la cantidad):", accion, "1"), out int cantidad)) { return; } switch (accion) { case "Eliminar": cuenta.personaje.inventario.eliminar_Objetos(objeto, cantidad, true); break; } }
private void dataGridView_equipamientos_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex < 5) { return; } ObjetosInventario objeto = cuenta.personaje.inventario.equipamiento.ElementAt(e.RowIndex); if (Interaction.MsgBox("Realmente deseas eliminar " + objeto.nombre + "?", MsgBoxStyle.YesNo, "Eliminar un objeto") != MsgBoxResult.Yes) { return; } string accion = dataGridView_equipamientos.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); switch (accion) { case "Eliminar": cuenta.personaje.inventario.eliminar_Objetos(objeto, 1, true); break; } }
// Token: 0x06000479 RID: 1145 RVA: 0x00010BFC File Offset: 0x0000EFFC private void dataGridView_equipamientos_CellContentClick(object sender, DataGridViewCellEventArgs e) { bool flag = e.ColumnIndex < 5; if (!flag) { ObjetosInventario objetosInventario = this.cuenta.juego.personaje.inventario.equipamiento.ElementAt(e.RowIndex); string text = this.dataGridView_equipamientos.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); string text2 = text; string text3 = text2; if (text3 != null) { if (!(text3 == "Equiper")) { if (!(text3 == "Desequiper")) { if (text3 == "Supprimer") { bool flag2 = MessageBox.Show("Tu es sur de supprimer ? " + objetosInventario.nombre + "?", "Supprimer un objet", MessageBoxButtons.YesNo) == DialogResult.Yes; if (flag2) { this.cuenta.juego.personaje.inventario.eliminar_Objeto(objetosInventario, 1, true); } } } else { this.cuenta.juego.personaje.inventario.desequipar_Objeto(objetosInventario); } } else { this.cuenta.juego.personaje.inventario.equipar_Objeto(objetosInventario); } } } }
public async Task <ResultadoLanzandoHechizo> manejador_Hechizos(PeleaHechizos hechizo) { if (hechizo_para_lanzar != -1 && hechizo_para_lanzar == hechizo.id) { if (GlobalConf.mostrar_mensajes_debug) { cuenta.logger.log_informacion("DEBUG", $"Se ha lanzado el hechizo {hechizo.nombre} atacando a {enemigos_tocados} enemigos en la celda {celda_objetivo}"); } await pelea.get_Lanzar_Hechizo(hechizo.id, celda_objetivo); hechizo_para_lanzar = -1; celda_objetivo = -1; enemigos_tocados = 0; return(ResultadoLanzandoHechizo.LANZADO); } if (!get_Distancia_Buena(hechizo)) { return(ResultadoLanzandoHechizo.NO_LANZADO); } if (hechizo.necesita_piedra)//Para capturar { ObjetosInventario arma = cuenta.juego.personaje.inventario.get_Objeto_en_Posicion(InventarioPosiciones.ARMA); if (arma != null && arma.id_modelo != 83) { return(await get_Lanzar_Hechizo_Simple(hechizo)); } else { return(ResultadoLanzandoHechizo.NO_LANZADO); } } if (hechizo.focus == HechizoFocus.CELDA_VACIA) { return(await lanzar_Hechizo_Celda_Vacia(hechizo)); } if (hechizo.metodo_lanzamiento == MetodoLanzamiento.AMBOS && !hechizo.es_aoe) { return(await get_Lanzar_Hechizo_Simple(hechizo)); } if (hechizo.metodo_lanzamiento == MetodoLanzamiento.ALEJADO && !hechizo.es_aoe && !pelea.esta_Cuerpo_A_Cuerpo_Con_Enemigo()) { return(await get_Lanzar_Hechizo_Simple(hechizo)); } if (hechizo.metodo_lanzamiento == MetodoLanzamiento.CAC && !hechizo.es_aoe && pelea.esta_Cuerpo_A_Cuerpo_Con_Enemigo()) { return(await get_Lanzar_Hechizo_Simple(hechizo)); } if (hechizo.metodo_lanzamiento == MetodoLanzamiento.CAC && !hechizo.es_aoe && !pelea.esta_Cuerpo_A_Cuerpo_Con_Enemigo()) { return(await get_Mover_Lanzar_hechizo_Simple(hechizo, get_Objetivo_Mas_Cercano(hechizo))); } if (hechizo.es_aoe) { if (pelea.total_enemigos_vivos > 1) { return(await lanzar_Hechizo_AOE(hechizo)); } else { return(await get_Lanzar_Hechizo_Simple(hechizo)); } } return(ResultadoLanzandoHechizo.NO_LANZADO); }