nahtanoj 15 Posted August 20, 2012 Estou tentando implementar uma quest no jogo para quando o personagem atingir nivel 80,Na quest ele terá de matar certa quantidade de inimigos de outras nações e receberá como recompença gold e xp e items.Alguem que entenda de quests sabe me dizer por que a quest não ta aparecendo no jogo quando atingi o nivel 80?Código da quest: quest invasion beginstate start begin when login or levelup with pc.get_level() > 79 begin set_state("pannelo") endendstate pannelo begin when letter begin send_letter("Parar a invasao!") end when button or info begin say_title("Parar Invasao") say ("Nossa aldeia foi atacada por varios reinos inimigos, estamos em perigo!") say ("Precisamos matar 10 inimigos nos reinos de lutadores de nivel superior para 80!") say ("10 oponentes de cada reino. Voce tem quatro horas para cumprir a missao") say ("depois sera tarde demais para nos ....") say("") if pc.get_empire() == 1 then set_state("time_kill_shinsoo") elseif pc.get_empire() == 2 then set_state("time_kill_chunjo") elseif pc.get_empire() == 3 then set_state("time_kill_jinno") end endendstate time_kill_shinsoo begin when letter begin send_letter("A Grande Invasão! ") end when button or info begin say_title("Parar a invasao antes que eles cheguem aqui! ") say("Voce Matou " .. pc.getqf("killa_chunjo") .. " 10 da Uniao Chunjo") say("Voce Matou " .. pc.getqf("killa_jinno") .. " 10 da Uniao Jinno") end when kill with npc.is_pc() and pc.get_level() > 79 and pc.get_empire() == 2 begin pc.setqf("killa_chunjo",pc.getqf("killa_chunjo") +1) if pc.getqf("killa_chunjo") == 10 and pc.getqf("killa_jinno") == 10 and timer("timer2")==false then chat ("Parou a invasao em tempo!") chat ("Va para o comandante ele lhe dara uma recompensa!") set_state("come_guardian") end end when kill with npc.is_pc() and pc.get_level() > 79 and pc.get_empire() == 3 begin pc.setqf("killa_jinno",pc.getqf("killa_jinno") +1) if pc.getqf("killa_chunjo") == 10 and pc.getqf("killa_jinno") == 10 then chat ("Acabou com a invasao em tempo!") chat ("Va para o comandante lhe dara uma recompensa!") set_state("come_guardian") end endendstate time_kill_chunjo begin when letter begin send_letter("A Grande Invasao!") end when button or info begin say_title ("Acabar a invasao antes de chegar aqui!") say ("Voce ainda tem" .. timer == 60 .. "Minutos") say ("Voce matou" .. pc.getqf ("killa_shinsoo") .. "10 da Uniao Shinsoo") say ("Voce matou" .. pc.getqf ("killa_jinno") .. "10 da Uniao Jinno") end when kill with npc.is_pc() and pc.get_level() > 79 and pc.get_empire() == 1 begin pc.setqf("killa_shinsoo",pc.getqf("killa_shinsoo") +1) if pc.getqf("killa_shinsoo") == 10 and pc.getqf("killa_jinno") == 10 then chat ("Parou a invasao em tempo!") chat ("Va para o comandante lhe dara uma recompensa!") set_state("come_guardian") end end when kill with npc.is_pc() and pc.get_level() > 79 and pc.get_empire() == 3 begin pc.setqf("killa_jinno",pc.getqf("killa_jinno") +1) if pc.getqf("killa_shinsoo") == 10 and pc.getqf("killa_jinno") == 10 then chat ("Parou a invasao em tempo!") chat ("Va para o comandante lhe dara uma recompensa!") set_state("come_guardian") end endendstate time_kill_jinno begin when letter begin send_letter("A Grande Invasao!") end when button or info begin say_title ("Parar a invasao antes de chegar aqui!") say ("Voce ainda tem" timers .. \ .. 60 "Minutes") say ("Voce matou" .. pc.getqf ("killa_chunjo") .. " 10 da Uniao Chunjo") say ("Voce matou" .. pc.getqf ("killa_shinsoo") .. "10 da Uniao Shinsoo end when kill with npc.is_pc() and pc.get_level > 79 and pc.get_empire() == 2 begin pc.setqf("killa_chunjo",pc.getqf("killa_chunjo") +1) if pc.getqf("killa_chunjo") == 10 and pc.getqf("killa_shinsoo") == 10 then chat ("Parou a invasao em tempo!") chat ("Va para o comandante lhe dara uma recompensa!") set_state("come_guardian") end end when kill with npc.is_pc() and pc.get_level() > 79 and pc.get_empire() == 1 begin pc.setqf("killa_shinsoo",pc.getqf("killa_shinsoo") +1) if pc.getqf("killa_chunjo") == 10 and pc.getqf("killa_shinsoo") == 10 then chat ("Parou a invasao em tempo!") chat ("Va para o comandante lhe dara uma recompensa!") set_state("come_guardian") end endendstate come_guardian begin when letter begin send_letter("A Grande Invasao, vao ao comandante") local v = find_npc_by_vnum ( 20355 ) if v != 0 then target.vid ( "TARGET" , v, "Comandante" ) end end when button or info begin say_title ("Terminou a invasao! O comandante esta esperando por voce!") say ("Voce parou a invasao do inimigo, va para o comandante") say ("Vou dar uma grande recompensa!") say ("") end when 20355.chat."Comandante" or TARGET.target.click begin target.delete ( "TARGET" ) say_title ("Invasao Terminou!") say ("Bom trabalho!" pc.get_name .. () .. "Voce e nosso heroi!") say ("Isto e para voce:") say_reward ("10000000 Exp") say_reward ("5000000 Gold") pc.changegold(5000000) pc.give_exp(10000000) pc.delqf("killa_shinsoo") pc.delqf("killa_chunjo") pc.delqf("killa_jinno") set_state("completo") endendstate completo beginendstate quest_failed begin pc.delqf("killa_shinsoo") pc.delqf("killa_chunjo") pc.delqf("killa_jinno")endend Share this post Link to post Share on other sites
Valenza 855 Posted August 20, 2012 when login or levelup with pc.get_level() > 79 begin ... ve se isto é o problema... altere o 79 por 80 Share this post Link to post Share on other sites
nahtanoj 15 Posted August 21, 2012 não é isto não >.< ja era 80 antes e não funcionava eu mudei pra 79 e não aparece a quest em nível nenhum Share this post Link to post Share on other sites
Ramz 128 Posted August 21, 2012 o erro ta na linha 89 say ("Voce matou" .. pc.getqf ("killa_shinsoo") .. "10 da Uniao Shinsoocorreção;say ("Voce matou" .. pc.getqf ("killa_shinsoo") .. "10 da Uniao Shinsoo")Eu só vi este não sei se tem mais.. Share this post Link to post Share on other sites
nahtanoj 15 Posted August 21, 2012 Fiz umas alterações na quest agora ta a dar um erro na linha 148systax error: [string "come_guardian"]:3: `)´ expected near `pc´invasion.quest:148:abort (core dumped) quest invasion begin state start begin when login or levelup with pc.get_level() >= 80 begin set_state("pannelo") end end state pannelo begin when letter begin send_letter("Parar a invasao!") end when button or info begin say_title("Parar Invasao") say ("Nossa aldeia foi atacada por varios reinos inimigos, estamos em perigo!") say ("Precisamos matar 10 inimigos nos reinos de lutadores de nivel superior para 80!") say ("10 oponentes de cada reino. Voce tem quatro horas para cumprir a missao") say ("depois sera tarde demais para nos ....") say("") timer("timer2" , 14400) if pc.get_empire() == 1 then set_state("time_kill_shinsoo") elseif pc.get_empire() == 2 then set_state("time_kill_chunjo") elseif pc.get_empire() == 3 then set_state("time_kill_jinno") end end end state time_kill_shinsoo begin when letter begin send_letter("Parar a invasao! ") end when button or info begin say_title("Parar a invasao antes que eles cheguem aqui! ") say("Voce ainda tem " .. timer () .. "60 Minutos") say("Voce Matou " .. pc.getqf("killa_chunjo") .. " 10 da Uniao Chunjo") say("Voce Matou " .. pc.getqf("killa_jinno") .. " 10 da Uniao Jinno") end when kill with npc.is_pc() and pc.level >= 80 and pc.get_empire() == 2 begin pc.setqf("killa_chunjo",pc.getqf("killa_chunjo") +1) if pc.getqf("killa_chunjo") == 10 and pc.getqf("killa_jinno") == 10 and timer("timer2")==false then chat ("Parou a invasao em tempo!") chat ("Va para o comandante ele lhe dara uma recompensa!") set_state("come_guardian") end end when kill with npc.is_pc() and pc.level >= 80 and pc.get_empire() == 3 begin pc.setqf("killa_jinno",pc.getqf("killa_jinno") +1) if pc.getqf("killa_chunjo") == 10 and pc.getqf("killa_jinno") == 10 and timer("timer2")==false then chat ("Acabou com a invasao em tempo!") chat ("Va para o comandante lhe dara uma recompensa!") set_state("come_guardian") end end when timer2 begin chat("Tempo acabou!") chat("Falhou na missao!") set_state("quest_failed") end end state time_kill_chunjo begin when letter begin send_letter("A Grande Invasao!") end when button or info begin say_title ("Acabar a invasao antes de chegar aqui!") say ("Voce ainda tem" .. timer () .. "60 Minutos") say ("Voce matou" .. pc.getqf ("killa_shinsoo") .. "10 da Uniao Shinsoo") say ("Voce matou" .. pc.getqf ("killa_jinno") .. "10 da Uniao Jinno") end when kill with npc.is_pc() and pc.level >= 80 and pc.get_empire() == 1 begin pc.setqf("killa_shinsoo",pc.getqf("killa_shinsoo") +1) if pc.getqf("killa_shinsoo") == 10 and pc.getqf("killa_jinno") == 10 and timer("timer2")==false then chat ("Parou a invasao em tempo!") chat ("Va para o comandante lhe dara uma recompensa!") set_state("come_guardian") end end when kill with npc.is_pc() and pc.level >= 80 and pc.get_empire() == 3 begin pc.setqf("killa_jinno",pc.getqf("killa_jinno") +1) if pc.getqf("killa_shinsoo") == 10 and pc.getqf("killa_jinno") == 10 and timer("timer2")==false then chat ("Parou a invasao em tempo!") chat ("Va para o comandante lhe dara uma recompensa!") set_state("come_guardian") end end when timer2 begin chat ("Tempo acabou!") chat ("Falhou na missao!") set_state("quest_failed") end end state time_kill_jinno begin when letter begin send_letter("A Grande Invasao!") end when button or info begin say_title ("Stop a invasao antes de chegar aqui!") say ("Voce ainda tem" .. timer () .. "60 Minutos") say ("Voce matou" .. pc.getqf ("killa_chunjo") .. " 10 da Uniao Chunjo") say ("Voce matou" .. pc.getqf ("killa_shinsoo") .. "10 da Uniao Shinsoo") end when kill with npc.is_pc() and pc.level >= 80 and pc.get_empire() == 2 begin pc.setqf("killa_chunjo",pc.getqf("killa_chunjo") +1) if pc.getqf("killa_chunjo") == 10 and pc.getqf("killa_shinsoo") == 10 and timer("timer2")==false then chat ("Stop Invasion in Time!") chat ("Va para o comandante lhe dara uma recompensa!") set_state("come_guardian") end end when kill with npc.is_pc() and pc.level >= 80 and pc.get_empire() == 1 begin pc.setqf("killa_shinsoo",pc.getqf("killa_shinsoo") +1) if pc.getqf("killa_chunjo") == 10 and pc.getqf("killa_shinsoo") == 10 and timer("timer2")==false then chat ("Parou a invasao em tempo!") chat ("Va para o comandante lhe dara uma recompensa!") set_state("come_guardian") end end end state come_guardian begin when letter begin send_letter("A Grande Invasao, vao ao comandante") local v = find_npc_by_vnum ( 20355 ) if v != 0 then target.vid ( "TARGET" , v, "Comandante" ) end end when button or info begin say_title ("Terminou a invasao! O comandante esta esperando por voce!") say ("Voce parou a invasao do inimigo, va para o comandante") say ("Vou dar uma grande recompensa!") say ("") end when 20355.chat."Comandante" or TARGET.target.click begin target.delete ( "TARGET" ) say_title ("Invasao Terminou!") say ("Bom trabalho!" pc.get_name .. () .. "Voce e nosso heroi!") say ("Isto e para voce:") say_reward ("10000000 Exp") say_reward ("5000000 Gold") pc.changegold(5000000) pc.give_exp(10000000) pc.delqf("killa_shinsoo") pc.delqf("killa_chunjo") pc.delqf("killa_jinno") set_state("completo") end end state completo begin end state quest_failed begin pc.delqf("killa_shinsoo") pc.delqf("killa_chunjo") pc.delqf("killa_jinno") endend Share this post Link to post Share on other sites
Ramz 128 Posted August 21, 2012 linha 137: say ("Bom trabalho!" pc.get_name .. () .. "Voce e nosso heroi!")correção:say ("Bom trabalho!"..pc.get_name().."Voce e nosso heroi!") Share this post Link to post Share on other sites
nahtanoj 15 Posted August 21, 2012 depois de novas alterações agr me da um erro na linha 158 =/no finalzinexpection `when´ or `function´invasion.quest:158:abort (core dumped) quest invasion begin state start begin when login or levelup with pc.get_level() >= 80 begin set_state("pannelo") end end state pannelo begin when letter begin send_letter("Parar a invasao!") end when button or info begin say_title("Parar Invasao") say ("Nossa aldeia foi atacada por varios reinos inimigos, estamos em perigo!") say ("Precisamos matar 10 inimigos nos reinos de lutadores de nivel superior para 80!") say ("10 oponentes de cada reino. Voce tem quatro horas para cumprir a missao") say ("depois sera tarde demais para nos ....") say("") timer("timer2" , 14400) if pc.get_empire() == 1 then set_state("time_kill_shinsoo") elseif pc.get_empire() == 2 then set_state("time_kill_chunjo") elseif pc.get_empire() == 3 then set_state("time_kill_jinno") end end end state time_kill_shinsoo begin when letter begin send_letter("Parar a invasao! ") end when button or info begin say_title("Parar a invasao antes que eles cheguem aqui! ") say("Voce ainda tem " .. timer () .. "60 Minutos") say("Voce Matou " .. pc.getqf("killa_chunjo") .. " 10 da Uniao Chunjo") say("Voce Matou " .. pc.getqf("killa_jinno") .. " 10 da Uniao Jinno") end when kill with npc.is_pc() and pc.level >= 80 and pc.get_empire() == 2 begin pc.setqf("killa_chunjo",pc.getqf("killa_chunjo") +1) if pc.getqf("killa_chunjo") == 10 and pc.getqf("killa_jinno") == 10 and timer("timer2")==false then chat ("Parou a invasao em tempo!") chat ("Va para o comandante ele lhe dara uma recompensa!") set_state("come_guardian") end end when kill with npc.is_pc() and pc.level >= 80 and pc.get_empire() == 3 begin pc.setqf("killa_jinno",pc.getqf("killa_jinno") +1) if pc.getqf("killa_chunjo") == 10 and pc.getqf("killa_jinno") == 10 and timer("timer2")==false then chat ("Acabou com a invasao em tempo!") chat ("Va para o comandante lhe dara uma recompensa!") set_state("come_guardian") end end when timer2.timer begin chat("Tempo acabou!") chat("Falhou na missao!") set_state("quest_failed") end end state time_kill_chunjo begin when letter begin send_letter("A Grande Invasao!") end when button or info begin say_title ("Acabar a invasao antes de chegar aqui!") say ("Voce ainda tem" .. timer () .. "60 Minutos") say ("Voce matou" .. pc.getqf ("killa_shinsoo") .. "10 da Uniao Shinsoo") say ("Voce matou" .. pc.getqf ("killa_jinno") .. "10 da Uniao Jinno") end when kill with npc.is_pc() and pc.level >= 80 and pc.get_empire() == 1 begin pc.setqf("killa_shinsoo",pc.getqf("killa_shinsoo") +1) if pc.getqf("killa_shinsoo") == 10 and pc.getqf("killa_jinno") == 10 and timer("timer2")==false then chat ("Parou a invasao em tempo!") chat ("Va para o comandante lhe dara uma recompensa!") set_state("come_guardian") end end when kill with npc.is_pc() and pc.level >= 80 and pc.get_empire() == 3 begin pc.setqf("killa_jinno",pc.getqf("killa_jinno") +1) if pc.getqf("killa_shinsoo") == 10 and pc.getqf("killa_jinno") == 10 and timer("timer2")==false then chat ("Parou a invasao em tempo!") chat ("Va para o comandante lhe dara uma recompensa!") set_state("come_guardian") end end when timer2.timer begin chat ("Tempo acabou!") chat ("Falhou na missao!") set_state("quest_failed") end end state time_kill_jinno begin when letter begin send_letter("A Grande Invasao!") end when button or info begin say_title ("Stop a invasao antes de chegar aqui!") say ("Voce ainda tem" .. timer () .. "60 Minutos") say ("Voce matou" .. pc.getqf ("killa_chunjo") .. " 10 da Uniao Chunjo") say ("Voce matou" .. pc.getqf ("killa_shinsoo") .. "10 da Uniao Shinsoo") end when kill with npc.is_pc() and pc.level >= 80 and pc.get_empire() == 2 begin pc.setqf("killa_chunjo",pc.getqf("killa_chunjo") +1) if pc.getqf("killa_chunjo") == 10 and pc.getqf("killa_shinsoo") == 10 and timer("timer2")==false then chat ("Stop Invasion in Time!") chat ("Va para o comandante lhe dara uma recompensa!") set_state("come_guardian") end end when kill with npc.is_pc() and pc.level >= 80 and pc.get_empire() == 1 begin pc.setqf("killa_shinsoo",pc.getqf("killa_shinsoo") +1) if pc.getqf("killa_chunjo") == 10 and pc.getqf("killa_shinsoo") == 10 and timer("timer2")==false then chat ("Parou a invasao em tempo!") chat ("Va para o comandante lhe dara uma recompensa!") set_state("come_guardian") end end when timer2.timer begin chat("Tempo acabou!") chat("Falhou na missao!") set_state("quest_failed") end end state come_guardian begin when letter begin send_letter("A Grande Invasao, vao ao comandante") local v = find_npc_by_vnum ( 20355 ) if v != 0 then target.vid ( "TARGET" , v, "Comandante" ) end end when button or info begin say_title ("Terminou a invasao! O comandante esta esperando por voce!") say ("Voce parou a invasao do inimigo, va para o comandante") say ("Vou dar uma grande recompensa!") say ("") end when __TARGET__.target.click or 20355.chat."Comandante" begin target.delete ( "__TARGET__" ) say_title ("Invasao Terminou!") say ("Bom trabalho!" .. pc.get_name () .. "Voce e nosso heroi!") say ("Isto e para voce:") say_reward ("10000000 Exp") say_reward ("5000000 Gold") pc.change_money(5000000) pc.give_exp2(10000000) pc.delqf("killa_shinsoo") pc.delqf("killa_chunjo") pc.delqf("killa_jinno") set_state("completo") end end state completo begin end state quest_failed begin pc.delqf("killa_shinsoo") pc.delqf("killa_chunjo") pc.delqf("killa_jinno") endend Share this post Link to post Share on other sites
felipex3 43 Posted August 24, 2012 Mude essa linha: when login or levelup with pc.get_level() >= 80 begin Para essa: when login or levelup with pc.level >= 80 begin Cumprimentos. Share this post Link to post Share on other sites
Cσяvσ⋆ 1,804 Posted September 12, 2014 Tópico Fechado Motivo: Sem resposta final, tópico sem actividade à mais de 90 dias por parte de quem o criou. Movido de Metin2 - Dúvidas para Lixeira do Fórum. Share this post Link to post Share on other sites