CryptoMT2 7 Posted March 24, 2016 alguem consegue corrigir esta quest? queria alguma coisa parecida a isto tirei ideias de algum lado e tentei fazer por mim mas esta a dar erro se alguem souber corrigir que deixe ai pode fazer falta para mais alguem a quest... quest cavalo beginstate mester beginlocal d = find_npc_by_vnum(20349)if d != 0 thentarget.vid("__TARGET__", d, "Consegue o teu cavalo armado")end when __TARGET__.target.click or 20349.chat."Consegue o teu cavalo armado" with pc.get_level() < 25 begintarget.delete("__TARGET__")say_title("Rapaz do Estabulo:")say("Com esta missao te permite")say("subir o nível do teu cavalo.")say("Mas tens de matar 100 Arqueiros Escorpiao")say("Depois dissos poderas cavalgar.")say("") local temo = select ("Aceito" , "Sair")if temo == 2 then return endif temo == 1 thentimer("tempo", 1200)q.set_counter("Arqueiro Escorpiao", 100)endend when 2105.kill with q.set_counter("Arqueiro Escorpiao") == 0 beginsay_title("".. pc.get_name() ..":")say("Finalmente conseguiste matar todos os Arqueiros Escorpiao")say("dentro do tempo estimado...")say("Premio:")say_reward("Cavalo Armado")horse.set_level(11)horse.summon()set_state(mester1)end when tiempo1.timer beginsay_title("Falhaste a missao")say("Infelizmente falhaste.")say("Tenta de novo mais tarde.")endend state mester1 beginlocal a = find_npc_by_vnum(20349)if a != 0 thentarget.vid("__TARGET__", a, "Consegue o teu cavalo militar")end when __TARGET__.target.click or 20349.chat."Consegue o teu cavalo militar" with pc.get_level() < 50 begintarget.delete("__TARGET__")say_title("Rapaz do Estabulo:")say("Com esta missao te permite")say("subir o nivel do teu cavalo.")say("Mas tens de matar 500 Arqueiro Demonio")say("Depois dissos poderas cavalgar.")say("") locale temo = select ("Aceito" , "Sair")if temo == 2 then return endif temo == 1 thentimer("tempo", 1800)q.set_counter("Arqueiro Demonio", 500)endend when 1002.kill with q.set_counter("Arqueiro Demonio") == 0 beginsay_title("".. pc.get_name() ..":")say("Finalmente conseguiste matar todos os Arqueiro Demonio")say("dentro do tempo estimado...")say("Premio:")say_reward("Cavalo Militar")horse.set_level(21)horse.summon()set_state(completada)end when tiempo2.timer beginsay_title("Falhaste a missao")say("Infelizmente falhaste.")say("Tenta de novo mais tarde.")endend state completada beginendend Share this post Link to post Share on other sites
NewWars 875 Posted March 24, 2016 Topico movido de Metin2 - Quests para Metin2 - PedidosPonto de aviso dado.Sobre a Quest: state mester begin local d = find_npc_by_vnum(20349) if d != 0 then target.vid("__TARGET__", d, "Consegue o teu cavalo armado") end O state primário a ser executado chama-se "start", têm atenção que se a quest é autónoma(não mudado o state viaoutra quest) ela somente se iniciará por start. Não especificaste o when state, presumo que seja login? when __TARGET__.target.click or 20349.chat."Consegue o teu cavalo armado" with pc.get_level() < 25 begin Aconselho a fazeres a verificação do nível logo no target, evita mandares fazer um novo target sem necessidade, consome menos recursos(mesmo não tendo muito interesse visto a quest que é)Onde está a contagem de kills? Somente vejo quando chegar a 0 restantes, ele a dar o prêmio, e: when 2105.kill with q.set_counter("Arqueiro Escorpiao") == 0 begin q.set_counter como diz é função de "set", por isso não retorna nada, simplesmente atribui,e a mesma leva dois argumentos(nome(str), valor(int))Convêm que faças um state entre iniciar e completar a missão, senão vai continuar sempre igual as kills porque nunca irás sair do mesmo state, e também limpares os counters.E também convêm limpares os timers.Aqui está a quest corrigida e melhorada a meu ver:http://pastebin.com/wZFtzQC6Não a testei, tenho algumas duvidas em quanto a nomes de 1 ou 2 funções e estrutura, mas se não funcionar é facil de arranjar/ver. 2 CryptoMT2 and Portugapt reacted to this Share this post Link to post Share on other sites
CryptoMT2 7 Posted March 24, 2016 Topico movido de Metin2 - Quests para Metin2 - Pedidos Ponto de aviso dado. Sobre a Quest: state mester begin local d = find_npc_by_vnum(20349) if d != 0 then target.vid("__TARGET__", d, "Consegue o teu cavalo armado") end O state primário a ser executado chama-se "start", têm atenção que se a quest é autónoma (não mudado o state viaoutra quest) ela somente se iniciará por start. Não especificaste o when state, presumo que seja login? when __TARGET__.target.click or 20349.chat."Consegue o teu cavalo armado" with pc.get_level() < 25 begin Aconselho a fazeres a verificação do nível logo no target, evita mandares fazer um novo target sem necessidade, consome menos recursos(mesmo não tendo muito interesse visto a quest que é) Onde está a contagem de kills? Somente vejo quando chegar a 0 restantes, ele a dar o prêmio, e: when 2105.kill with q.set_counter("Arqueiro Escorpiao") == 0 begin q.set_counter como diz é função de "set", por isso não retorna nada, simplesmente atribui, e a mesma leva dois argumentos(nome(str), valor(int)) Convêm que faças um state entre iniciar e completar a missão, senão vai continuar sempre igual as kills porque nunca irás sair do mesmo state, e também limpares os counters. E também convêm limpares os timers. Aqui está a quest corrigida e melhorada a meu ver: http://pastebin.com/wZFtzQC6 Não a testei, tenho algumas duvidas em quanto a nomes de 1 ou 2 funções e estrutura, mas se não funcionar é facil de arranjar/ver. +1 pelo esclarecimento ... pesso desculpa por meter o topico no sitio errado... mas continua a dar o erro when ou function alguem consegue corrigir? Share this post Link to post Share on other sites
NewWars 875 Posted March 25, 2016 +1 pelo esclarecimento ... pesso desculpa por meter o topico no sitio errado... mas continua a dar o erro when ou function alguem consegue corrigir? Experimenta outra vez, esqueci me de fechar o primeiro state. Cumprimentos. 1 CryptoMT2 reacted to this Share this post Link to post Share on other sites
CryptoMT2 7 Posted March 26, 2016 Experimenta outra vez, esqueci me de fechar o primeiro state. Cumprimentos. ja ficou melhor mas continua a dar um erro fica ai o print Share this post Link to post Share on other sites
CryptoMT2 7 Posted March 27, 2016 alguem pode ajudar ou arranjar uma quest ja feita de fazer o armado ou o militar assim ou parecida so mudando os moobs? Share this post Link to post Share on other sites
CryptoMT2 7 Posted March 30, 2016 bem se ninguem tem a quest podem eliminar o topico obrigado ao NewWars pela tentativa Share this post Link to post Share on other sites
Khavro 467 Posted March 30, 2016 Está aqui a quest para o cavalo armado: quest horse_upgrade begin state start begin when 20349.chat."I would like to improve my horse" with horse.get_grade()==1 and horse.get_level()==10 begin if horse.is_dead() then say_title("Stable Lad:") say("") ----"123456789012345678901234567890123456789012345678901234567890"| say("You cannot improve a dead horse! Go and get the Sujin") say("Dungeon Herb and I will revive your horse.") say("") say_item_vnum(50057) say("Then we can talk about improving your horse.") say("") elseif pc.level<=34 then say_title("Stable Lad:") say("") ----"123456789012345678901234567890123456789012345678901234567890"| say("Your level is too low to improve a horse. Only after") say("you have reached level 35 you can improve your horse,") say("so come back when you get that far.") say("") elseif horse.get_level()<=9 then say_title("Stable Lad:") say("") ----"123456789012345678901234567890123456789012345678901234567890"| say("The level of your horse is too low to improve it.") say("") say("Go and train even further your horsemanship. When your") say("horse has reached level 10, you can come back again.") say("") elseif pc.countitem("50050")<1 then say_title("Stable Lad:") say("") ----"123456789012345678901234567890123456789012345678901234567890"| say("If you want to improve your horse, you must pass a") say("suitability test.") say("") say("Like the last time, you need a Horse Medal for taking part") say("at this test. You can get them in the Apes Dungeon.") say("") say_item_vnum(50050) say("Of course, the monkeys will not let you pass so easy.") say("") setstate(need_item50050) elseif pc.countitem("50051")<1 then say_title("Stable Lad:") say("") ----"123456789012345678901234567890123456789012345678901234567890"| say("I don't want to tell you this twice:") say("") say_item_vnum(50051) say("You have to carry your riding license with you if you") say("want to ride!") say("") elseif horse.get_level()==10 and not horse.is_dead() and pc.countitem("50050")>=1 and pc.level>=35 then say_title("Stable Lad:") say("") ----"123456789012345678901234567890123456789012345678901234567890"| say("If you get the Armed Horse Book, you can attack your") say("opponent from the back of a horse. I will test your") say("combat experience and your horsemanship. Go to the desert") say("and kill some Scorpion or Snake Archers.") say("") say("You are allowed to go there with a group, but YOU") say("must be the group leader.") say("") local b=select("Accept", "Decline") if 1==b then if pc.countitem("50050")>=1 then pc.removeitem("50050", 1) setstate(test) end elseif 2==b then say("Ok, come again later.") else say("UNKNOWN BUTTON ["..b.."]") end else say_title("Stable Lad:") say("") say("I think you cannot get the Armed Horse Book.") say("That is strange, I don't know why.") say("You should ask a Game Master what is going on.") say("") end end end state need_item50050 begin when letter begin setskin(NOWINDOW) makequestbutton("Get a Horse Medal") q.set_title("Get a Horse Medal!") q.start() end when button or info begin say_title("Get a Horse Medal!") say("") ----"123456789012345678901234567890123456789012345678901234567890"| say("You need a Horse Medal to start the Armed Horse Book Quest.") say("") say_item_vnum(50050) say("It can be found in the Ape Dungeons.") say("") setstate(start) q.done() end end state test begin when letter begin q.set_counter("Archers left", 50-pc.getqf("kill_count")) end when 2105.party_kill begin pc.setqf("kill_count", pc.getqf("kill_count")+1) q.set_counter("Archers remaining:", 50-pc.getqf("kill_count")) if get_time()>=pc.getqf("limit_time") then setstate(failure) end end when 2107.party_kill begin pc.setqf("kill_count", pc.getqf("kill_count")+1) q.set_counter("Archers remaining:", 50-pc.getqf("kill_count")) if get_time()>=pc.getqf("limit_time") then setstate(failure) q.done() end end when letter begin q.set_clock("Time left", pc.getqf("limit_time")-get_time()) end when enter begin pc.setqf("limit_time", get_time()+30*60) pc.setqf("kill_count", 0) end when leave begin q.done() end when letter begin setskin(NOWINDOW) makequestbutton("Armed horse test") q.set_title("Armed horse test") q.start() end when button or info begin say_title("Armed Horse test") say("") say("Kill 50 Scorpion or Snake Archers in 30 minutes") say("and then report to the Stable Boy.") say("") say("You can get the help of a party as long as you") say("are the leader.") say("") end when 2105.party_kill with pc.getf("horse_upgrade","kill_count") >= 50 and pc.getf("horse_upgrade","limit_time")>=get_time() begin setstate(report) end when 2107.party_kill with pc.getf("horse_upgrade","kill_count") >= 50 and pc.getf("horse_upgrade","limit_time")>=get_time() begin setstate(report) end when 20349.chat."Progress of the Armed Horse Test" begin say_title("Stable Boy:") say("") say("Kill 50 Scorpion or Snake Archers in 30 minutes") say("and then report to the Stable Boy.") say("") say("You can get the help of a party as long as you") say("are the leader.") say("") local b=select("Next", "Abort") if 1==b then elseif 2==b then say_title("Stable Lad:") say("") say("Are you sure you want to abort the mission?") say("") local b=select("Yes.", "It was just a joke!") if 1==b then say_title("Stable Lad:") say("") say("Ok, Good luck next time.") say("") setstate(start) q.done() elseif 2==b then say_title("Stable Lad:") say("") say("You have no time for this!") say("") say("Go and kill as fast as possible 50 Scorpion or") say("Snake Archers!") say("") else say("Unknown Button ["..b.."]") end else say("Unknown Button ["..b.."]") end end end state report begin when letter begin setskin(NOWINDOW) makequestbutton("Back to the Stable Lad") q.set_title("Back to the Stable Lad") q.start() end when button or info begin say_title("Back to the Stable Lad") say("") say("Give the Stable Lad a report on the test results.") say("") end when 20349.chat."Armed horse quest report" with horse.get_grade()!=1 begin setstate(start) q.done() end when 20349.chat."Armed Horse Test results" with horse.get_grade()==1 begin say_title("Stable Lad:") say("") say("Well done.") say("If you want to improve your horse now, you have to") say("change your Horse Medal for an Armed Horse Book.") say("") say("This will take a while. Why don't you come again") say("later? By the way, you also need 500.000 Yang") say("for buying the Armed Horse Book.") say("") if is_test_server() then pc.setqf("make_time", get_time()+10) else pc.setqf("make_time", get_time()+4*60*60) end setstate(wait) end end state wait begin when letter begin setskin(NOWINDOW) makequestbutton("Wait for the Armed Horse Book") q.set_title("Wait for the Armed Horse Book") q.start() end when button or info begin say_title("Wait for the Armed Horse Book") say("") say("Wait until the Stable Lad has produced the Armed Horse") say("Book. It should take around 4 hours.") say("") end when login with get_time()>=pc.getf("horse_upgrade","make_time") begin setstate(buy) end when 20349.chat."Improve your horse's status" with horse.get_grade()!=1 begin setstate(start) q.done() end when 20349.chat."Is the licence ready?" with horse.get_grade()==1 begin say_title("Stable Lad:") say("") say("I am sorry, but you have to wait a little bit") say("longer. Oh, and don't forget:") say("") say("You need 500.000 Yang for the Armed Horse Book.") say("") end end state buy begin when letter begin setskin(NOWINDOW) makequestbutton("Go to the Stable Lad") q.set_title("Go to the Stable Lad") q.start() end when button or info begin say_title("Go to the Stable Lad") say("") say("Go to the Stable Lad and fetch the Armed Horse Book.") say("") say_item_vnum(50052) say("You need a Horse Medal and 500.000 Yang as well.") say("") end when 20349.chat."Improve your horse's status" with horse.get_grade()!=1 begin setstate(start) q.done() end when 20349.chat."Improve your horse's status" with horse.get_grade()==1 and horse.get_level()!=10 begin setstate(start) q.done() end when 20349.chat."The license is ready!" with horse.get_grade()==1 and horse.get_level()==10 begin say_title("Stable Lad:") ----"123456789012345678901234567890123456789012345678901234567890"| say("") say("When you got the Armed Horse Book, you will be able to ride") say("faster and attack while riding.") say("") say("It will be a tough ride. But this is how you must prepare") say("for the Military Horse Book..") say("") say("And don't forget you will need 500.000 Yang to improve") say("your horse's status.") say("") local b=select("Upgrade my horse", "Don't upgrade yet") if 1==b then if pc.money>=500000 then if pc.countitem("50051")>=1 then char_log(0, "HORSE_UPGRADE", "BEGIN") pc.changemoney(-500000) char_log(0, "HORSE_UPGRADE", "DEC money 500000") pc.removeitem("50051", 1) char_log(0, "HORSE_UPGRADE", "DEC 50051 1") horse.unride() horse.advance() horse.ride() char_log(0, "HORSE_UPGRADE", "INC horse_advance 1") pc.give_item2("50052", 1) char_log(0, "HORSE_UPGRADE", "INC 50052 1") char_log(0, "HORSE_UPGRADE", "END") say_title("Stable Lad:") say("") say("As I said earlier...") say("") say("When you own the Armed Horse Book , you can call your") say("horse anywhere.") say("") say("But if you lose it, you will have to buy a new one.") say("So look after it.") say("") setstate(start) q.done() else say_title("Stable Lad:") say("") say("You need the Horse Sword for receiving") say("the Armed Horse Book.") end else say_title("Stable Lad:") say("") say("You need 500.000 Yang to purchase the Armed") say("Horse book. Come back when you got the Yang.") say("") end else say_title("Stable Lad:") say("") say("Come again if you want to get the license.") say("") end end end state failure begin when letter begin setskin(NOWINDOW) makequestbutton("Time up!") q.set_title("Time up!") q.start() end when button or info begin say_title("Time up!") say("") ----"123456789012345678901234567890123456789012345678901234567890"| l say("Unfortunately, you have not managed to kill 50 Scorpion or") say("Snake Archers in time. Therefore your test has failed.") say("") say("If you want to try it again, get a new Horse Medal and") say("go back to the Stable Boy.") say("") setstate(start) q.done() end end state __COMPLETE__ begin when enter begin q.done() end end end 1 CryptoMT2 reacted to this Share this post Link to post Share on other sites
NewWars 875 Posted March 30, 2016 Experimenta novamente, já corrigi. Cumprimentos. 1 CryptoMT2 reacted to this Share this post Link to post Share on other sites
CryptoMT2 7 Posted March 31, 2016 Experimenta novamente, já corrigi. Cumprimentos. Continua a dar erro é tipo a que o ДНР * Khavro passou mas mais simples tipo so precisava de ter a mensagem cavalo armado e cavalo militar no estabulo e depois quem chegava ao nivel das missoes fazia a missao... Eu vou traduzir a dele tentar apagar a missao nivel 10 e deixar so as outras duas a ver se nao me da erro se nao der é perfeito so falta mudar tambem a parte de esperar um dia para receber o livro dava logo eu vou tentar arranjar a ver se consigo depois digo alguma... Obrigado aos dois. Share this post Link to post Share on other sites
Khavro 467 Posted March 31, 2016 Continua a dar erro é tipo a que o ДНР * Khavro passou mas mais simples tipo so precisava de ter a mensagem cavalo armado e cavalo militar no estabulo e depois quem chegava ao nivel das missoes fazia a missao... Eu vou traduzir a dele tentar apagar a missao nivel 10 e deixar so as outras duas a ver se nao me da erro se nao der é perfeito so falta mudar tambem a parte de esperar um dia para receber o livro dava logo eu vou tentar arranjar a ver se consigo depois digo alguma... Obrigado aos dois. Telmo tenho também a missão de nível 1 para cavalo e para o cavalo militar. A missão que enviei anteriormente é a missão do metin2 oficial, caso tenhas algumas duvidas diz que tento ajudar). 1 CryptoMT2 reacted to this Share this post Link to post Share on other sites
CryptoMT2 7 Posted March 31, 2016 Telmo tenho também a missão de nível 1 para cavalo e para o cavalo militar. A missão que enviei anteriormente é a missão do metin2 oficial, caso tenhas algumas duvidas diz que tento ajudar). Eu estou a pensar ja todos começarem com o cavalo de nivel 1 e depois terem que ir ao estabulo para fazer a missao do militar como no oficial com tempo limite so nao precisa é de pedir medalha é so chegar la clicar na missao se estiver nivel 50 faz a missao se tiver sucesso volta ao estabulo e recebe o livro de chamar cavalo militar e fica logo com cavalo militar. E para o armado é a mesma coisa so preciso mudar o nivel e os moobs Share this post Link to post Share on other sites
Khavro 467 Posted April 1, 2016 Eu estou a pensar ja todos começarem com o cavalo de nivel 1 e depois terem que ir ao estabulo para fazer a missao do militar como no oficial com tempo limite so nao precisa é de pedir medalha é so chegar la clicar na missao se estiver nivel 50 faz a missao se tiver sucesso volta ao estabulo e recebe o livro de chamar cavalo militar e fica logo com cavalo militar. E para o armado é a mesma coisa so preciso mudar o nivel e os moobs Tens de meter eles começarem com o cavalo não a nível 1 mas sim a nível 10 e depois quando fazer o armado editar na quest para o cavalo ir não para nível 11 mas sim para nível 20. Share this post Link to post Share on other sites
CryptoMT2 7 Posted April 2, 2016 alguem me sabe dizer como mudo isto para nao ter que esperar nada em vez de 4 horas? if is_test_server() then pc.setqf("make_time", get_time()+10) else pc.setqf("make_time", get_time()+4*60*60) end eu meti tudo 0 mas nao funcionou Share this post Link to post Share on other sites
Khavro 467 Posted April 2, 2016 alguem me sabe dizer como mudo isto para nao ter que esperar nada em vez de 4 horas? if is_test_server() then pc.setqf("make_time", get_time()+10) else pc.setqf("make_time", get_time()+4*60*60) end eu meti tudo 0 mas nao funcionou Experimenta assim: pc.setqf("make_time", get_time()+4*60*0) 1 luiz198413 reacted to this Share this post Link to post Share on other sites