Slabon Posted February 20, 2013 Report Share Posted February 20, 2013 Tengo la quest funcional al 100% pero hay un pequeño detalle, sólo retira la piedra alama cuando falla, cuando sube con éxito la habilidad la piedra permanece en el inventario y me gustaría que también se desapareciera. if need_alignment>0 then if pc.learn_grand_master_skill(skill_vnum) then pc.change_alignment(-need_alignment) say_title(string.format("%s ", title)) if 40 == pc.get_skill_level(skill_vnum) then say(string.format("%s ahora es Perfect", skill_name)) else say(string.format("%s entrenado con éxito", skill_name, skill_level-30+1+1)) end say("") say_reward("Ha aumentado con éxito!") say_reward(string.format("Karma perdido: %d ", need_alignment)) say("") else say_title(string.format("%s ", title)) say ("") say_reward("Entrenamineto Fallado!") say("No has podido mejorar la habilidad.") say("") say_reward("Has perdido algo de tu Karma y") say_reward("la piedra alma, las almas se lo han llevado.") say("") pc.change_alignment(-number(need_alignment/3, need_alignment/2)) end end pc.removeitem("50513", 1) end Link to comment Share on other sites More sharing options...
SeMa™ Posted February 20, 2013 Report Share Posted February 20, 2013 Tengo la quest funcional al 100% pero hay un pequeño detalle, sólo retira la piedra alama cuando falla, cuando sube con éxito la habilidad la piedra permanece en el inventario y me gustaría que también se desapareciera. if need_alignment>0 then if pc.learn_grand_master_skill(skill_vnum) then pc.change_alignment(-need_alignment) say_title(string.format("%s ", title)) if 40 == pc.get_skill_level(skill_vnum) then say(string.format("%s ahora es Perfect", skill_name)) else say(string.format("%s entrenado con éxito", skill_name, skill_level-30+1+1)) end say("") say_reward("Ha aumentado con éxito!") say_reward(string.format("Karma perdido: %d ", need_alignment)) say("") pc.removeitem("50513", 1) else say_title(string.format("%s ", title)) say ("") say_reward("Entrenamineto Fallado!") say("No has podido mejorar la habilidad.") say("") say_reward("Has perdido algo de tu Karma y") say_reward("la piedra alma, las almas se lo han llevado.") say("") pc.change_alignment(-number(need_alignment/3, need_alignment/2)) end end pc.removeitem("50513", 1) end Link to comment Share on other sites More sharing options...
Slabon Posted February 20, 2013 Author Report Share Posted February 20, 2013 if need_alignment>0 then if pc.learn_grand_master_skill(skill_vnum) then pc.change_alignment(-need_alignment) say_title(string.format("%s ", title)) if 40 == pc.get_skill_level(skill_vnum) then say(string.format("%s ahora es Perfect", skill_name)) else say(string.format("%s entrenado con éxito", skill_name, skill_level-30+1+1)) end say("") say_reward("Ha aumentado con éxito!") say_reward(string.format("Karma perdido: %d ", need_alignment)) say("") pc.removeitem("50513", 1) else say_title(string.format("%s ", title)) say ("") say_reward("Entrenamineto Fallado!") say("No has podido mejorar la habilidad.") say("") say_reward("Has perdido algo de tu Karma y") say_reward("la piedra alma, las almas se lo han llevado.") say("") pc.change_alignment(-number(need_alignment/3, need_alignment/2)) end end pc.removeitem("50513", 1) end se me olvido comentar que hace un rato hice eso de agregar el removeitem y me daba error al conectar Magnus 1 Link to comment Share on other sites More sharing options...
SeMa™ Posted February 20, 2013 Report Share Posted February 20, 2013 Puedes dejar la quest entera? y no ese trocito? Link to comment Share on other sites More sharing options...
Slabon Posted February 20, 2013 Author Report Share Posted February 20, 2013 Aquí completa: quest training_grandmaster_skill begin state start begin when 50513.use begin say_title("Fertigkeitstraining des Großmeisters") say ("Mit diesem Stein, erfüllt mit Seelen,") say ("wirst du deine Fertigkeiten verbessern können.") say("") wait() if pc.get_skill_group() == 0 then say("§A¨S¦³¥ô¦ó¾·~."..pc.get_skill_group()) return end if get_time() < pc.getqf("next_time") then -- and not is_test_server() then if pc.is_skill_book_no_delay() then say("Um mit dem Fertigkeitstraining des Großmeister") say("fortzufahren klicke auf 'WEITER'.") say("") wait() say_title("Fertigkeitstraining des Großmeister") else say("Du kannst heute nicht weiter trainieren,") say("außer du benutzt eine Exorzismus-Schriftrolle!") return end end local result = training_grandmaster_skill.BuildGrandMasterSkillList(pc.get_job(), pc.get_skill_group()) local vnum_list = result[1] local name_list = result[2] if table.getn(vnum_list) == 0 then say("Fertigkeitstraining des Großmeister") return end say("Wähle die zu trainierende Fertigkeit!") say("") local menu_list = {} table.foreach(name_list, function(i, name) table.insert(menu_list, name) end) table.insert(menu_list, "Abbrechen") local s=select_table(menu_list) if table.getn(menu_list) == s then return end if pc.count_item(50513)==0 then say("Die magische Kraft der Seelen sind erloschen,") say("da du den Stein verloren hast..") say("") return end local skill_name=name_list[s] local skill_vnum=vnum_list[s] local skill_level = pc.get_skill_level(skill_vnum) local cur_alignment = pc.get_real_alignment() local need_alignment = 1000+500*(skill_level-30) test_chat("²{¦bµ½´cÈ: "..cur_alignment) test_chat("»Ýnµ½´cÈ: "..need_alignment) local title=string.format("%s Großmeisterstufe %d Training", skill_name, skill_level-30+1) say_title(title) say("") if cur_alignment<-19000+need_alignment then say_reward("Du hast nicht genügend Rangpunkte") say_reward("für ein erneutes Training.") return end if cur_alignment<0 then say_reward(string.format("Du benötigst %d Rangpunkte -> %d", need_alignment, need_alignment*2)) say_reward("(Wenn du den Seelen bereit bist diese Rangpunkte zu opfern)") say_reward("(drücke 'WEITER'.)") need_alignment=need_alignment*2 elseif cur_alignment<need_alignment then say_reward(string.format("Du benötigst %d Rangpunkte ", need_alignment)) say_reward("(²{¦b×½mªº¸ü, ·|¤U°¨ì®ö¤H¥H¤U.)") else say_reward(string.format("Du benötigst %d Rangpunkte ", need_alignment)) end say("") local s=select("Weiter", "Abbrechen") if s==2 then return end if cur_alignment>=0 and cur_alignment<need_alignment then say_title(string.format("Bestätigen!", title)) say("Wenn du jetzt eine Großmeisterfertigkeit") say("trainierst, könnten deine Rangpunkte unter") say("den Durchschnittslevel fallen, da du bereits zu") say("diesem Zeitpunkt nur wenige besitzt. Wenn du") say("wirklich trainieren willst,") say("gib in das Eingabefeld das Wort") say_reward("Trainieren") say("ein.") say("") say("Willst du nicht trainieren, drücke einfach") say("die Taste 'ENTER'.") local s=input() if s!="Trainieren" then return end end if get_time() < pc.getqf("next_time") then -- and not is_test_server() then if pc.is_skill_book_no_delay() then pc.remove_skill_book_no_delay() else say("[°ª¯Åµ¥¯Å]§Þ¯à×½m¿ù»~: ¥ð®§¤¤") return end end pc.setqf("next_time", get_time()+time_hour_to_sec(number(8, 12))) if need_alignment>0 then if pc.learn_grand_master_skill(skill_vnum) then pc.change_alignment(-need_alignment) say_title(string.format("Fertigkeitstraining des Großmeister erfolgreich!", title)) if 40 == pc.get_skill_level(skill_vnum) then say(string.format("Fertigkeitstraining", skill_name)) else say(string.format(skill_name, skill_level-30+1+1)) end say("") say_reward("Erfolgreich!") say_reward(string.format("Du hast ein paar Rangpunkte verbraucht!")) say("") else say_title(string.format("Großmeister Fertigkeitstraining fehlgeschlagen!", title)) say ("") say_reward("Fehlgeschlagen!") say("Du hast deine Fertigkeit nicht verbessern") say("können") say_reward("Du hast einige Rangpunkte verloren") say_reward("und den Seelenstein verbraucht.") say("") pc.change_alignment(-number(need_alignment/3, need_alignment/2)) end end pc.removeitem("50513", 1) end function BuildGrandMasterSkillList(job, group) GRAND_MASTER_SKILL_LEVEL = 30 PERFECT_MASTER_SKILL_LEVEL = 40 local skill_list = special.active_skill_list[job+1][group] local ret_vnum_list = {} local ret_name_list = {} -- test_chat(string.format("job=%d, group=%d", job, group)) table.foreach(skill_list, function(i, skill_vnum) local skill_level = pc.get_skill_level(skill_vnum) -- test_chat(string.format("[%d]=%d", skill_vnum, skill_level)) if skill_level >= GRAND_MASTER_SKILL_LEVEL and skill_level < PERFECT_MASTER_SKILL_LEVEL then table.insert(ret_vnum_list, skill_vnum) local name=locale.GM_SKILL_NAME_DICT[skill_vnum] if name == nil then name=skill_vnum end table.insert(ret_name_list, name) end end) return {ret_vnum_list, ret_name_list} --return {ret_vnum_list, ret_name_list} end end end luis ricardo porres dias 1 Link to comment Share on other sites More sharing options...
SeMa™ Posted February 20, 2013 Report Share Posted February 20, 2013 Toma esta es mi quest funciona perfect. PD: lo que cambia en tu quest y la mia es item.remove() quest training_grandmaster_skill begin state start begin when 50513.use begin say_title("Entrenar habilidad") if pc.get_skill_group() == 0 then say("No tienes habilidades que perfeccionar"..pc.get_skill_group()) return end if get_time() < pc.getqf("next_time") then -- and not is_test_server() then if pc.is_skill_book_no_delay() then say ( "Con esta piedra puedes" ) say("Fertigkeit perfektionieren.") say ( "Perfeccionar tus habilidades." ) wait() say_title ( "Que habilidad quieres entrenar " ) else say ( "Tienes que esperar un dia para leer de nuevo una" ) say ( "piedra alma o debes leer un pergamino exorcismo" ) say ( "poder continuar con entrenamiento de perefeccion" ) return end end local result = training_grandmaster_skill.BuildGrandMasterSkillList(pc.get_job(), pc.get_skill_group()) local vnum_list = result[1] local name_list = result[2] if table.getn(vnum_list) == 0 then say ( "No hay habilidades que se puedan mejorar." ) return end say ( "selecciona la habilidad que quieres perfeccionar" ) say("") local menu_list = {} table.foreach(name_list, function(i, name) table.insert(menu_list, name) end) table.insert(menu_list, "Cancelar") local s=select_table(menu_list) if table.getn(menu_list) == s then return end local skill_name=name_list[s] local skill_vnum=vnum_list[s] local skill_level = pc.get_skill_level(skill_vnum) local cur_alignment = pc.get_real_alignment() local need_alignment = 1000+800*(skill_level-30) test_chat("Rank actual: "..cur_alignment) test_chat("Necesitas mas rank: "..need_alignment) local title = string . format ( "%s Nivel: %d de Perefeccion" , skill_name , skill_level - 30 + 1 ) say_title(title) say ( "Estas en proceso de perfeccionar una habilidad." ) say ( "Recuerde que debe tener puntos de karma negativo. " ) say("") if cur_alignment<-19000+need_alignment then say_reward ( "Sus puntos de Karma son demasiado bajos para continuar." ) return end if cur_alignment<0 then say_reward ( string . format ( "Puntos de Karma: %d -> %d" , need_alignment , need_alignment * 2 ) ) say_reward ( "Mantengase dentro de esos limites para obtener mas probabilidad de exito." ) need_alignment=need_alignment*2 elseif cur_alignment<need_alignment then say_reward ( string . format ( "Puntos de karma necesarios: %d" , need_alignment ) ) say_reward ( "En cualquier caso, tus puntos se reducira." ) else say_reward ( string . format ( "Puntos necesarios de Karma: %d" , need_alignment ) ) end say("") local s = select ( "Aceptar" , "Cancelar" ) if s==2 then return end if cur_alignment>=0 and cur_alignment<need_alignment then say_title ( string . format ( "%s Estado" , title ) ) say ( "Tienes muy poco rank'." ) say ( "para leer la piedra de habilidad," ) say ( "Necesitas un mayor numero de rank." ) say ( "estas seguro de que quieres leerla igual?." ) say("") say_reward ( "Escribe Si" ) say("") say ( "Es enserio... quieres hacerlo?:" ) local s=input() if s!="Si" then return end end if get_time() < pc.getqf("next_time") then -- and not is_test_server() then if pc.is_skill_book_no_delay() then pc.remove_skill_book_no_delay() else say ( "[d: restante" ) return end end pc.setqf("next_time", get_time()+time_hour_to_sec(number(8, 12))) if need_alignment>0 then if pc.learn_grand_master_skill(skill_vnum) then pc.change_alignment(-need_alignment) say_title ( string . format ( "%s Completada" , title ) ) if 40 == pc.get_skill_level(skill_vnum) then say(string.format("%s Ya estuvo Perfecto", skill_name)) else say ( string . format ( "[°ª¯Åµ¥¯Å]Subiste %s Al %d Nivel." , skill_name , skill_level - 30 + 1 + 1 ) ) end say("") say_reward ( "Entrenamiento de perfeccion Con exito!" ) say_reward ( string . format ( "Rank perdido: %d " , need_alignment ) ) say("") else say_title ( string . format ( "%s en curso" , title ) ) say ( "Que dia mas salado el mio." ) say("") say_reward ( "Entrenamiento de perfeccion fallada." ) say("") pc.change_alignment(-number(need_alignment/3, need_alignment/2)) end end item.remove() end function BuildGrandMasterSkillList(job, group) GRAND_MASTER_SKILL_LEVEL = 30 PERFECT_MASTER_SKILL_LEVEL = 40 local skill_list = special.active_skill_list[job+1][group] local ret_vnum_list = {} local ret_name_list = {} -- test_chat(string.format("job=%d, group=%d", job, group)) table.foreach(skill_list, function(i, skill_vnum) local skill_level = pc.get_skill_level(skill_vnum) -- test_chat(string.format("[%d]=%d", skill_vnum, skill_level)) if skill_level >= GRAND_MASTER_SKILL_LEVEL and skill_level < PERFECT_MASTER_SKILL_LEVEL then table.insert(ret_vnum_list, skill_vnum) local name=locale.GM_SKILL_NAME_DICT[skill_vnum] if name == nil then name=skill_vnum end table.insert(ret_name_list, name) end end) return {ret_vnum_list, ret_name_list} --return {ret_vnum_list, ret_name_list} end end end Link to comment Share on other sites More sharing options...
Tremoulinas Posted February 18, 2016 Report Share Posted February 18, 2016 Hola, acabo de intentar utilizar tu quest de piera alma pero al intentar cargar la quest vía ./qc me dice Segmentation fault (core dumped) pero he descargado otras d otro tipo y ha cargado bien, ¿qué podra ser? Link to comment Share on other sites More sharing options...
libra123 Posted February 19, 2016 Report Share Posted February 19, 2016 pc.change_alignment(-number(need_alignment/3, need_alignment/2)) tu fallo estaba que debiste colocar después de esas lineas el removeitem porque antes cerraste con el end. Link to comment Share on other sites More sharing options...
libra123 Posted February 19, 2016 Report Share Posted February 19, 2016 Hola, acabo de intentar utilizar tu quest de piera alma pero al intentar cargar la quest vía ./qc me dice Segmentation fault (core dumped) pero he descargado otras d otro tipo y ha cargado bien, ¿qué podra ser? analiza, cuando levantas una quest en el virtualbox te dice la linea donde ocurre el error en caso no encontrar has lo que hago crea una linea cortante y si ves que por ahí cae pues el problema esta cerca Link to comment Share on other sites More sharing options...
Tremoulinas Posted February 19, 2016 Report Share Posted February 19, 2016 analiza, cuando levantas una quest en el virtualbox te dice la linea donde ocurre el error en caso no encontrar has lo que hago crea una linea cortante y si ves que por ahí cae pues el problema esta cerca ¿Cómo una línea cortante?, suena interesante para poder empezar a romperme el coco yo con las quests y aprender de verdad. Link to comment Share on other sites More sharing options...
Recommended Posts