Unk3n0w7 1,321 Posted October 5, 2013 quest arena_manager begin state start begin when 20017.chat."Battle Arena" begin say_title("Yu-Hwan:") say("") say("Hey "..pc.get_name().." olá, sabes") say("o que é Battle Arena? Aqui os jogadores") say("testam os seus poderes.") local s = select("Luta na Arena de Batalhas", "Auxiliar na Arena de Batalhas", "Fechar") if s == 3 then return elseif s == 1 then local minLevel = 35 if not npc.lock() then say_title("Yu-Hwan:") say("") say("Alguém se inscreveu para o") say("Arena de Batalhas.") return end if pc.get_level() < minLevel then say_title("Yu-Hwan:") say("") say("Presica de lvl.:"..minLevel.." para participar") say("na Arena de Batalhas.") npc.unlock() return end local sname local correct = false repeat say_title("Yu-Hwan:") say("") say("Escreva , o nome do parceiro que deseja duelar ") say("na Arena de Batalhas.") sname = input() say_title("Yu-Hwan:") say("") if sname == "" then say(" Escreve mal o nome.") local s = select("Tentar", "Saír") if s == 2 then npc.unlock() return end elseif sname == pc.get_name() then say("You can't fight yourself.") local s = select("Tentar", "Saír") if s == 2 then npc.unlock() return end else say("Você assinou um duelo com: "..sname.."") say("") say("Concordas ?") local s = select("Sim", "Tentar", "Saír") if s == 1 then correct = true elseif s == 3 then npc.unlock() return end end until correct say_title("Yu-Hwan:") say("") local opp_vid = find_pc_by_name(sname) if opp_vid == 0 then say(sname.." não se encontra Online.") npc.unlock() return elseif not pc.is_near_vid(opp_vid, 15) then say("Para enviar um pedido de duelo "..sname.."") say("você deve pedir-lhes para chegar perto de você.") npc.unlock() return elseif arena.is_in_arena(opp_vid) == 0 then say(sname.."está actualmente a duelar na Arena de Batalhas.") npc.unlock() return end local old_vid = pc.select(opp_vid) local opp_liv = pc.get_level() pc.select(old_vid) if opp_liv < minLevel then say("Seu adversario deve ter no mínimo Lv: "..minLevel.." .") npc.unlock() return elseif math.abs(pc.get_level()-opp_liv) > 50 then say("A diferença de níveis entre o seu") say("parceiro e voçê é") say("maximo de 50.") npc.unlock() return end say("Foi enviado um pedido de duelo a "..sname..",") say("esperando resposta do seu adversário...") local str = "Você quer aceitar o duelo com "..pc.get_name().."?" local agree = confirm(opp_vid, str, 30) if agree == 0 then say_title("Yu-Hwan:") say("") say(sname.." não aceitou o pedido para") say("duelar com voçê.") npc.unlock() return end local s = arena.start_duel(sname, 3) if s == 0 then say_title("Yu-Hwan:") say("") say("Seu oponente não se encontra mais on-line.") npc.unlock() return elseif s == 2 then say_title("Yu-Hwan:") say("") say(sname.." está atualmente a lutar na Battle Arena.") npc.unlock() return elseif s == 3 then say_title("Yu-Hwan:") say("") say("Ocorreu um erro. tentar novamente !") npc.unlock() return end npc.unlock() elseif s == 2 then local g = arena.get_duel_list() local arena_name = {} local arena_observer = {} table.foreachi (g , function (n, p) arena_name[n] = p[1].." vs "..p[2] arena_observer[n] = {p[3], p[4], p[5]} end ) table.insert(arena_name, "Close") table.insert(arena_observer, 0) local count = table.getn(g) if count == 0 then say_title("Yu-Hwan:") say("") say("Não há duelos em andamento.") return end say_title("Yu-Hwan:") say("") say("atualmente "..count.." lutas na Battle Arena.") wait() say_title("Yu-Hwan:") say("") local s = select_table(arena_name) if s == table.getn(arena_name) then return end arena.add_observer(arena_observer[s][1], arena_observer[s][2], arena_observer[s][3]) end end endend [*]Créditos : NewForce <- Tradução 4 źĩмßáßŵúĕ, Cαllмєσfficiαl, carlos9534 and 1 other reacted to this Share this post Link to post Share on other sites
RazrDx 1 Posted February 5, 2014 partiu testar .e.e Share this post Link to post Share on other sites
TitaniiuMwOw 17 Posted March 25, 2014 Não funciona, quando dou reload as quest's diz: Calls undclared function! : math.abs Erro ao compilar arena_manager.quest Share this post Link to post Share on other sites
Unk3n0w7 1,321 Posted March 25, 2014 quest_functions Adiciona : math.abs 1 TitaniiuMwOw reacted to this Share this post Link to post Share on other sites
TitaniiuMwOw 17 Posted March 25, 2014 Já deu (+1), mas agora quando carrego no pc está la a dizer Arena de Batalha como eu renomeei mas quando eu aperto não aparece mais nada!! :/ Share this post Link to post Share on other sites
obetuno 431 Posted April 22, 2014 Funciona perfeitamente... Mas não teleporta para o mapa de duelos, como deveria :( Share this post Link to post Share on other sites
SINOLOGY 220 Posted June 14, 2015 Aqui fica a quest mais corrigida que esta, testada e a funcionar, por KORKEN.Não alterar nada. Está em PT-PThttp://pastebin.com/32X9LzMZ Share this post Link to post Share on other sites